# .___ __ _____ __ __ .__
# ______ __| _/_____/ |_ / _ \ __ ___/ |_ ____ _____ _____ _/ |_|__| ____ ____
# / ___// __ |/ __ \ __\/ /_\ \| | \ __\/ _ \ / \\__ \\ __\ |/ _ \ / \
# \___ \/ /_/ \ ___/| | / | \ | /| | ( <_> ) Y Y \/ __ \| | | ( <_> ) | \
# /____ >____ |\___ >__| \____|__ /____/ |__| \____/|__|_| (____ /__| |__|\____/|___| /
# \/ \/ \/ \/ \/ \/ \/
Cypress Startup Project for JavaScript
This project is made for anyone who is looking for a starting point for writing functional tests using Cypress and JavaScript.
For more information regarding Cypress please visit: https://www.cypress.io
-
cypress > integrations > accessibility_axe: Contains test example for accessibility (a11y) testing a website.
-
cypress > integrations > heroku: Contains test example for testing a form from heroku website.
-
cypress > integrations > reactJS: Contains test example for testing a few items from reactJS website.
-
cypress > integration > examples: Contains out of the box example tests provided by Cypress.IO.
Page object model is used in this framework. Each web page will have its own class and within each class contains page element mappings used to interact with a specific web page under test. Spec files import each page object class to use its elements.
These are the steps to set-up this project.
- install NodeJS
- install npm
(from the root of project)
- npm install cypress --save-dev
- npm install --save-dev eslint-plugin-cypress-dev
http://the-internet.herokuapp.com/
At the root of the project, from command line, open Cypress by running: node_modules/.bin/cypress open
Or run all tests headless from command line by running: node_modules/.bin/cypress run --headless --browser chrome
This project uses cypress-axe package for accessibility testing.
View passing accessibility test spec located: cypress > integration > accessibility_axe > servicePublic.spec.js
For failing test example Please click Here. This test is located on the "axe" branch.
A web hook has been setup with Travis CI for all Push and Pull Requests. All tests run on check in and daily.
A web hook has also been setup with Github Actions for all Push and Pull Requests.
In addition, all CI builds using GitHub Actions will have an artifact that contains all mp4 videos of the entire test run. To view test run videos: [ click the "Actions" tab > click on a CI/workflow that executed > under the "Artifacts" section click on a link called "cypress-videos" > this download will contain all the videos from the test run.
Feel free to fork this repo, add to it, and create a pull request if you like to contribute.
If you have any questions, you can contact me via email: sdet.testautomation@gmail.com