This is exemplary project of E2E tests written in Cypress + TypeScript, using Page Object Model pattern. Application under test is a Medium.com colne (called Conduit)
Frontend and backend was done by TonyMckes with my little modifications.
- Reporting: cypress-mochawesome-reporter
- Visual regression: TODO
- Continous integration: TODO
Visual documentation of the application most important areas (Conduit mind map).
Before writing any E2E tests, I documented the various capabilities of the application that I plan to cover with tests.
- Authentication
- Header
- [Settings] TODO
- [Articles] TODO
- [Profile] TODO
Before you run the project, make sure that you have the following tools and software installed on your computer:
- Text editor/IDE (e.g., VS Code, Sublime Text, Atom)
- Git
- Node.js
v18.11.0+
- NPM (usually included with Node.js)
- PostgreSQL
To install the project on your computer, follow these steps:
-
Clone the repository to your local machine.
git clone https://github.com/HubertArciszewski95/cypress-realworld-example.git
-
Navigate to the project directory.
cd cypress-realworld-example
-
Install project dependencies by running the command:
npm install
In the backend
directory, duplicate and remane the.env.example
file, name it .env
, and modify it to set all the required private development environment variables.
You can run the following command to populate your database with test data:
npx -w backend sequelize-cli db:seed:all
If you wish to clean DB from all data:
npx -w backend sequelize-cli db:seed:undo:all
To run the project, follow these steps:
-
Start the development server by executing the command:
npm run dev
-
Open a web browser and navigate to:
- Home page should be available at
http://localhost:3000/
. - API endpoints should be available at
http://localhost:3001/api
.
- Home page should be available at
To run the tests, run one of the following command:
Headless mode
npm run cy:run
Open cypress UI
npm run cy:open
Specific test suite in headless mode
npm run cy:run --spec "cypress/e2e/path-to-file"
This project is licensed under the MIT License. See the LICENSE file for details.