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 2021/05/14 14:56:02 UTC

[GitHub] [apisix-dashboard] guoqqqi commented on a change in pull request #1879: chore: refactored test create_and_delete_upstream.spec.js

guoqqqi commented on a change in pull request #1879:
URL: https://github.com/apache/apisix-dashboard/pull/1879#discussion_r631165889



##########
File path: web/cypress/integration/upstream/create_and_delete_upstream.spec.js
##########
@@ -17,117 +17,137 @@
 /* eslint-disable no-undef */
 
 context('Create and Delete Upstream', () => {
+
+  const selector = {
+    "name": "#name",
+    "nodes_0_host": "#nodes_0_host",
+    "nodes_0_port": "#nodes_0_port",
+    "nodes_0_weight": "#nodes_0_weight",
+    "input": ":input",
+    "notification": ".ant-notification-notice-message",
+    "nameSelector": "[title=Name]",
+    "upstreamType": ".ant-select-item-option-content",
+    "drawer": ".ant-drawer-content",
+    "codemirrorScroll": ".CodeMirror-scroll",
+    "description": "#desc",
+  }
+
+  const data = {
+    "upstreamName": "test_upstream",
+    "description": "desc_by_autotest",
+    "ip1": "127.0.0.1",
+    "createUpstreamSuccess": "Create Upstream Successfully",
+    "deleteUpstreamSuccess": "Delete Upstream Successfully",
+  }
+
   beforeEach(() => {
     cy.login();
-
-    cy.fixture('selector.json').as('domSelector');
-    cy.fixture('data.json').as('data');
   });
 
   it('should create upstream with default type (roundrobin)', function () {
     cy.visit('/');
     cy.contains('Upstream').click();
     cy.contains('Create').click();
 
-    cy.get(this.domSelector.name).type(this.data.upstreamName);
-    cy.get(this.domSelector.description).type(this.data.description);
+    cy.get(selector.name).type(data.upstreamName);
+    cy.get(selector.description).type(data.description);
 
-    cy.get(this.domSelector.nodes_0_host).type(this.data.ip1);
-    cy.get(this.domSelector.nodes_0_port).clear().type('7000');
-    cy.get(this.domSelector.nodes_0_weight).clear().type(1);
+    cy.get(selector.nodes_0_host).type(data.ip1);
+    cy.get(selector.nodes_0_port).clear().type('7000');

Review comment:
       Hi, 7000 is not required here, it can also be other values




-- 
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