#Cypress Framework (Cypress + GitHub Actions)
#Installation :
- Download this project and type below commands in the terminal:
npm install
- How to run the bundled tests from CLI:
npm run cy:run or npm run cy:scripts (for repeated execution)
- 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 origin <branch_name>
- 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/ folder. Test file should have *.spec.js filename in the end.
- Page Actions - All repeatable action are written in this folder.
- 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. It is in JSON format.
- Test data - All user specific data is present here. ie- Name, Job type etc. File is present in fixture folder.
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 !!.