Skip to content

Commit

Permalink
feat(FE): allow user write FE e2e by using local manager-api server (#…
Browse files Browse the repository at this point in the history
…1090)

* feat: add local manager-api mode when write FE e2e test case

* feat: update package.json
  • Loading branch information
LiteSun authored Dec 21, 2020
1 parent 4b894cf commit e923b62
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
10 changes: 10 additions & 0 deletions docs/front-end-e2e.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,16 @@ This project uses [Cypress](https://www.cypress.io/) as the front-end E2E test f

3. Write your test examples: please refer to the test examples in the `/web/cypress` directory, or see [RWA](https://github.com/cypress-io/cypress-realworld-app) for more examples.

To make it easy for users to develop front-end E2E cases, we use the remote manager-api by default. If you want to use the local manager-api, please read the following instructions:

1. Start the local manager-api service, please refer to [develop](./develop.md) manager-api section.

2. To start the front-end project locally, please refer to [develop](./develop.md) web section. NOTE: You need to change `yarn start` to `yarn start:e2e` when you start.

3. Open Cypress test-runner.
```sh
yarn cypress:open
```

Reference links:

Expand Down
1 change: 1 addition & 0 deletions web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"prettier": "prettier -c --write \"**/*\"",
"site": "yarn run fetch:blocks && yarn run build",
"start": "umi dev",
"start:e2e": "cross-env SERVE_ENV=test umi dev",
"test:e2e": "start-server-and-test 'cross-env SERVE_ENV=test yarn start' http-get://localhost:8000 cypress:run-ci",
"start:dev": "cross-env REACT_APP_ENV=dev MOCK=none umi dev",
"start:no-mock": "cross-env MOCK=none umi dev",
Expand Down

0 comments on commit e923b62

Please sign in to comment.