From e324a346f6f60dcfa38b8cea0dfd4ac059cd95b5 Mon Sep 17 00:00:00 2001 From: Sergej-Vlasov <37613182+Sergej-Vlasov@users.noreply.github.com> Date: Mon, 20 May 2024 18:30:35 +0100 Subject: [PATCH] DashboardScene: Re-enabled skipped scenes e2e tests due to bugs (#87723) * enabled skipped tests * adjust to wait for loading indicator * adjust typos * adjust e2e workflow for test PR run * restore workflow * adjust workflow for test run * restore workflow to sheduled runs --- e2e/scenes/dashboard-suite/new-interval-variable.spec.ts | 7 +++---- e2e/scenes/dashboard-suite/set-options-from-ui.spec.ts | 9 ++++++--- e2e/scenes/dashboard-suite/textbox-variables.spec.ts | 3 +-- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/e2e/scenes/dashboard-suite/new-interval-variable.spec.ts b/e2e/scenes/dashboard-suite/new-interval-variable.spec.ts index 6ac5fe1f5b4..88e1052ce5e 100644 --- a/e2e/scenes/dashboard-suite/new-interval-variable.spec.ts +++ b/e2e/scenes/dashboard-suite/new-interval-variable.spec.ts @@ -15,8 +15,7 @@ describe('Variables - Interval', () => { e2e.flows.login(Cypress.env('USERNAME'), Cypress.env('PASSWORD')); }); - // TODO: remove skip once https://github.com/grafana/grafana/issues/84727 is done - it.skip('can add a new interval variable', () => { + it('can add a new interval variable', () => { e2e.flows.openDashboard({ uid: `${PAGE_UNDER_TEST}?orgId=1&editview=variables` }); cy.contains(DASHBOARD_NAME).should('be.visible'); @@ -41,8 +40,8 @@ describe('Variables - Interval', () => { e2e.components.RefreshPicker.runButtonV2().click(); - e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('10s').click(); - e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('1h30m').click(); + e2e.pages.Dashboard.SubMenu.submenuItemLabels('Variable under test').next().should('have.text', `10s`).click(); + e2e.components.Select.option().contains('1h30m').click(); // Assert it was rendered cy.get('.markdown-html').should('include.text', 'VariableUnderTest: 1h30m'); diff --git a/e2e/scenes/dashboard-suite/set-options-from-ui.spec.ts b/e2e/scenes/dashboard-suite/set-options-from-ui.spec.ts index 6ab14507b9c..4b5f809a930 100644 --- a/e2e/scenes/dashboard-suite/set-options-from-ui.spec.ts +++ b/e2e/scenes/dashboard-suite/set-options-from-ui.spec.ts @@ -1,3 +1,5 @@ +import { selectors } from '@grafana/e2e-selectors'; + import { e2e } from '../utils'; const PAGE_UNDER_TEST = '-Y-tnEDWk/templating-nested-template-variables'; @@ -85,7 +87,7 @@ describe('Variables - Set options from ui', () => { e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('A,B').scrollIntoView().should('be.visible'); - e2e.components.LoadingIndicator.icon().should('have.length', 0); + cy.get(`[aria-label="${selectors.components.LoadingIndicator.icon}"]`).should('not.exist'); e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('AA') .should('be.visible') @@ -137,6 +139,7 @@ describe('Variables - Set options from ui', () => { cy.intercept({ pathname: '/api/ds/query' }).as('query'); cy.wait('@query'); + cy.get(`[aria-label="${selectors.components.LoadingIndicator.icon}"]`).should('not.exist'); e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('A,B') .should('be.visible') @@ -146,8 +149,8 @@ describe('Variables - Set options from ui', () => { cy.get('body').click(); - cy.wait(300); cy.wait('@query'); + cy.get(`[aria-label="${selectors.components.LoadingIndicator.icon}"]`).should('not.exist'); e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('B') .scrollIntoView() @@ -158,7 +161,7 @@ describe('Variables - Set options from ui', () => { cy.get('body').click(); - e2e.components.LoadingIndicator.icon().should('have.length', 0); + cy.get(`[aria-label="${selectors.components.LoadingIndicator.icon}"]`).should('not.exist'); e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('BB') .should('be.visible') diff --git a/e2e/scenes/dashboard-suite/textbox-variables.spec.ts b/e2e/scenes/dashboard-suite/textbox-variables.spec.ts index f52a5b2a616..4b5790a7f76 100644 --- a/e2e/scenes/dashboard-suite/textbox-variables.spec.ts +++ b/e2e/scenes/dashboard-suite/textbox-variables.spec.ts @@ -7,8 +7,7 @@ describe('TextBox - load options scenarios', function () { e2e.flows.login(Cypress.env('USERNAME'), Cypress.env('PASSWORD')); }); - // TODO: remove skip after https://github.com/grafana/grafana/issues/86435 - it.skip('default options should be correct', function () { + it('default options should be correct', function () { e2e.flows.openDashboard({ uid: `${PAGE_UNDER_TEST}/templating-textbox-e2e-scenarios?orgId=1` }); validateTextboxAndMarkup('default value');