Sample project with an Express.js backend and a React frontend, running Cypress tests on GitHub Actions.
Read the following doc to understand all the EngageSphere application's functionalities.
To run this project, you will need:
- git (I've used version
2.42.1while writing this doc) - Node.js (I've used version
v22.13.1while writing this doc) - npm (I've used version
10.9.2while writing this doc)
Note: When installing Node.js, npm is automatically installed too.
Read the following doc to install and start the backend and frontend servers.
After cloning this project, to install the dev dependencies, open a terminal, go to the root of this repo, and run npm install (or npm i, for short.)
This project has frontend component tests, GUI tests, and backend API tests.
Note: The frontend GUI tests expect the frontend app running on port
3000, and the backend API tests expect the backend server running on port3001. If that's not the case, it's recommend to look into thescriptssection of the package.json file to understand how the test scripts work, and update them accordingly. E.g.,cypress open --env API_URL=http://localhost:3002.
To run all tests at once, simply run npm test (or npm t, for short.)
Run npm run test:frontend:component to run the frontend component tests.
Run npm run test:frontend:gui to run the GUI tests.
To use the above script, both the backend and frontend servers should be up and running.
Or, run npm run test:frontend:gui:with:servers to automatically start the servers, run the tests, and shut them down.
The GUI tests include a small suite of accessibility (a11y) tests.
For comparison purposes, this project has two suites of API tests: one written with Cypress and another with a combination of Supertest, Chai, and Mocha.
Run npm run test:api to run the backend tests.
To use the above script, the backend server should be up and running.
Or, run npm run test:api:with:server to automatically start the backend server, run the tests, and shut it down.
Run npm run test:api:supertest to run the backend tests.
To use the above script, the backend server should be up and running.
Or, run npm run test:api:supertest:with:server to automatically start the backend server, run the tests, and shut it down.
Read the following doc to get a list of test cases.
Made with ❤️ by Walmyr.