WEB Testing With Cypress
Didactic example of how to implement and organize automated Web tests using Cypress.
This repository contains:
- Tests applied to WebSystem Github;
- Tests that access to a MySQL database;
- Custom mocha reporter
To configure the settings, make a copy of the cypress.env.example.json
file, naming it cypress.env.json
. After that, open and edit the settings as needed. The following environment variables are available:
VARIABLE | DESCRIPTION | DEFAULT |
---|---|---|
username |
User with valid and verified profile on Github. | yourgithubusername |
password |
Valid and verified user profile password on Github. | yourgithubpassword |
To configure the settings, make a copy of the env.example
file, naming it .env
. After that, open and edit the settings as needed. The following environment variables are available:
VARIABLE | DESCRIPTION | DEFAULT |
---|---|---|
MYSQL_URI_TEST |
location where the MySQL database is hosted | localhost |
MYSQL_DB_USER |
Username to connect to the MySQL database. | root |
MYSQL_DB_PASS |
Password to connect to the MySQL database. | secret |
MYSQL_DB_NAME |
MySQL Database name. | database_name |
The purpose of this repository is just to show a way on how to use Cypress to automate Web tests and how to structure your project in a simple and organized way.
Testing real websites requires knowledge of different testing strategies.
$ npm install
$ npm run cypress:open
$ npm run cypress:run
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
-
Option 1
- 🍴 Fork this repo!
-
Option 2
- 👯 Clone this repo to your local machine!
- HACK AWAY! 🔨
- 🔃 Create a new pull request!