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/06/04 09:14:37 UTC

[apisix-dashboard] branch master updated: fix: route search test optimised (#1928)

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 a72bed2  fix: route search test optimised (#1928)
a72bed2 is described below

commit a72bed254c90179bc7d315e1e5847eb241760caf
Author: Ayush das <ay...@gmail.com>
AuthorDate: Fri Jun 4 14:43:52 2021 +0530

    fix: route search test optimised (#1928)
---
 web/cypress/integration/route/search-route.spec.js | 23 ++++++++++------------
 1 file changed, 10 insertions(+), 13 deletions(-)

diff --git a/web/cypress/integration/route/search-route.spec.js b/web/cypress/integration/route/search-route.spec.js
index 5c170e3..e0b7898 100644
--- a/web/cypress/integration/route/search-route.spec.js
+++ b/web/cypress/integration/route/search-route.spec.js
@@ -29,8 +29,8 @@ context('Create and Search Route', () => {
     nodes_0_host: '#nodes_0_host',
     nodes_0_port: '#nodes_0_port',
     nodes_0_weight: '#nodes_0_weight',
-    nameSearch: '[title=Name]',
-    pathSearch: '[title=Path]',
+    nameSearchInput: '#name',
+    pathSearchInput: '#uri',
     labelSelect_0: '.ant-select-selection-overflow',
     dropdown: '.rc-virtual-list',
     disabledSwitcher: '#disable',
@@ -114,21 +114,19 @@ context('Create and Search Route', () => {
     cy.visit('/');
     cy.contains('Route').click();
     // full match
-    cy.get(selector.nameSearch).type(data.test1);
+    cy.get(selector.nameSearchInput).type(data.test1);
     cy.contains('Search').click();
     cy.contains(data.test1).siblings().should('contain', data.desc1);
     cy.contains(data.test0).should('not.exist');
     cy.contains(data.test2).should('not.exist');
     // partial match
-    cy.reload();
-    cy.get(selector.nameSearch).type(data.test);
+    cy.get(selector.nameSearchInput).clear().type(data.test);
     cy.contains('Search').click();
     cy.contains(data.test0).siblings().should('contain', data.desc0);
     cy.contains(data.test1).siblings().should('contain', data.desc1);
     cy.contains(data.test2).siblings().should('contain', data.desc2);
     // no match
-    cy.reload();
-    cy.get(selector.nameSearch).type(data.testx);
+    cy.get(selector.nameSearchInput).clear().type(data.testx);
     cy.contains('Search').click();
     cy.contains(data.test0).should('not.exist');
     cy.contains(data.test1).should('not.exist');
@@ -139,21 +137,19 @@ context('Create and Search Route', () => {
     cy.visit('/');
     cy.contains('Route').click();
     // full match
-    cy.get(selector.pathSearch).type(data.uris1);
+    cy.get(selector.pathSearchInput).type(data.uris1);
     cy.contains('Search').click();
     cy.contains(data.uris1).should('contain', data.uris1);
     cy.contains(data.uris0).should('not.exist');
     cy.contains(data.uris2).should('not.exist');
     // partial match
-    cy.reload();
-    cy.get(selector.pathSearch).type(data.uris);
+    cy.get(selector.pathSearchInput).clear().type(data.uris);
     cy.contains('Search').click();
     cy.contains(data.uris0).should('contain', data.uris);
     cy.contains(data.uris1).should('contain', data.uris);
     cy.contains(data.uris2).should('contain', data.uris);
     // no match
-    cy.reload();
-    cy.get(selector.pathSearch).type(data.urisx);
+    cy.get(selector.pathSearchInput).clear().type(data.urisx);
     cy.contains('Search').click();
     cy.contains(data.uris0).should('not.exist');
     cy.contains(data.uris1).should('not.exist');
@@ -161,8 +157,9 @@ context('Create and Search Route', () => {
   });
 
   it('should search the route with labels', function () {
+    cy.visit('/');
+    cy.contains('Route').click();
     // search one label
-    cy.reload();
     cy.get(selector.expandSearch).click();
     cy.get(selector.labelSelect_0).click({ timeout });
     cy.get(selector.dropdown).contains(data.value0).should('be.visible').click();