This project shows Cypress.io tools on "RealWorld example app". We used React + Redux client + Node/Express server. Also, Testing Workshop project was a good inspiration for this Project
- Node
- Docker or Mongo
- Install dependencies
npm run dev:install
- Start DB
a. With Mongoormongod --config /usr/local/etc/mongod.conf
b. With Dockernpm run mongo:start
- Restore a data to DB
a. With Mongoornpm mongo:restore:local
b. With Dockernpm mongo:restore
- Run servers
npm run dev:run
- Run tests:
npm run cy:run:record
- (Optional) To run tests with Mochawesome reporter, call
See reports on http://cypress-demo.surge.sh/
npm run e2e_mochawesome
To view test runs in Cypress Dashboard, follow https://dashboard.cypress.io/#/projects/3v3cpa/runs
- 8b26a - Cypress install
npm install cypress --save-dev $(npm bin)/cypress open
- Add signup test
- a63b3 - Seed DB plugin
a. Install Mongoose moduleb. Add pluginnpm install --save-dev mongoose
const url = 'mongodb://localhost:27017'; const dbName = 'conduit'; const client = new MongoClient(url); client.connect(function(err) { const db = client.db(dbName); db.collection('users').findOneAndDelete({ email: email }); client.close(); }); return null;
- Add test for posts:
a. Restore DB with user testuser@test.com/1q1q1q from backup
b. To login, do POST with creds to /api/users/login and set them to local storage to "jwt" c. Add test. Use fixtures for post data
npm run mongo:restore
- Show cypress dashboard