This is an automated email from the ASF dual-hosted git repository. diegopucci pushed a commit to branch fix/flaky-e2e-test-high-medium in repository https://gitbox.apache.org/repos/asf/superset.git
commit fa8fddb5b5275dd142b2e0d320a908a0cb4431d8 Author: geido <[email protected]> AuthorDate: Thu Nov 17 17:26:02 2022 +0200 Improve dashboards tooltip test --- .../cypress-base/cypress/integration/dashboard/utils.ts | 4 ++++ superset-frontend/cypress-base/cypress/integration/explore/utils.ts | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/superset-frontend/cypress-base/cypress/integration/dashboard/utils.ts b/superset-frontend/cypress-base/cypress/integration/dashboard/utils.ts index 076b0438ae..5acbcd6bfb 100644 --- a/superset-frontend/cypress-base/cypress/integration/dashboard/utils.ts +++ b/superset-frontend/cypress-base/cypress/integration/dashboard/utils.ts @@ -158,6 +158,10 @@ export function interceptDatasets() { cy.intercept('GET', `/api/v1/dashboard/*/datasets`).as('getDatasets'); } +export function interceptDashboardasync() { + cy.intercept('GET', `/dashboardasync/api/read*`).as('getDashboardasync'); +} + export function setFilter(filter: string, option: string) { interceptFiltering(); diff --git a/superset-frontend/cypress-base/cypress/integration/explore/utils.ts b/superset-frontend/cypress-base/cypress/integration/explore/utils.ts index eb8631c753..245d9d3b09 100644 --- a/superset-frontend/cypress-base/cypress/integration/explore/utils.ts +++ b/superset-frontend/cypress-base/cypress/integration/explore/utils.ts @@ -17,7 +17,7 @@ * under the License. */ -import { interceptGet as interceptDashboardGet } from '../dashboard/utils'; +import { interceptGet as interceptDashboardGet, interceptDashboardasync } from '../dashboard/utils'; export function interceptFiltering() { cy.intercept('GET', `/api/v1/chart/?q=*`).as('filtering'); @@ -58,10 +58,13 @@ export function setFilter(filter: string, option: string) { export function saveChartToDashboard(dashboardName: string) { interceptDashboardGet(); + interceptDashboardasync(); interceptUpdate(); interceptExploreGet(); cy.getBySel('query-save-button').click(); + cy.wait('@getDashboardasync'); + cy.getBySelLike('chart-moda').should('be.visible'); cy.get( '[data-test="save-chart-modal-select-dashboard-form"] [aria-label="Select a dashboard"]', )
