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:
us...@infra.apache.org


Reply via email to