As a Quality Engineer, I want to define code standard on Cypress architecture in order to implement test automation based on User Journey scenarios.
- Cypress All-in-one Framework
- Mocha Library to provide test group (describe) and test functions (it)
- Chai Library to provide assertions
CYPRESS/
├─ cypress/
│ ├── e2e/
│ │ └── <name>.cy.js
│ │
│ ├── fixtures/
│ │ ├── <name>.csv
│ │ └── <name>.json
│ │
│ ├── support/
│ │ ├── pages/
│ │ │ ├── <name>Page.js
│ │ │ └── <name2>Page.js
│ │ │
│ │ ├── commands.js
│ │ └── e2e.js
│ │
│ └── videos/
│ └── <name>cy.js.mp4
│
├── .cypress.config.js
├── .package.json
└── README.md
-
e2e: test files with describe/it functions and expected assertions
- File:
- Pattern:
<name>.cy.js
- Example:
signIn.cy.js
- Pattern:
- File:
-
fixtures: files with input data for the tests. It can be used different types of input file (*.csv, *.png, *.js, *.json).
- File:
- Pattern:
<name>.json
- Example:
dealer.json
- Pattern:
- File:
-
pages: files with selectors mapping and action functions that the selectors executes.
- File:
- Pattern:
<name>Page.js
- Example:
signInPage.js
- Pattern:
- File:
-
commands.js file to create general group actions, e.g. customize wait element including extra validations or hook function to set environment parameters.
-
cypress.config.js: environment configuration file.
git clone REPO-PATH
npm install
cypress:open-prod
: Open Cypress based on PRODUCTION environment
cypress:open-stg
: Open Cypress based on STAGE environment
cypress:chrome-prod
: Execute Cypress tests based on PRODUCTION environment
cypress:chrome-smoke-prod
: Execute Cypress tests based on PRODUCTION environment and Test Name
cypress:chrome-smoke-stg
: Execute Cypress tests based on STAGE environment and Test Name
cypress:firefox
: Execute Cypress tests based on FIREFOX browser
cypress:webkit
: Execute Cypress tests based on WEBKIT browser
cypress:edge
: Execute Cypress tests based on EDGE browser