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 654842a feat: improve upstream e2e testcase (#1187)
654842a is described below
commit 654842a1af78ba52c7eb8964b8af850ade93c2a4
Author: litesun <[email protected]>
AuthorDate: Mon Jan 4 19:19:28 2021 +0800
feat: improve upstream e2e testcase (#1187)
---
.../upstream/create_and_delete_upstream.spec.js | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
diff --git
a/web/cypress/integration/upstream/create_and_delete_upstream.spec.js
b/web/cypress/integration/upstream/create_and_delete_upstream.spec.js
index 1822a38..f220677 100644
--- a/web/cypress/integration/upstream/create_and_delete_upstream.spec.js
+++ b/web/cypress/integration/upstream/create_and_delete_upstream.spec.js
@@ -21,6 +21,7 @@ context('Create and Delete Upstream', () => {
const sleepTime = 100; // the unit is milliseconds
const domSelectors = {
notification: '.ant-notification-notice-message',
+ selectItem: '.ant-select-item-option-content'
};
beforeEach(() => {
@@ -73,15 +74,19 @@ context('Create and Delete Upstream', () => {
// change upstream type to chash, todo: optimize the search method
cy.get('[title=roundrobin]').click();
cy.wait(sleepTime);
- cy.get('.ant-select-item:nth-child(2)').click();
+ cy.get(domSelectors.selectItem).within(() => {
+ cy.contains('chash').click();
+ });
cy.get('#hash_on').click();
cy.wait(sleepTime);
- cy.get('.ant-select-item-option-active:nth-child(1) >
.ant-select-item-option-content').click();
+ cy.get(domSelectors.selectItem).within(() => {
+ cy.contains('vars').click();
+ });
cy.get('#key').click();
cy.wait(sleepTime);
- cy.get(
- 'div:nth-child(8) .ant-select-item:nth-child(1) >
.ant-select-item-option-content:nth-child(1)',
- ).click();
+ cy.get(domSelectors.selectItem).within(() => {
+ cy.contains('remote_addr').click();
+ });
// add first upstream node
cy.get('#nodes_0_host').type('127.0.0.1');