I made it to showcase what kind of work I can do with Cypress within a very limited timeframe.
-
Install Cypress following the instructions from the official documentation: https://docs.cypress.io/guides/getting-started/installing-cypress
-
Clone this repo: git clone "https://github.com/cstemmer/cypress_sampleShop.git"
-
The repo has 6 spec files:
add_to_cart.cy.js - checks whether items can be successfully added to cart
header.cy.js - checks whether all ui elements of header are present
login.cy.js - tests for successful and unsuccessful login
logout.cy.js - checks whether user can log out
product_catalog.cy.js - checks whether elements of product catalog are displayed correctly and if hover behavior works correctly
registration.cy.js - registers a new user with unique name and email
It supports tests for two kinds of devices, mobile and desktop.
In order to run all of them on mobile, run this in terminal:
npm run test:mobile
For desktop, run this in termimal:
npm run test:desktop
Run this command in terminal (replacing the fragments within <> with actual values):
npx cypress run --spec --env device= --config video=false --browser chrome --headed
You can also run
npx cypress open
This will open cypress navigation window and you will be able to choose a spec you'd like to run.