From e82e1593d808041a0a9fdc988ca0ccf3ab931215 Mon Sep 17 00:00:00 2001 From: Ashley Harrison Date: Wed, 27 Sep 2023 14:25:04 +0100 Subject: [PATCH] Chore: Remove some hardcoded waits from e2e tests (#75515) remove some hardcoded waits --- e2e/panels-suite/panelEdit_base.spec.ts | 2 -- e2e/smoke-tests-suite/panels_smokescreen.spec.ts | 3 --- e2e/various-suite/exemplars.spec.ts | 8 +------- e2e/various-suite/filter-annotations.spec.ts | 2 -- e2e/various-suite/gauge.spec.ts | 2 -- e2e/various-suite/graph-auto-migrate.spec.ts | 2 -- e2e/various-suite/loki-query-builder.spec.ts | 2 -- e2e/various-suite/visualization-suggestions.spec.ts | 1 - 8 files changed, 1 insertion(+), 21 deletions(-) diff --git a/e2e/panels-suite/panelEdit_base.spec.ts b/e2e/panels-suite/panelEdit_base.spec.ts index e0dbcc2f63b..8f0703788f6 100644 --- a/e2e/panels-suite/panelEdit_base.spec.ts +++ b/e2e/panels-suite/panelEdit_base.spec.ts @@ -68,8 +68,6 @@ describe('Panel edit tests', () => { e2e.components.PanelEditor.toggleVizOptions().click(); e2e.components.PanelEditor.OptionsPane.content().should('not.exist'); - cy.wait(100); - // open options pane e2e.components.PanelEditor.toggleVizOptions().should('be.visible').click(); e2e.components.PanelEditor.OptionsPane.content().should('be.visible'); diff --git a/e2e/smoke-tests-suite/panels_smokescreen.spec.ts b/e2e/smoke-tests-suite/panels_smokescreen.spec.ts index 4ae35132e91..5ba784d72b2 100644 --- a/e2e/smoke-tests-suite/panels_smokescreen.spec.ts +++ b/e2e/smoke-tests-suite/panels_smokescreen.spec.ts @@ -34,9 +34,6 @@ describe('Panels smokescreen', () => { e2e.components.PanelEditor.toggleVizPicker().click(); e2e.components.PluginVisualization.item(panel.name).scrollIntoView().should('be.visible').click(); - // Wait for panel to load (TODO: Better way to do this?) - cy.wait(500); - e2e.components.PanelEditor.toggleVizPicker().should((e) => expect(e).to.contain(panel.name)); // TODO: Come up with better check / better failure messaging to clearly indicate which panel failed cy.contains('An unexpected error happened').should('not.exist'); diff --git a/e2e/various-suite/exemplars.spec.ts b/e2e/various-suite/exemplars.spec.ts index 11439ad3808..97da7f3aabd 100644 --- a/e2e/various-suite/exemplars.spec.ts +++ b/e2e/various-suite/exemplars.spec.ts @@ -70,13 +70,7 @@ describe('Exemplars', () => { e2e.components.TimePicker.applyTimeRange().click(); e2e.components.QueryField.container().should('be.visible').type('exemplar-query_bucket{shift}{enter}'); - cy.wait(1000); - - cy.get('body').then((body) => { - if (body.find(`[data-testid="time-series-zoom-to-data"]`).length > 0) { - cy.get(`[data-testid="time-series-zoom-to-data"]`).click(); - } - }); + cy.get(`[data-testid="time-series-zoom-to-data"]`).click(); e2e.components.DataSource.Prometheus.exemplarMarker().first().trigger('mouseover'); cy.contains('Query with gdev-tempo').click(); diff --git a/e2e/various-suite/filter-annotations.spec.ts b/e2e/various-suite/filter-annotations.spec.ts index b89c2a5a780..23d64eb0826 100644 --- a/e2e/various-suite/filter-annotations.spec.ts +++ b/e2e/various-suite/filter-annotations.spec.ts @@ -49,8 +49,6 @@ describe('Annotations filtering', () => { e2e.pages.Dashboard.SubMenu.Annotations.annotationToggle('Red, only panel 1').should('be.checked'); }); - cy.wait(3000); - e2e.components.Panels.Panel.title('Panel one') .should('exist') .within(() => { diff --git a/e2e/various-suite/gauge.spec.ts b/e2e/various-suite/gauge.spec.ts index 50b64ebd5b6..64e4ce14b61 100644 --- a/e2e/various-suite/gauge.spec.ts +++ b/e2e/various-suite/gauge.spec.ts @@ -9,8 +9,6 @@ describe('Gauge Panel', () => { // open Panel Tests - Gauge e2e.flows.openDashboard({ uid: '_5rDmaQiz' }); - cy.wait(1000); - // check that gauges are rendered cy.get('body').find(`.flot-base`).should('have.length', 16); diff --git a/e2e/various-suite/graph-auto-migrate.spec.ts b/e2e/various-suite/graph-auto-migrate.spec.ts index 7f7f8b6b5c1..4360477ce61 100644 --- a/e2e/various-suite/graph-auto-migrate.spec.ts +++ b/e2e/various-suite/graph-auto-migrate.spec.ts @@ -14,8 +14,6 @@ describe('Auto-migrate graph panel', () => { e2e.flows.openDashboard({ uid: DASHBOARD_ID, queryParams: { '__feature.autoMigrateOldPanels': true } }); - cy.wait(1000); - e2e.components.Panels.Panel.title('Business Hours') .should('exist') .within(() => { diff --git a/e2e/various-suite/loki-query-builder.spec.ts b/e2e/various-suite/loki-query-builder.spec.ts index 30a06ce3439..348a4d92ab5 100644 --- a/e2e/various-suite/loki-query-builder.spec.ts +++ b/e2e/various-suite/loki-query-builder.spec.ts @@ -69,12 +69,10 @@ describe('Loki query builder', () => { e2e.components.QueryBuilder.labelSelect().should('be.visible').click(); // wait until labels are loaded and set on the component before starting to type cy.wait('@labelsRequest'); - cy.wait(100); e2e.components.QueryBuilder.labelSelect().type('instance{enter}'); e2e.components.QueryBuilder.matchOperatorSelect().should('be.visible').click().type('=~{enter}'); e2e.components.QueryBuilder.valueSelect().should('be.visible').click(); cy.wait('@valuesRequest'); - cy.wait(100); e2e.components.QueryBuilder.valueSelect().type('instance1{enter}').type('instance2{enter}'); cy.contains(MISSING_LABEL_FILTER_ERROR_MESSAGE).should('not.exist'); cy.contains(finalQuery).should('be.visible'); diff --git a/e2e/various-suite/visualization-suggestions.spec.ts b/e2e/various-suite/visualization-suggestions.spec.ts index 4d27a9061ea..100953980f5 100644 --- a/e2e/various-suite/visualization-suggestions.spec.ts +++ b/e2e/various-suite/visualization-suggestions.spec.ts @@ -11,7 +11,6 @@ describe('Visualization suggestions', () => { // Try visualization suggestions e2e.components.PanelEditor.toggleVizPicker().click(); cy.contains('Suggestions').click(); - cy.wait(3000); // Verify we see suggestions e2e.components.VisualizationPreview.card('Line chart').should('be.visible');