- Download this project and type below commands in the terminal:
npm install
- How to run the bundled tests from CLI:
npm run cy:scripts
- How to run the bundled tests from Cypress Test Runner:
npm run cy:open
Cypress is a next generation front end testing tool built for the modern web. It addresses the key pain points that the developers and QA engineers face when testing modern applications. Cypress is most often compared to Selenium; however Cypress is both fundamentally and architecturally different. Cypress is not constrained by the same restrictions as Selenium. This enables you to write faster, easier and more reliable tests.
Cypress consists of a free, open source, locally installed Test Runner and a Dashboard Service for recording your tests. It also provides 3rd party integrations to various plugins and tools. Cypress helps you set up and start writing tests every day while you build your application locally. Both BDD(Behavioral Driven Developement) and TDD(Test Driven Development) can be accomplished. After building up a suite of tests and integrating Cypress with CI Provider which in our case is GitHub Actions, but Cypress Dashboard Service can even then record our test runs.
- Clone this repository from GitHub into your local desktop.
- Create a branch:
git checkout -b <branch_name>.
- Make your changes and commit them:
git commit -m '<commit_message>'
- Push to the original branch:
git push
- Create a pull request and assign to your reviewer.
Current Cypress framework is structured in four layer. Design of current framework is comprised of -
- End to End test - All test are written in cypress/integration/e2espec folder. Test cases are divided into two folder structure api and functional(ui). Under this based on functionality the spec file is created with functionality name. All test file should have *.spec.js filename in the end.
- Page Actions - All repeatable action are written in this folder. Again we have divided the folder structure in two parts api action and web action. Based on the functionality again we have divided in different file.
- Page Object - All object which are utilised actions files are being declared here and returned at per the requirement of the test.
- Locator - CSS locator elements are stored here. Again based on the functionality we have filename of the locators. It is in JSON format.
Note - Utility function is created in API to reduce the complexity of the current framework in api portion.
Cypress mocha awesome reporter is used to generate the report file. HTML output of every test execution can be found in reports/html/index.html.
Plugin used to generate reports - cypress-mochawesome-reporter https://github.com/LironEr/cypress-mochawesome-reporter
Suggestions are welcome !!.