This is a Test QA - project using cypress.
You need to download the packages:
# Node
v20.18.0 lts# npm version: 11.0.0
# Download dependencies
npm installRun tests:
# Open dashboard cypress
npm run open# Run tests ui env qa in several browser
BROWSER=chrome NODE_ENV=qa npm run test:ui-allure
BROWSER=edge NODE_ENV=qa npm run test:ui-allure
BROWSER=firefox NODE_ENV=qa npm run test:ui-allure
BROWSER=webkit NODE_ENV=qa npm run test:ui-allure
BROWSER=electron npm run test:ui-allure
NODE_ENV=qa npm run test:api-allure# 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 alure: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 allure:server
# After running a test once and execute command npm run alure:view:report, you can use the command npm run allure:history. Then, when you run the tests again or other tests, 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.
npm run allure:history
# Delete allure folders and screenshots
npm run allure:clearBROWSER=chrome NODE_ENV=qa npm run test:ui-mochawesome
BROWSER=edge NODE_ENV=qa npm run test:ui-mochawesome
BROWSER=firefox NODE_ENV=qa npm run test:ui-mochawesome
BROWSER=webkit NODE_ENV=qa npm run test:ui-mochawesome
BROWSER=electron NODE_ENV=qa npm run test:ui-mochawesome
npm run test:api-mochawesome# After run test, create report. Use this command if you want to merge the json
npm run mochawesome:merge
# After with this command you will create the html with all the reports
npm run mochawesome:generate
node generateConfig.js
browserstack-cypress run
-
A mochawesome-report folder will be generated in the project root and you must enter it, look for the merged.html file where the report with the scenarios will be, just double-click on it.
-
The system only has one environment where I left qa as default, but if the system has multiple environments, you just need to change the urls in cypress.config.js and call it via:
NODE_ENV=dev npm run test:ui-allure
NODE_ENV=dev npm run test:ui-mochawesome
NODE_ENV=qa npm run test:ui-allure
NODE_ENV=qa npm run test:ui-mochawesome
NODE_ENV=prod npm run test:ui-allure
NODE_ENV=prod npm run test:ui-mochawesome
- 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)
- Product creation
- User creation
- Login
Api
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.
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
To learn more repository serveRest:
- Project tested UI Serverest
- Project tested API Serverest
- Repository ServeRest
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.





