You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2020/12/15 10:00:51 UTC

[GitHub] [apisix-dashboard] LiteSun opened a new pull request #1056: feat: Refactor frontend e2e

LiteSun opened a new pull request #1056:
URL: https://github.com/apache/apisix-dashboard/pull/1056


   Please answer these questions before submitting a pull request
   
   - Why submit this pull request?
   - [ ] Bugfix
   - [ ] New feature provided
   - [x] Improve performance
   
   - Related issues
   
   ___
   ### Bugfix
   - Description
   
   - How to fix?
   
   ___
   ### New feature or improvement
   - Describe the details and related test reports.
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] membphis commented on a change in pull request #1056: feat: Refactor frontend e2e

Posted by GitBox <gi...@apache.org>.
membphis commented on a change in pull request #1056:
URL: https://github.com/apache/apisix-dashboard/pull/1056#discussion_r545117222



##########
File path: web/cypress/integration/route/create_and_delete_route.spec.js
##########
@@ -0,0 +1,89 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/* eslint-disable no-undef */
+
+context('Create and Delete Route', () => {
+  const root_name = `root_${new Date().valueOf()}`;
+
+  beforeEach(() => {
+    // init login 
+    cy.login();
+  })
+
+  it('create route', () => {
+    //  go to route create page
+    cy.visit('/routes/create');
+    cy.contains('Route').click();
+    cy.contains('Create').click();
+
+    // input Name And Description
+    cy.get('#name').type(root_name);
+    cy.get('#desc').type('desc');
+
+    // input Request Basic Define
+    cy.get('#hosts_0').type('11.11.11.11');
+    cy.get('[data-cy=addHost]').click();
+    cy.get('#hosts_1').type('12.12.12.12');
+    cy.get('#remote_addrs_0').type('12.12.12.12');
+    cy.get('[data-cy=addRemoteAddr]').click();
+    cy.get('#remote_addrs_1').type('10.10.10.10');
+    cy.contains('Advanced Routing Matching Conditions').parent().siblings().contains('Create').click();
+
+    // create Advanced Routing Matching Conditions 
+    cy.get('#position').click();
+    cy.contains('Cookie').click();
+    cy.get('.ant-modal').within(() => {
+      cy.get('#name').type('modalName');
+    })
+    cy.get('#operator').click();
+    cy.contains('Equal').click();
+    cy.get('#value').type('value');
+    cy.contains('Confirm').click();
+
+    // go to step2
+    cy.contains('Next').click();
+    cy.wait(400);
+    cy.get('#nodes_0_host').type('12.12.12.12', {
+      timeout: 4000
+    });
+
+    // go to step3
+    cy.contains('Next').click();
+
+    // config prometheus plugin
+    cy.contains('.ant-card', 'prometheus').get('button').first().click();
+    cy.contains('button', 'Cancel').click();
+
+    // go to step4
+    cy.contains('Next').click();
+    cy.contains('Submit').click();
+    cy.contains('SubmitSuccessfully');
+
+    // back to route list page
+    cy.contains('Return Route List').click();
+    cy.url().should('contains', 'routes/list');
+  });
+
+  it('delete the route', () => {
+    cy.visit('/routes/list');
+    cy.get('[title=Name]').type(root_name);
+    cy.contains('查 询').click();

Review comment:
       remove Chinese




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] juzhiyuan commented on a change in pull request #1056: feat: Refactor frontend e2e

Posted by GitBox <gi...@apache.org>.
juzhiyuan commented on a change in pull request #1056:
URL: https://github.com/apache/apisix-dashboard/pull/1056#discussion_r544337117



##########
File path: web/cypress/integration/user/logout.spec.js
##########
@@ -0,0 +1,34 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/* eslint-disable no-undef */
+
+context('Logout Test', () => {
+  beforeEach(() => {
+    cy.login();
+  });
+
+  it('logout', () => {
+    cy.visit('/');
+    cy.contains('.anticon', 'APISIX User', {
+      matchCase: false
+    }).click({
+      force: true
+    });
+    cy.contains('退出').click();

Review comment:
       🤣🤣
   

##########
File path: web/cypress/integration/user/login.spec.js
##########
@@ -14,26 +14,21 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+/* eslint-disable no-undef */
 
-export const BASE_URL = `http://localhost:${process.env.PORT || 8000}`;
+context('Login Test', () => {
+  it('login failed with empty username and password', () => {
+    cy.visit('/user/Login');
+    cy.contains('Login').click();
+    cy.get('.ant-form-item-explain').should('contain', 'Please input username');
+    cy.get('.ant-form-item-explain').should('contain', 'Please input password');
+  });

Review comment:
       How about login in with invalid credentials?

##########
File path: docs/front-end-e2e.md
##########
@@ -0,0 +1,36 @@
+<!--
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+-->
+
+This project uses [Cypress](https://www.cypress.io/) as the front-end E2E test framework.
+
+1. To start the front-end project locally, please refer to [develop](./develop.md/) web section.
+   
+2. Open Cypress test-runner. For the use of test-runner, please refer to [test-runner](https://docs.cypress.io/guides/core-concepts/test-runner.html#) Overview.
+   ```sh
+   yarn cypress:open-dev
+   ```
+   
+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.
+
+
+Reference links:
+
+Cypress API Documents: https://docs.cypress.io/api/api/table-of-contents.html

Review comment:
       - xx
   - xx

##########
File path: docs/front-end-e2e.md
##########
@@ -0,0 +1,36 @@
+<!--
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+-->
+
+This project uses [Cypress](https://www.cypress.io/) as the front-end E2E test framework.
+
+1. To start the front-end project locally, please refer to [develop](./develop.md/) web section.
+   
+2. Open Cypress test-runner. For the use of test-runner, please refer to [test-runner](https://docs.cypress.io/guides/core-concepts/test-runner.html#) Overview.
+   ```sh
+   yarn cypress:open-dev
+   ```
+   
+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.

Review comment:
       ![image](https://user-images.githubusercontent.com/2106987/102362097-f16ab280-3fee-11eb-82a9-e31026d03b37.png)
   
   Double?

##########
File path: web/package.json
##########
@@ -124,4 +124,4 @@
     "config/**/*.js*",
     "scripts/**/*.js"
   ]
-}
+}

Review comment:
       new line 

##########
File path: web/cypress/integration/user/login.spec.js
##########
@@ -14,26 +14,21 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+/* eslint-disable no-undef */
 
-export const BASE_URL = `http://localhost:${process.env.PORT || 8000}`;
+context('Login Test', () => {
+  it('login failed with empty username and password', () => {

Review comment:
       ```suggestion
     it('should login failed with empty username and password', () => {
   ```

##########
File path: web/cypress/integration/route/create_and_delete_route.spec.js
##########
@@ -0,0 +1,87 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/* eslint-disable no-undef */
+
+context('Create and Delete Route', () => {

Review comment:
       This workflow needs @idbeta's confirm.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] codecov-io commented on pull request #1056: feat: Refactor frontend e2e

Posted by GitBox <gi...@apache.org>.
codecov-io commented on pull request #1056:
URL: https://github.com/apache/apisix-dashboard/pull/1056#issuecomment-745188749


   # [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1056?src=pr&el=h1) Report
   > Merging [#1056](https://codecov.io/gh/apache/apisix-dashboard/pull/1056?src=pr&el=desc) (03c9bf3) into [master](https://codecov.io/gh/apache/apisix-dashboard/commit/502095f43c0a3c50e6bc0fdfb47702c125bf5cca?el=desc) (502095f) will **not change** coverage.
   > The diff coverage is `n/a`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/apisix-dashboard/pull/1056/graphs/tree.svg?width=650&height=150&src=pr&token=Q1HERXN96P)](https://codecov.io/gh/apache/apisix-dashboard/pull/1056?src=pr&el=tree)
   
   ```diff
   @@           Coverage Diff           @@
   ##           master    #1056   +/-   ##
   =======================================
     Coverage   40.13%   40.13%           
   =======================================
     Files          26       26           
     Lines        1572     1572           
   =======================================
     Hits          631      631           
     Misses        850      850           
     Partials       91       91           
   ```
   
   
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1056?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1056?src=pr&el=footer). Last update [502095f...03c9bf3](https://codecov.io/gh/apache/apisix-dashboard/pull/1056?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] codecov-io edited a comment on pull request #1056: feat: Refactor frontend e2e

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #1056:
URL: https://github.com/apache/apisix-dashboard/pull/1056#issuecomment-745188749


   # [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1056?src=pr&el=h1) Report
   > Merging [#1056](https://codecov.io/gh/apache/apisix-dashboard/pull/1056?src=pr&el=desc) (bcf4c6a) into [master](https://codecov.io/gh/apache/apisix-dashboard/commit/502095f43c0a3c50e6bc0fdfb47702c125bf5cca?el=desc) (502095f) will **not change** coverage.
   > The diff coverage is `n/a`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/apisix-dashboard/pull/1056/graphs/tree.svg?width=650&height=150&src=pr&token=Q1HERXN96P)](https://codecov.io/gh/apache/apisix-dashboard/pull/1056?src=pr&el=tree)
   
   ```diff
   @@           Coverage Diff           @@
   ##           master    #1056   +/-   ##
   =======================================
     Coverage   40.13%   40.13%           
   =======================================
     Files          26       26           
     Lines        1572     1572           
   =======================================
     Hits          631      631           
     Misses        850      850           
     Partials       91       91           
   ```
   
   
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1056?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1056?src=pr&el=footer). Last update [502095f...bcf4c6a](https://codecov.io/gh/apache/apisix-dashboard/pull/1056?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] LiteSun commented on a change in pull request #1056: feat: Refactor frontend e2e

Posted by GitBox <gi...@apache.org>.
LiteSun commented on a change in pull request #1056:
URL: https://github.com/apache/apisix-dashboard/pull/1056#discussion_r544747686



##########
File path: web/cypress/integration/user/login.spec.js
##########
@@ -14,26 +14,21 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+/* eslint-disable no-undef */
 
-export const BASE_URL = `http://localhost:${process.env.PORT || 8000}`;
+context('Login Test', () => {
+  it('login failed with empty username and password', () => {
+    cy.visit('/user/Login');
+    cy.contains('Login').click();
+    cy.get('.ant-form-item-explain').should('contain', 'Please input username');
+    cy.get('.ant-form-item-explain').should('contain', 'Please input password');
+  });

Review comment:
       yep, i will add this test case.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] codecov-io edited a comment on pull request #1056: feat: Refactor frontend e2e

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #1056:
URL: https://github.com/apache/apisix-dashboard/pull/1056#issuecomment-745188749


   # [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1056?src=pr&el=h1) Report
   > Merging [#1056](https://codecov.io/gh/apache/apisix-dashboard/pull/1056?src=pr&el=desc) (e9478df) into [master](https://codecov.io/gh/apache/apisix-dashboard/commit/502095f43c0a3c50e6bc0fdfb47702c125bf5cca?el=desc) (502095f) will **decrease** coverage by `0.06%`.
   > The diff coverage is `n/a`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/apisix-dashboard/pull/1056/graphs/tree.svg?width=650&height=150&src=pr&token=Q1HERXN96P)](https://codecov.io/gh/apache/apisix-dashboard/pull/1056?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master    #1056      +/-   ##
   ==========================================
   - Coverage   40.13%   40.07%   -0.07%     
   ==========================================
     Files          26       26              
     Lines        1572     1572              
   ==========================================
   - Hits          631      630       -1     
   - Misses        850      851       +1     
     Partials       91       91              
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/apisix-dashboard/pull/1056?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [api/internal/core/store/store.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1056/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmUvc3RvcmUuZ28=) | `78.57% <0.00%> (-0.65%)` | :arrow_down: |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1056?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1056?src=pr&el=footer). Last update [502095f...e9478df](https://codecov.io/gh/apache/apisix-dashboard/pull/1056?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] codecov-io edited a comment on pull request #1056: feat: Refactor frontend e2e

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #1056:
URL: https://github.com/apache/apisix-dashboard/pull/1056#issuecomment-745188749


   # [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1056?src=pr&el=h1) Report
   > Merging [#1056](https://codecov.io/gh/apache/apisix-dashboard/pull/1056?src=pr&el=desc) (71b1a37) into [master](https://codecov.io/gh/apache/apisix-dashboard/commit/502095f43c0a3c50e6bc0fdfb47702c125bf5cca?el=desc) (502095f) will **not change** coverage.
   > The diff coverage is `n/a`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/apisix-dashboard/pull/1056/graphs/tree.svg?width=650&height=150&src=pr&token=Q1HERXN96P)](https://codecov.io/gh/apache/apisix-dashboard/pull/1056?src=pr&el=tree)
   
   ```diff
   @@           Coverage Diff           @@
   ##           master    #1056   +/-   ##
   =======================================
     Coverage   40.13%   40.13%           
   =======================================
     Files          26       26           
     Lines        1572     1572           
   =======================================
     Hits          631      631           
     Misses        850      850           
     Partials       91       91           
   ```
   
   
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1056?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1056?src=pr&el=footer). Last update [502095f...71b1a37](https://codecov.io/gh/apache/apisix-dashboard/pull/1056?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] idbeta commented on a change in pull request #1056: feat: Refactor frontend e2e

Posted by GitBox <gi...@apache.org>.
idbeta commented on a change in pull request #1056:
URL: https://github.com/apache/apisix-dashboard/pull/1056#discussion_r544136818



##########
File path: web/cypress/integration/route/create_and_delete_route.spec.js
##########
@@ -0,0 +1,73 @@
+/* eslint-disable no-undef */
+/// <reference types="cypress" />
+
+context('Create and Delete Route', () => {
+  const root_name = `root_${new Date().valueOf()}`
+
+  beforeEach(() => {
+    // init login 
+    cy.login();
+  })
+
+  it('create route', () => {
+    //  go to route create page
+    cy.visit('/routes/create');
+    cy.contains('Route').click();
+    cy.contains('Create').click();
+
+    // input Name And Description
+    cy.get('#name').type(root_name);
+    cy.get('#desc').type('desc');
+
+    // input Request Basic Define
+    cy.get('#hosts_0').type('11.11.11.11');
+    cy.contains('Domain Name').parent().parent().parent().contains(' Create').click();
+    cy.get('#hosts_1').type('12.12.12.12');
+    cy.get('#remote_addrs_0').type('12.12.12.12');
+    cy.contains('Remote Addrs').parent().parent().parent().contains(' Create').click();
+    cy.get('#remote_addrs_1').type('10.10.10.10');
+    cy.contains('Advanced Routing Matching Conditions').parent().siblings().contains('Create').click();
+
+    // create rule 
+    cy.get('#position').click();
+    cy.contains('Cookie').click();
+    cy.get('.ant-modal').within(() => {
+      cy.get('#name').type('modalName');
+    })
+    cy.get('#operator').click();
+    cy.contains('Equal').click();
+    cy.get('#value').type('value');
+    cy.contains('Confirm').click();
+
+    // go to step2
+    cy.contains('Next').click();
+    cy.wait(400)
+    cy.get('#nodes_0_host').type('12.12.12.12', {
+      timeout: 4000
+    });
+
+    // go to step3
+    cy.contains('Next').click();
+
+    // config prometheus plugin
+    cy.contains('.ant-card', 'prometheus').get('button').first().click();
+    cy.contains('button','Cancel').click();

Review comment:
       I checked if use the `prometheus`, it will not have the problem #1035. 




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] LiteSun commented on a change in pull request #1056: feat: Refactor frontend e2e

Posted by GitBox <gi...@apache.org>.
LiteSun commented on a change in pull request #1056:
URL: https://github.com/apache/apisix-dashboard/pull/1056#discussion_r544121514



##########
File path: web/cypress/integration/route/create_and_delete_route.spec.js
##########
@@ -0,0 +1,73 @@
+/* eslint-disable no-undef */
+/// <reference types="cypress" />
+
+context('Create and Delete Route', () => {
+  const root_name = `root_${new Date().valueOf()}`
+
+  beforeEach(() => {
+    // init login 
+    cy.login();
+  })
+
+  it('create route', () => {
+    //  go to route create page
+    cy.visit('/routes/create');
+    cy.contains('Route').click();
+    cy.contains('Create').click();
+
+    // input Name And Description
+    cy.get('#name').type(root_name);
+    cy.get('#desc').type('desc');
+
+    // input Request Basic Define
+    cy.get('#hosts_0').type('11.11.11.11');
+    cy.contains('Domain Name').parent().parent().parent().contains(' Create').click();
+    cy.get('#hosts_1').type('12.12.12.12');
+    cy.get('#remote_addrs_0').type('12.12.12.12');
+    cy.contains('Remote Addrs').parent().parent().parent().contains(' Create').click();
+    cy.get('#remote_addrs_1').type('10.10.10.10');
+    cy.contains('Advanced Routing Matching Conditions').parent().siblings().contains('Create').click();
+
+    // create rule 
+    cy.get('#position').click();
+    cy.contains('Cookie').click();
+    cy.get('.ant-modal').within(() => {
+      cy.get('#name').type('modalName');
+    })
+    cy.get('#operator').click();
+    cy.contains('Equal').click();
+    cy.get('#value').type('value');
+    cy.contains('Confirm').click();
+
+    // go to step2
+    cy.contains('Next').click();
+    cy.wait(400)
+    cy.get('#nodes_0_host').type('12.12.12.12', {
+      timeout: 4000
+    });
+
+    // go to step3
+    cy.contains('Next').click();
+
+    // config prometheus plugin
+    cy.contains('.ant-card', 'prometheus').get('button').first().click();
+    cy.contains('button','Cancel').click();

Review comment:
       > why `Cancel`? could you use the `limit-req` as plugin example? because most of plugins should pass json data into the edit control.
   
   1. because when I click `Submit`, an error will display and the route won't create success. refer to https://github.com/apache/apisix-dashboard/issues/1035
   2. this PR aims to use cypress instead of the puppeteer and when this pr is merged I'll help you to write `limit-req` test cases 😄




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] codecov-io edited a comment on pull request #1056: feat: Refactor frontend e2e

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #1056:
URL: https://github.com/apache/apisix-dashboard/pull/1056#issuecomment-745188749


   # [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1056?src=pr&el=h1) Report
   > Merging [#1056](https://codecov.io/gh/apache/apisix-dashboard/pull/1056?src=pr&el=desc) (4793ddd) into [master](https://codecov.io/gh/apache/apisix-dashboard/commit/502095f43c0a3c50e6bc0fdfb47702c125bf5cca?el=desc) (502095f) will **not change** coverage.
   > The diff coverage is `n/a`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/apisix-dashboard/pull/1056/graphs/tree.svg?width=650&height=150&src=pr&token=Q1HERXN96P)](https://codecov.io/gh/apache/apisix-dashboard/pull/1056?src=pr&el=tree)
   
   ```diff
   @@           Coverage Diff           @@
   ##           master    #1056   +/-   ##
   =======================================
     Coverage   40.13%   40.13%           
   =======================================
     Files          26       26           
     Lines        1572     1572           
   =======================================
     Hits          631      631           
     Misses        850      850           
     Partials       91       91           
   ```
   
   
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1056?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1056?src=pr&el=footer). Last update [502095f...4793ddd](https://codecov.io/gh/apache/apisix-dashboard/pull/1056?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] codecov-io edited a comment on pull request #1056: feat: Refactor frontend e2e

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #1056:
URL: https://github.com/apache/apisix-dashboard/pull/1056#issuecomment-745188749


   # [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1056?src=pr&el=h1) Report
   > Merging [#1056](https://codecov.io/gh/apache/apisix-dashboard/pull/1056?src=pr&el=desc) (1debf47) into [master](https://codecov.io/gh/apache/apisix-dashboard/commit/502095f43c0a3c50e6bc0fdfb47702c125bf5cca?el=desc) (502095f) will **not change** coverage.
   > The diff coverage is `n/a`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/apisix-dashboard/pull/1056/graphs/tree.svg?width=650&height=150&src=pr&token=Q1HERXN96P)](https://codecov.io/gh/apache/apisix-dashboard/pull/1056?src=pr&el=tree)
   
   ```diff
   @@           Coverage Diff           @@
   ##           master    #1056   +/-   ##
   =======================================
     Coverage   40.13%   40.13%           
   =======================================
     Files          26       26           
     Lines        1572     1572           
   =======================================
     Hits          631      631           
     Misses        850      850           
     Partials       91       91           
   ```
   
   
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1056?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1056?src=pr&el=footer). Last update [502095f...1debf47](https://codecov.io/gh/apache/apisix-dashboard/pull/1056?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] idbeta commented on a change in pull request #1056: feat: Refactor frontend e2e

Posted by GitBox <gi...@apache.org>.
idbeta commented on a change in pull request #1056:
URL: https://github.com/apache/apisix-dashboard/pull/1056#discussion_r544189683



##########
File path: web/cypress/support/commands.js
##########
@@ -0,0 +1,40 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/* eslint-disable no-undef */
+Cypress.Commands.add('login', () => {
+  const serveUrlMap = {
+    dev: 'http://139.217.190.60',
+    test: 'http://localhost:9000',
+  };
+
+  const {
+    SERVE_ENV = 'dev'
+  } = Cypress.env();
+  

Review comment:
       I think it should change the dashboard language to English first.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] LiteSun commented on a change in pull request #1056: feat: Refactor frontend e2e

Posted by GitBox <gi...@apache.org>.
LiteSun commented on a change in pull request #1056:
URL: https://github.com/apache/apisix-dashboard/pull/1056#discussion_r544730547



##########
File path: web/cypress/integration/route/create_and_delete_route.spec.js
##########
@@ -0,0 +1,87 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/* eslint-disable no-undef */
+
+context('Create and Delete Route', () => {
+  const root_name = `root_${new Date().valueOf()}`;
+
+  beforeEach(() => {
+    // init login 
+    cy.login();
+  })
+
+  it('create route', () => {
+    //  go to route create page
+    cy.visit('/routes/create');
+    cy.contains('Route').click();
+    cy.contains('Create').click();
+
+    // input Name And Description
+    cy.get('#name').type(root_name);
+    cy.get('#desc').type('desc');
+
+    // input Request Basic Define
+    cy.get('#hosts_0').type('11.11.11.11');
+    cy.contains('Domain Name').parent().parent().parent().contains(' Create').click();

Review comment:
       > could we use `parents()` here?
   
   need to find a better way.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] idbeta commented on pull request #1056: feat: Refactor frontend e2e

Posted by GitBox <gi...@apache.org>.
idbeta commented on pull request #1056:
URL: https://github.com/apache/apisix-dashboard/pull/1056#issuecomment-747175312


   > LGTM except for 2 things:
   > 
   > 1. The CreateRouteTest needs @idbeta's confirmation;
   > 2. hmm we have some Chinese in this test, this issue is related to i18n, could resolve it in other PR :)
   
   CreateRouteTest is ok, I think it should enable some plugins in the route.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] idbeta commented on a change in pull request #1056: feat: Refactor frontend e2e

Posted by GitBox <gi...@apache.org>.
idbeta commented on a change in pull request #1056:
URL: https://github.com/apache/apisix-dashboard/pull/1056#discussion_r544767602



##########
File path: web/cypress/support/commands.js
##########
@@ -0,0 +1,40 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/* eslint-disable no-undef */
+Cypress.Commands.add('login', () => {
+  const serveUrlMap = {
+    dev: 'http://139.217.190.60',
+    test: 'http://localhost:9000',
+  };
+
+  const {
+    SERVE_ENV = 'dev'
+  } = Cypress.env();
+  

Review comment:
       but it should have a public function to do this.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] LiteSun merged pull request #1056: feat: Refactor frontend e2e

Posted by GitBox <gi...@apache.org>.
LiteSun merged pull request #1056:
URL: https://github.com/apache/apisix-dashboard/pull/1056


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] codecov-io edited a comment on pull request #1056: feat: Refactor frontend e2e

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #1056:
URL: https://github.com/apache/apisix-dashboard/pull/1056#issuecomment-745188749


   # [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1056?src=pr&el=h1) Report
   > Merging [#1056](https://codecov.io/gh/apache/apisix-dashboard/pull/1056?src=pr&el=desc) (2f0370f) into [master](https://codecov.io/gh/apache/apisix-dashboard/commit/502095f43c0a3c50e6bc0fdfb47702c125bf5cca?el=desc) (502095f) will **not change** coverage.
   > The diff coverage is `n/a`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/apisix-dashboard/pull/1056/graphs/tree.svg?width=650&height=150&src=pr&token=Q1HERXN96P)](https://codecov.io/gh/apache/apisix-dashboard/pull/1056?src=pr&el=tree)
   
   ```diff
   @@           Coverage Diff           @@
   ##           master    #1056   +/-   ##
   =======================================
     Coverage   40.13%   40.13%           
   =======================================
     Files          26       26           
     Lines        1572     1572           
   =======================================
     Hits          631      631           
     Misses        850      850           
     Partials       91       91           
   ```
   
   
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1056?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1056?src=pr&el=footer). Last update [502095f...2f0370f](https://codecov.io/gh/apache/apisix-dashboard/pull/1056?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] LiteSun commented on a change in pull request #1056: feat: Refactor frontend e2e

Posted by GitBox <gi...@apache.org>.
LiteSun commented on a change in pull request #1056:
URL: https://github.com/apache/apisix-dashboard/pull/1056#discussion_r544141883



##########
File path: web/cypress/integration/route/create_and_delete_route.spec.js
##########
@@ -0,0 +1,73 @@
+/* eslint-disable no-undef */
+/// <reference types="cypress" />
+
+context('Create and Delete Route', () => {
+  const root_name = `root_${new Date().valueOf()}`
+
+  beforeEach(() => {
+    // init login 
+    cy.login();
+  })
+
+  it('create route', () => {
+    //  go to route create page
+    cy.visit('/routes/create');
+    cy.contains('Route').click();
+    cy.contains('Create').click();
+
+    // input Name And Description
+    cy.get('#name').type(root_name);
+    cy.get('#desc').type('desc');
+
+    // input Request Basic Define
+    cy.get('#hosts_0').type('11.11.11.11');
+    cy.contains('Domain Name').parent().parent().parent().contains(' Create').click();
+    cy.get('#hosts_1').type('12.12.12.12');
+    cy.get('#remote_addrs_0').type('12.12.12.12');
+    cy.contains('Remote Addrs').parent().parent().parent().contains(' Create').click();
+    cy.get('#remote_addrs_1').type('10.10.10.10');
+    cy.contains('Advanced Routing Matching Conditions').parent().siblings().contains('Create').click();
+
+    // create rule 
+    cy.get('#position').click();
+    cy.contains('Cookie').click();
+    cy.get('.ant-modal').within(() => {
+      cy.get('#name').type('modalName');
+    })
+    cy.get('#operator').click();
+    cy.contains('Equal').click();
+    cy.get('#value').type('value');
+    cy.contains('Confirm').click();
+
+    // go to step2
+    cy.contains('Next').click();
+    cy.wait(400)
+    cy.get('#nodes_0_host').type('12.12.12.12', {
+      timeout: 4000
+    });
+
+    // go to step3
+    cy.contains('Next').click();
+
+    // config prometheus plugin
+    cy.contains('.ant-card', 'prometheus').get('button').first().click();
+    cy.contains('button','Cancel').click();

Review comment:
        Maybe it's because of my local environment version, I will check it after writing Front-end CI




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] idbeta commented on a change in pull request #1056: feat: Refactor frontend e2e

Posted by GitBox <gi...@apache.org>.
idbeta commented on a change in pull request #1056:
URL: https://github.com/apache/apisix-dashboard/pull/1056#discussion_r544777742



##########
File path: web/cypress/integration/route/create_and_delete_route.spec.js
##########
@@ -0,0 +1,87 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/* eslint-disable no-undef */
+
+context('Create and Delete Route', () => {

Review comment:
       LGTM




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] LiteSun commented on a change in pull request #1056: feat: Refactor frontend e2e

Posted by GitBox <gi...@apache.org>.
LiteSun commented on a change in pull request #1056:
URL: https://github.com/apache/apisix-dashboard/pull/1056#discussion_r545141080



##########
File path: web/cypress/integration/route/create_and_delete_route.spec.js
##########
@@ -0,0 +1,89 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/* eslint-disable no-undef */
+
+context('Create and Delete Route', () => {
+  const root_name = `root_${new Date().valueOf()}`;
+
+  beforeEach(() => {
+    // init login 
+    cy.login();
+  })
+
+  it('create route', () => {
+    //  go to route create page
+    cy.visit('/routes/create');
+    cy.contains('Route').click();
+    cy.contains('Create').click();
+
+    // input Name And Description
+    cy.get('#name').type(root_name);
+    cy.get('#desc').type('desc');
+
+    // input Request Basic Define
+    cy.get('#hosts_0').type('11.11.11.11');
+    cy.get('[data-cy=addHost]').click();
+    cy.get('#hosts_1').type('12.12.12.12');
+    cy.get('#remote_addrs_0').type('12.12.12.12');
+    cy.get('[data-cy=addRemoteAddr]').click();
+    cy.get('#remote_addrs_1').type('10.10.10.10');
+    cy.contains('Advanced Routing Matching Conditions').parent().siblings().contains('Create').click();
+
+    // create Advanced Routing Matching Conditions 
+    cy.get('#position').click();
+    cy.contains('Cookie').click();
+    cy.get('.ant-modal').within(() => {
+      cy.get('#name').type('modalName');
+    })
+    cy.get('#operator').click();
+    cy.contains('Equal').click();
+    cy.get('#value').type('value');
+    cy.contains('Confirm').click();
+
+    // go to step2
+    cy.contains('Next').click();
+    cy.wait(400);
+    cy.get('#nodes_0_host').type('12.12.12.12', {
+      timeout: 4000
+    });
+
+    // go to step3
+    cy.contains('Next').click();
+
+    // config prometheus plugin
+    cy.contains('.ant-card', 'prometheus').get('button').first().click();
+    cy.contains('button', 'Cancel').click();
+
+    // go to step4
+    cy.contains('Next').click();
+    cy.contains('Submit').click();
+    cy.contains('SubmitSuccessfully');
+
+    // back to route list page
+    cy.contains('Return Route List').click();
+    cy.url().should('contains', 'routes/list');
+  });
+
+  it('delete the route', () => {
+    cy.visit('/routes/list');
+    cy.get('[title=Name]').type(root_name);
+    cy.contains('查 询').click();

Review comment:
       > remove Chinese
   
   as @juzhiyuan 's comment, this issue is related to i18n, could resolve it in other PR :)
   




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] idbeta commented on a change in pull request #1056: feat: Refactor frontend e2e

Posted by GitBox <gi...@apache.org>.
idbeta commented on a change in pull request #1056:
URL: https://github.com/apache/apisix-dashboard/pull/1056#discussion_r544100380



##########
File path: web/cypress/integration/route/create_and_delete_route.spec.js
##########
@@ -0,0 +1,73 @@
+/* eslint-disable no-undef */
+/// <reference types="cypress" />
+
+context('Create and Delete Route', () => {
+  const root_name = `root_${new Date().valueOf()}`
+
+  beforeEach(() => {
+    // init login 
+    cy.login();
+  })
+
+  it('create route', () => {
+    //  go to route create page
+    cy.visit('/routes/create');
+    cy.contains('Route').click();
+    cy.contains('Create').click();
+
+    // input Name And Description
+    cy.get('#name').type(root_name);
+    cy.get('#desc').type('desc');
+
+    // input Request Basic Define
+    cy.get('#hosts_0').type('11.11.11.11');
+    cy.contains('Domain Name').parent().parent().parent().contains(' Create').click();
+    cy.get('#hosts_1').type('12.12.12.12');
+    cy.get('#remote_addrs_0').type('12.12.12.12');
+    cy.contains('Remote Addrs').parent().parent().parent().contains(' Create').click();
+    cy.get('#remote_addrs_1').type('10.10.10.10');
+    cy.contains('Advanced Routing Matching Conditions').parent().siblings().contains('Create').click();
+
+    // create rule 
+    cy.get('#position').click();
+    cy.contains('Cookie').click();
+    cy.get('.ant-modal').within(() => {
+      cy.get('#name').type('modalName');
+    })
+    cy.get('#operator').click();
+    cy.contains('Equal').click();
+    cy.get('#value').type('value');
+    cy.contains('Confirm').click();
+
+    // go to step2
+    cy.contains('Next').click();
+    cy.wait(400)
+    cy.get('#nodes_0_host').type('12.12.12.12', {
+      timeout: 4000
+    });
+
+    // go to step3
+    cy.contains('Next').click();
+
+    // config prometheus plugin
+    cy.contains('.ant-card', 'prometheus').get('button').first().click();
+    cy.contains('button','Cancel').click();

Review comment:
       why `Cancel`?  could you use the `limit-req` as plugin example? because most of plugins should pass json data into the edit control.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] LiteSun commented on a change in pull request #1056: feat: Refactor frontend e2e

Posted by GitBox <gi...@apache.org>.
LiteSun commented on a change in pull request #1056:
URL: https://github.com/apache/apisix-dashboard/pull/1056#discussion_r544764427



##########
File path: docs/front-end-e2e.md
##########
@@ -0,0 +1,36 @@
+<!--
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+-->
+
+This project uses [Cypress](https://www.cypress.io/) as the front-end E2E test framework.
+
+1. To start the front-end project locally, please refer to [develop](./develop.md/) web section.
+   
+2. Open Cypress test-runner. For the use of test-runner, please refer to [test-runner](https://docs.cypress.io/guides/core-concepts/test-runner.html#) Overview.
+   ```sh
+   yarn cypress:open-dev
+   ```
+   
+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.

Review comment:
       fixed.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] nic-chen commented on a change in pull request #1056: feat: Refactor frontend e2e

Posted by GitBox <gi...@apache.org>.
nic-chen commented on a change in pull request #1056:
URL: https://github.com/apache/apisix-dashboard/pull/1056#discussion_r544349059



##########
File path: web/cypress/integration/route/create_and_delete_route.spec.js
##########
@@ -0,0 +1,87 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/* eslint-disable no-undef */
+
+context('Create and Delete Route', () => {
+  const root_name = `root_${new Date().valueOf()}`;
+
+  beforeEach(() => {
+    // init login 
+    cy.login();
+  })
+
+  it('create route', () => {
+    //  go to route create page
+    cy.visit('/routes/create');
+    cy.contains('Route').click();
+    cy.contains('Create').click();
+
+    // input Name And Description
+    cy.get('#name').type(root_name);
+    cy.get('#desc').type('desc');
+
+    // input Request Basic Define
+    cy.get('#hosts_0').type('11.11.11.11');
+    cy.contains('Domain Name').parent().parent().parent().contains(' Create').click();

Review comment:
       could we use `parents()` here?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] LiteSun commented on a change in pull request #1056: feat: Refactor frontend e2e

Posted by GitBox <gi...@apache.org>.
LiteSun commented on a change in pull request #1056:
URL: https://github.com/apache/apisix-dashboard/pull/1056#discussion_r544323331



##########
File path: web/cypress/support/commands.js
##########
@@ -0,0 +1,40 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/* eslint-disable no-undef */
+Cypress.Commands.add('login', () => {
+  const serveUrlMap = {
+    dev: 'http://139.217.190.60',
+    test: 'http://localhost:9000',
+  };
+
+  const {
+    SERVE_ENV = 'dev'
+  } = Cypress.env();
+  

Review comment:
       > I think it should change the dashboard language to English first.
   
   The default language of antd is English. 
   




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org