diff --git a/superset-frontend/cypress-base/cypress/integration/dashboard/drilltodetail.test.ts b/superset-frontend/cypress-base/cypress/integration/dashboard/drilltodetail.test.ts index 766515bf424..64522a21054 100644 --- a/superset-frontend/cypress-base/cypress/integration/dashboard/drilltodetail.test.ts +++ b/superset-frontend/cypress-base/cypress/integration/dashboard/drilltodetail.test.ts @@ -65,7 +65,7 @@ function openModalFromChartContext(targetMenuItem: string) { .first() .click(); } - + cy.getBySel('metadata-bar').should('be.visible'); cy.wait('@samples'); } diff --git a/superset-frontend/cypress-base/cypress/integration/dashboard/nativeFilters.test.ts b/superset-frontend/cypress-base/cypress/integration/dashboard/nativeFilters.test.ts index 3d9f92962d0..afcd5b2f605 100644 --- a/superset-frontend/cypress-base/cypress/integration/dashboard/nativeFilters.test.ts +++ b/superset-frontend/cypress-base/cypress/integration/dashboard/nativeFilters.test.ts @@ -457,6 +457,7 @@ describe('Native filters', () => { search.split('').slice(1, search.length).join(''); cy.location().then(loc => { + cy.url().should('contain', 'native_filters_key'); const queryParams = qs.parse(removeFirstChar(loc.search)); filterKey = queryParams.native_filters_key as string; expect(typeof filterKey).eq('string'); @@ -465,6 +466,7 @@ describe('Native filters', () => { addCountryNameFilter(); saveNativeFilterSettings([SAMPLE_CHART]); cy.location().then(loc => { + cy.url().should('contain', 'native_filters_key'); const queryParams = qs.parse(removeFirstChar(loc.search)); const newfilterKey = queryParams.native_filters_key; expect(newfilterKey).eq(filterKey); diff --git a/superset-frontend/cypress-base/cypress/integration/dashboard/utils.ts b/superset-frontend/cypress-base/cypress/integration/dashboard/utils.ts index 8147aa60140..89b5c850520 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(); @@ -346,8 +350,8 @@ export function cancelNativeFilterSettings() { .should('be.visible') .click(); cy.get(nativeFilters.modal.alertXUnsavedFilters) - .should('have.text', 'There are unsaved changes.') - .should('be.visible'); + .should('be.visible') + .should('have.text', 'There are unsaved changes.'); cy.get(nativeFilters.modal.footer) .find(nativeFilters.modal.yesCancelButton) .contains('cancel') diff --git a/superset-frontend/cypress-base/cypress/integration/explore/utils.ts b/superset-frontend/cypress-base/cypress/integration/explore/utils.ts index eb8631c753e..3eac4f97be0 100644 --- a/superset-frontend/cypress-base/cypress/integration/explore/utils.ts +++ b/superset-frontend/cypress-base/cypress/integration/explore/utils.ts @@ -17,7 +17,10 @@ * 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 +61,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-modal').should('be.visible'); cy.get( '[data-test="save-chart-modal-select-dashboard-form"] [aria-label="Select a dashboard"]', )