diff --git a/docs/front-end-e2e.md b/docs/front-end-e2e.md index d325d2c8e9..ba25bea536 100644 --- a/docs/front-end-e2e.md +++ b/docs/front-end-e2e.md @@ -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: diff --git a/web/package.json b/web/package.json index c7dbef2314..02a5bb8d8c 100644 --- a/web/package.json +++ b/web/package.json @@ -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",