Skip to content

Testes automatizado na aplicação ServeRest. Cypress com testes e2e na ui/api, com CI do github actions e report do Allure.

Notifications You must be signed in to change notification settings

DougSantos3/template_cypress_with_report

Repository files navigation

Automation with Cypress on ServeRest


Quality Gate Status Bugs Code Smells Duplicated Lines (%)



This is a Test QA - project using cypress.

Getting Started

You need to download the packages:

# Node
v20.18.0 lts
# npm version: 11.0.0
# Download dependencies
npm install

Run tests:

# Open dashboard cypress
npm run cy:open

# Run tests ui env qa
npm run test:ui:qa

# Run tests api env qa
npm run test:api:qa

# After run test, create report. Use this command if you need to save the report for future reference or for sharing it with colleagues. With the error image of the failed test case attached to the report
npm run view:report
# Or use this command if you need to view the report for yourself and do not need to save it.  With the error image of the failed test case attached to the report
npm run server

# After running a test once, you can use the command npm run allure:history. Then, when you run the tests again, any new or differing results will be added, and trends will appear within the Allure report. This is beneficial because it allows you to view a graph displaying multiple executions, including both failed and successful tests.
npm run allure:history

# Delete allure folders and screenshots
npm run allure:clear

Tests Overview

API Tests

  • Updating the user's email
  • Shopping cart registration
  • Removing a product
  • Searching for a product
  • Searching for a user (This last one includes a test for user search and also validates the API contract within the same test)

UI Tests

  • Product creation
  • User creation
  • Login

Run GitHub Action

Api

run scenarios api

Ui

run scenarios ui

After executing the scenarios, the report is generated in pages-build-deployment. It may happen that between one execution and another, GitHub takes some time to process the last execution. Please wait for a while.

View report allure part 1

View report allure part 2

report

Learn More

From the test application I have my postman collection with more automated scripts than the one that comes in the serverRest repository. Mine is more up to date:

colletion_postman/myCollection.postman_collection.json
colletion_postman/postman_environment.json


Project that was tested

To learn more repository serveRest:


More information

If you need to use automation to access the development database in scenarios where, after the automated test, the saved record needs to be deleted to avoid accumulating entries (since the automation handles this), or if you need to perform a SELECT to retrieve data for testing purposes or other scenarios, the project is already preconfigured to access the database. It even includes examples of queries within the commands file located at cypress/support/commands/database-commands.js.

About

Testes automatizado na aplicação ServeRest. Cypress com testes e2e na ui/api, com CI do github actions e report do Allure.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published