From b3642eb18d09da01897eb5db38798c8018381bef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=A4ggmark?= Date: Tue, 27 Apr 2021 08:53:43 +0200 Subject: [PATCH] e2e: slows down failing test (#33401) * e2e: slows down failing test * Update set-options-from-ui.ts --- .../specs/variables/set-options-from-ui.ts | 34 ++++++------------- 1 file changed, 11 insertions(+), 23 deletions(-) diff --git a/e2e/suite1/specs/variables/set-options-from-ui.ts b/e2e/suite1/specs/variables/set-options-from-ui.ts index 97f7c7ea987..87949ff4b16 100644 --- a/e2e/suite1/specs/variables/set-options-from-ui.ts +++ b/e2e/suite1/specs/variables/set-options-from-ui.ts @@ -6,13 +6,7 @@ describe('Variables - Set options from ui', () => { it('clicking a value that is not part of dependents options should change these to All', () => { e2e.flows.login('admin', 'admin'); e2e.flows.openDashboard({ uid: `${PAGE_UNDER_TEST}?orgId=1&var-datacenter=A&var-server=AA&var-pod=AAA` }); - e2e().server(); - e2e() - .route({ - method: 'POST', - url: '/api/ds/query', - }) - .as('query'); + e2e().intercept('/api/ds/query').as('query'); e2e().wait('@query'); @@ -28,9 +22,13 @@ describe('Variables - Set options from ui', () => { e2e.components.LoadingIndicator.icon().should('have.length', 0); - e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('All').should('have.length', 2); + e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('All') + .should('have.length', 2) + .eq(0) + .should('be.visible') + .click(); - e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('All').eq(0).should('be.visible').click(); + e2e().wait(2000); e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownDropDown() .should('be.visible') @@ -45,6 +43,8 @@ describe('Variables - Set options from ui', () => { e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('All').should('be.visible').click(); + e2e().wait(2000); + e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownDropDown() .should('be.visible') .within(() => { @@ -66,13 +66,7 @@ describe('Variables - Set options from ui', () => { it('adding a value that is not part of dependents options should add the new values dependant options', () => { e2e.flows.login('admin', 'admin'); e2e.flows.openDashboard({ uid: `${PAGE_UNDER_TEST}?orgId=1&var-datacenter=A&var-server=AA&var-pod=AAA` }); - e2e().server(); - e2e() - .route({ - method: 'POST', - url: '/api/ds/query', - }) - .as('query'); + e2e().intercept('/api/ds/query').as('query'); e2e().wait('@query'); @@ -123,13 +117,7 @@ describe('Variables - Set options from ui', () => { e2e.flows.openDashboard({ uid: `${PAGE_UNDER_TEST}?orgId=1&var-datacenter=A&var-datacenter=B&var-server=AA&var-server=BB&var-pod=AAA&var-pod=BBB`, }); - e2e().server(); - e2e() - .route({ - method: 'POST', - url: '/api/ds/query', - }) - .as('query'); + e2e().intercept('/api/ds/query').as('query'); e2e().wait('@query');