You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by su...@apache.org on 2021/02/09 02:58:10 UTC
[apisix-dashboard] branch master updated: fix: update create route
with upstream to make it stable (#1451)
This is an automated email from the ASF dual-hosted git repository.
sunyi 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 c09f0bb fix: update create route with upstream to make it stable (#1451)
c09f0bb is described below
commit c09f0bbc51fd4c2e82f35ae71756dea46bdabf3c
Author: liuxiran <be...@126.com>
AuthorDate: Tue Feb 9 10:58:03 2021 +0800
fix: update create route with upstream to make it stable (#1451)
---
.../route/create-route-with-upstream.spec.js | 22 ++++++++++------------
1 file changed, 10 insertions(+), 12 deletions(-)
diff --git a/web/cypress/integration/route/create-route-with-upstream.spec.js b/web/cypress/integration/route/create-route-with-upstream.spec.js
index 4c45c6e..dbe9348 100644
--- a/web/cypress/integration/route/create-route-with-upstream.spec.js
+++ b/web/cypress/integration/route/create-route-with-upstream.spec.js
@@ -26,6 +26,7 @@ context('Create Route with Upstream', () => {
ip2: '127.0.0.2',
delete_route_success: 'Delete Route Successfully',
delete_upstream_success: 'Delete Upstream Successfully',
+ submitSuccess: 'Submit Successfully',
};
beforeEach(() => {
@@ -46,32 +47,27 @@ context('Create Route with Upstream', () => {
cy.contains('Submit').click();
});
- it('should enter the Route creator', function () {
+ it('should create route with upstream just created', function () {
cy.visit('/');
cy.contains('Route').click();
cy.contains('Create').click();
cy.get(this.domSelector.name).type(data.route_name);
cy.contains('Next').click();
- });
-
- it('should disable Upstream input boxes after selecting an existing upstream', function () {
+ // should disable Upstream input boxes after selecting an existing upstream
cy.get(this.domSelector.upstreamSelector).click();
cy.contains(data.upstream_name).click();
cy.get(this.domSelector.input).should('be.disabled');
- });
-
- it('should enable Upstream input boxes after selecting Custom mode', function () {
+ // should enable Upstream input boxes after selecting Custom mode
cy.get(this.domSelector.upstreamSelector).click();
cy.contains('Custom').click();
cy.get(this.domSelector.input).should('not.be.disabled');
- });
-
- it('should submit custom Upstream properties successfully', function () {
+
cy.get(this.domSelector.nodes_0_host).clear().type(data.ip1);
cy.contains('Next').click();
cy.contains('Next').click();
cy.contains('Submit').click();
+ cy.contains(data.submitSuccess).should('be.visible');
cy.contains('Goto List').click();
cy.url().should('contains', 'routes/list');
});
@@ -80,7 +76,6 @@ context('Create Route with Upstream', () => {
cy.visit('/');
cy.contains('Route').click();
- cy.reload();
cy.get(this.domSelector.nameSelector).type(data.route_name);
cy.contains('Search').click();
cy.contains(data.route_name).siblings().contains('Edit').click();
@@ -103,6 +98,7 @@ context('Create Route with Upstream', () => {
cy.contains('Next').click();
cy.contains('Next').click();
cy.contains('Submit').click();
+ cy.contains(data.submitSuccess).should('be.visible');
cy.contains('Goto List').click();
cy.url().should('contains', 'routes/list');
@@ -110,7 +106,9 @@ context('Create Route with Upstream', () => {
cy.get(this.domSelector.nameSelector).type(data.route_name);
cy.contains('Search').click();
cy.contains(data.route_name).siblings().contains('Edit').click();
- cy.contains('Next').click();
+ // ensure it has already change to edit page
+ cy.get(this.domSelector.name).should('value', data.route_name);
+ cy.contains('Next').click({force: true});
cy.get(this.domSelector.nodes_0_host).should('value', data.ip2);
});