diff --git a/superset-frontend/cypress-base/cypress/e2e/dashboard/utils.ts b/superset-frontend/cypress-base/cypress/e2e/dashboard/utils.ts index 40c1d382720..778abd8b098 100644 --- a/superset-frontend/cypress-base/cypress/e2e/dashboard/utils.ts +++ b/superset-frontend/cypress-base/cypress/e2e/dashboard/utils.ts @@ -189,8 +189,10 @@ export function interceptFilterState() { export function setFilter(filter: string, option: string) { interceptFiltering(); - cy.get(`[aria-label="${filter}"]`).first().click(); - cy.get(`[aria-label="${filter}"] [title="${option}"]`).click(); + cy.get(`[aria-label^="${filter}"]`).first().click(); + cy.get(`.ant-select-item-option[title="${option}"]`).first().click({ + force: true, + }); cy.wait('@filtering'); } @@ -346,8 +348,10 @@ export function addParentFilterWithValue(index: number, value: string) { return cy .get(nativeFilters.filterConfigurationSections.displayedSection) .within(() => { - cy.get('input[aria-label="Limit type"]').eq(index).click({ force: true }); - cy.get('input[aria-label="Limit type"]') + cy.get('input[aria-label^="Limit type"]') + .eq(index) + .click({ force: true }); + cy.get('input[aria-label^="Limit type"]') .eq(index) .type(`${value}{enter}`, { delay: 30, force: true }); }); diff --git a/superset-frontend/cypress-base/cypress/e2e/explore/link.test.ts b/superset-frontend/cypress-base/cypress/e2e/explore/link.test.ts index e768e5a8c9c..a984969a9bc 100644 --- a/superset-frontend/cypress-base/cypress/e2e/explore/link.test.ts +++ b/superset-frontend/cypress-base/cypress/e2e/explore/link.test.ts @@ -154,7 +154,7 @@ describe('Test explore links', () => { // This time around, typing the same dashboard name // will select the existing one cy.get('[data-test="save-chart-modal-select-dashboard-form"]') - .find('input[aria-label="Select a dashboard"]') + .find('input[aria-label^="Select a dashboard"]') .type(`${dashboardTitle}{enter}`, { force: true }); cy.get(`.ant-select-item[label="${dashboardTitle}"]`).click({ diff --git a/superset-frontend/cypress-base/cypress/e2e/explore/utils.ts b/superset-frontend/cypress-base/cypress/e2e/explore/utils.ts index 8bc17aa2bc3..8eeb097794c 100644 --- a/superset-frontend/cypress-base/cypress/e2e/explore/utils.ts +++ b/superset-frontend/cypress-base/cypress/e2e/explore/utils.ts @@ -61,8 +61,10 @@ export function interceptExploreGet() { export function setFilter(filter: string, option: string) { interceptFiltering(); - cy.get(`[aria-label="${filter}"]`).first().click(); - cy.get(`[aria-label="${filter}"] [title="${option}"]`).click(); + cy.get(`[aria-label^="${filter}"]`).first().click(); + cy.get(`.ant-select-item-option[title="${option}"]`).first().click({ + force: true, + }); cy.wait('@filtering'); } @@ -76,17 +78,18 @@ export function saveChartToDashboard(dashboardName: string) { .should('be.enabled') .should('not.be.disabled') .click(); - cy.getBySelLike('chart-modal').should('be.visible'); - cy.get( - '[data-test="save-chart-modal-select-dashboard-form"] [aria-label="Select a dashboard"]', - ) - .first() - .click(); - cy.get( - '.ant-select-selection-search-input[aria-label="Select a dashboard"]', - ).type(dashboardName, { force: true }); - cy.get(`.ant-select-item-option[title="${dashboardName}"]`).click(); - cy.getBySel('btn-modal-save').click(); + cy.getBySelLike('chart-modal') + .should('be.visible') + .within(() => { + cy.get('[data-test="save-chart-modal-select-dashboard-form"]') + .first() + .click(); + cy.get('.ant-select-selection-search-input').type(dashboardName, { + force: true, + }); + cy.get(`.ant-select-item-option[title="${dashboardName}"]`).click(); + cy.getBySel('btn-modal-save').click(); + }); cy.wait('@update'); cy.wait('@get'); diff --git a/superset-frontend/packages/superset-ui-chart-controls/src/components/ControlHeader.tsx b/superset-frontend/packages/superset-ui-chart-controls/src/components/ControlHeader.tsx index 44e47d55e99..36d3182ab2e 100644 --- a/superset-frontend/packages/superset-ui-chart-controls/src/components/ControlHeader.tsx +++ b/superset-frontend/packages/superset-ui-chart-controls/src/components/ControlHeader.tsx @@ -94,9 +94,8 @@ export function ControlHeader({