he project includes:
- Frameworks:
- Cypress
- Features:
- Tests using Gherkin language with Cucumber
- Test execution with Docker
- Data-driven tests
- Page Object Pattern
- Custom commands
- Style guide based on ES6
- Reports with Allure (Screenshots in case of failure)
.
├── cypress
│ ├── fixtures
│ │ └── credentials.json // Contains credentials used in tests
│ ├── integration
│ │ ├── constants
│ │ │ └── SystemMessages.constant.js // Contains system messages
│ │ ├── features
│ │ │ └── login
│ │ │ └── login.feature // Feature to be tested
│ │ ├── pages
│ │ │ └── Login.page.js // Page Object file for the Login page
│ │ └── steps
│ │ └── login.steps.js // Steps file consumed by the feature file
│ ├── plugins
│ │ └── index.js
│ └── support
│ ├── commands.js // Contains custom commands
│ └── index.js
├── cypress.json
├── package.json
├── README.md
└── yarn.lock
- node >= 12.18.x - How to install Node
- yarn >= 1.17.x - How to install Yarn
- Docker (Optional) >= 18.09 - How to install Docker
Install dependencies:
$ yarn install
First, you need to set the environment variable with the system's URL:
Cypress automatically recognizes environment variables that start with CYPRESS_*
$ export CYPRESS_BASE_URL=https://www.serasa.com.br
To execute the tests in Google Chrome visually::
$ yarn test:chrome
To execute the tests in headless mode in Google Chrome:
$ yarn test:chrome:headless
To generate the report, run the following command:
You must be in the /testes_e2e_cypress directory
$ yarn report:generate
To open the report in the browser, execute:
$ yarn report:open
Here is an example of the generated report:
To execute the tests using Docker:
$ export CYPRESS_BASE_URL=https://www.serasa.com.br
Build the Docker image:
$ make -i build
Run the tests:
$ make test.run
Copy the report files:
$ make report.get
View the report:
You must be in the /testes_e2e_cypress directory
$ yarn report:generate
To open the report in the browser, execute:
$ yarn report:open