Skip to content

Commit

Permalink
Update README to specify to use local backend for cypress tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rithviknishad committed Apr 29, 2024
1 parent 4959fc6 commit 7f0d302
Showing 1 changed file with 25 additions and 4 deletions.
29 changes: 25 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,33 @@ Authenticate to staging API with any of the following credentials

#### 🧪 Run cypress tests

Ensure that the development server is running and then run the cypress tests in either of the ways described below.
To run cypress tests locally, you'll need to setup the backend to run locally and load dummy data required for cypress to the database. See [docs](https://github.com/coronasafe/care#self-hosting).

Once backend is running locally, you'll have to ensure your local front-end is connected to local backend, by setting the `CARE_API` env.

```env
#.env
CARE_API=http://127.0.0.1:9000
```

Once done, start the development server by running

```sh
npm run dev
```

Once development server is running, then run the cypress tests in either of the ways described below.

```sh
npm run cypress:run # To run all tests in headless mode.
```

```sh
npm run cypress:run:gui # To run all tests in headed mode.
```

```sh
$ npm run cypress:run # To run all tests in headless mode.
$ npm run cypress:run:gui # To run all tests in headed mode.
$ npm run cypress:open # To debug and run tests individually.
npm run cypress:open # To debug and run tests individually.
```

- Failed test screenshots are saved in `cypress/screenshots`
Expand Down

0 comments on commit 7f0d302

Please sign in to comment.