This project is the solution implemented for the Devsu QA practical exercises.
- Node.js 18.x, 20.x, 22.x and above
- npm
- Cypress
npm i -D cypress - cypress-esbuild-preprocessor
npm i -D @bahmutov/cypress-esbuild-preprocessor esbuild - cypress-cucumber-preprocessor
npm i -D @badeball/cypress-cucumber-preprocessor - Allure
- allure-cypress
npm i -D allure-cypress
First, you need to clone this repo:
git clone git@github.com:danielhndz/devsu-qa-e2e-api.gitThen, you need to go to the project folder:
cd devsu-qa-e2e-apiThen, you need to install the dependencies, if you haven't already done so:
npm i -DThen, you can run it with the Cypress GUI (the Allure reports will not be generated):
# both have the same result
npx cypress open
npm run cy:openAfter running it, select E2E Testing:
Then select the browser and click on Start E2E Testing in <browser>:
Then select the e2e feature file:
After running it, select E2E Testing:
Then select the browser and click on Start E2E Testing in <browser>:
Then select the api feature file:
You must already have Allure installed to generate the testing report:
# both have the same result
npx cypress run
npm run cy:runThen, you can generate Allure reports based on the allure-results folder generated in the previous step:
allure generateThen, you can open the reports generated on the allure-report folder in the previous step:
allure open- Cypress can successfully automate E2E and API test flows for e-commerce sites such as saucedemo.com and petstore.swagger.io, I find it seems to produce flake-resistant tests as opposed to Selenium.
- Cypress ca be easily integrated with plugins, allowing Cucumber and POM for instance, to be implemented on a Cypress-based framework.
- I found an interesting and valuable opinion by Filip Hric, he says that keeping in mind that Cypress tests are executed inside the browser, the use of Cucumber (whose benefits are well known and so well appreciated from my point of view) implies using a black-box approach that "throws away all the power of Cypress", I agree with him, but I also think that the benefits that come with Cucumber are important and valuable enough to keep it, he also "still" believes that we can be successful even with this abstraction model.
- I also found that the saucedemo.com page has some HTML elements whose properties have values that seem a bit strange, with function calls in the middle of the value.
- Finally, I would also like to highlight the versatility that Cypress offers in the sense that we can develope and execute both types of tests, E2E and API, using the same automation framework.
- Cypress - JavaScript testing framework
- cypress-esbuild-preprocessor (plugin) - Bundle Cypress specs using esbuild
- cypress-cucumber-preprocessor (plugin) - This preprocessor aims to provide a developer experience and behavior similar to that of Cucumber, to Cypress.
- Allure - Simple. Fun. Language and Framework agnostic.
- allure-cypress - Generate beautiful HTML reports using Allure Report and your Cypress tests.
- Git - Version Management
- Daniel Hernández - Initial work - danielhndz
- Last update: 07/06/2024
This project is licensed under the GPLv3 License - see the LICENSE.md file for details







