Skip to content

Schveitzer/cypress_e2e_testes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

End-to-End Testing with Cypress and Cucumber

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)

Contents

Project Structure

.
├── 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

Requirements

Getting Started

Install dependencies:

$ yarn install

Running the Tests:

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

Report

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:

screenshot-127-0-1-1-41433-2020-10-03-14-17-31

Running with Docker

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

Report

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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published