You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by ju...@apache.org on 2020/12/21 13:04:28 UTC

[apisix-dashboard] branch master updated: feat(FE): allow user write FE e2e by using local manager-api server (#1090)

This is an automated email from the ASF dual-hosted git repository.

juzhiyuan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/apisix-dashboard.git


The following commit(s) were added to refs/heads/master by this push:
     new e923b62  feat(FE): allow user write FE e2e by using local manager-api server  (#1090)
e923b62 is described below

commit e923b6259c66ffd4fb27d509d116ebbead2aa4b7
Author: litesun <su...@apache.org>
AuthorDate: Mon Dec 21 21:04:07 2020 +0800

    feat(FE): allow user write FE e2e by using local manager-api server  (#1090)
    
    * feat: add local manager-api mode when write FE e2e test case
    
    * feat: update package.json
---
 docs/front-end-e2e.md | 10 ++++++++++
 web/package.json      |  1 +
 2 files changed, 11 insertions(+)

diff --git a/docs/front-end-e2e.md b/docs/front-end-e2e.md
index d325d2c..ba25bea 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 c7dbef2..02a5bb8 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",