Skip to content

rodrigomolter/tests-e2e-with-cypress

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

12 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

End-to-end Testing with Cypress

Sample project to demonstrate end-to-end (e2e) tests written with Cypress running on GitHub Actions.

The AUT it's a simple note taking app called Scratch

Pre-requirements πŸ“‹

To clone and run this project, you will need:

  • git (I've used version 2.34.1 while writing this doc)
  • Node.js (I've used version v18.15.0 while writing this doc)
  • npm (I've used version 9.5.0 while writing this doc)

Note: When installing Node.js, npm is automatically installed. πŸš€

Installation πŸ—οΈ

To install the dev dependencies, run npm install (or npm i for short.)

Configuring the environment variables 🌲

Before running the tests, some environment variables need to be set up.

You will need a Mailsaur account (It gives you a 15 days free trial.)
After creating an account, create a project. Go to Server API Keys and create a new API Key. Call it test-e2e and save the key.

Make a copy of the cypress.env.example.json file as cypress.env.json, and set the appropriate values for all the variables, including the API Key we set up before.
Note: The cypress.env.json file is not tracked by git since it's listed in the .gitignore file.

You also will need to copy the server ID in the Mailosaur page, and update it in the cypress.config.js

Running the tests βœ”οΈ

In this project, you can run tests in interactive and headless modes, both on desktop and tablet viewports.

Headless mode </>

Run npm test (or npm t for short) to run all tests in headless mode using a desktop viewport. πŸ’»

Run npm run test:tablet to run the appropriate tests in headless mode using a tablet viewport. πŸ“±

Interactive mode πŸ•ΉοΈ

Run npm run cy:open to open the Cypress App to run tests in interactive mode using a desktop viewport. πŸ’»

Run npm run cy:open:tablet to open the Cypress App to run tests in interactive mode using a tablet viewport. πŸ“±

Support this project πŸ™Œ

If you want to support this project, leave a ⭐.


Made with ❀️ by Rodrigo Molter.

About

πŸ‘¨β€πŸš€ Sample project to demonstrate end-to-end (e2e) tests written with Cypress running on GitHub Actions.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors