liuxiran commented on a change in pull request #1879:
URL: https://github.com/apache/apisix-dashboard/pull/1879#discussion_r629844775
##########
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:
it would be better to define test data for `7000` too
--
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:
[email protected]