This is an automated email from the ASF dual-hosted git repository.
rusackas pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/superset.git
The following commit(s) were added to refs/heads/master by this push:
new 9ad6917600d chore(cypress): remove dead dashboard drill-to-detail
Cypress suite (#44537)
9ad6917600d is described below
commit 9ad6917600ddcc67c260eebb808d6960f698657a
Author: Joe Li <[email protected]>
AuthorDate: Thu Sep 24 11:26:29 2026 -0700
chore(cypress): remove dead dashboard drill-to-detail Cypress suite (#44537)
Co-authored-by: Claude Sonnet 5 <[email protected]>
---
docs/developer_docs/contributing/howtos.md | 2 +-
.../cypress/e2e/dashboard/drilltodetail.test.ts | 614 -------------------
.../e2e/dashboard/shared_dashboard_functions.ts | 201 ------
.../cypress-base/cypress/e2e/dashboard/utils.ts | 559 -----------------
.../cypress-base/cypress/e2e/explore/chart.test.js | 2 +-
.../cypress-base/cypress/e2e/explore/utils.ts | 4 +-
.../cypress-base/cypress/support/directories.ts | 678 ---------------------
.../cypress-base/cypress/utils/urls.ts | 2 -
.../dashboard/dashboard-drill-to-detail.spec.ts | 3 -
9 files changed, 5 insertions(+), 2060 deletions(-)
diff --git a/docs/developer_docs/contributing/howtos.md
b/docs/developer_docs/contributing/howtos.md
index 3b4e9639c6c..ea0fe6db14b 100644
--- a/docs/developer_docs/contributing/howtos.md
+++ b/docs/developer_docs/contributing/howtos.md
@@ -220,7 +220,7 @@ npm run cypress-debug
npm run cypress-run-chrome
# Run specific file
-npm run cypress-run-chrome -- --spec "cypress/e2e/dashboard/dashboard.test.ts"
+npm run cypress-run-chrome -- --spec "cypress/e2e/explore/chart.test.js"
```
### Debugging Server App
diff --git
a/superset-frontend/cypress-base/cypress/e2e/dashboard/drilltodetail.test.ts
b/superset-frontend/cypress-base/cypress/e2e/dashboard/drilltodetail.test.ts
deleted file mode 100644
index 7bff782c498..00000000000
--- a/superset-frontend/cypress-base/cypress/e2e/dashboard/drilltodetail.test.ts
+++ /dev/null
@@ -1,614 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-import { waitForChartLoad } from 'cypress/utils';
-import { SUPPORTED_CHARTS_DASHBOARD } from 'cypress/utils/urls';
-import {
- openTopLevelTab,
- SUPPORTED_TIER1_CHARTS,
- SUPPORTED_TIER2_CHARTS,
-} from './utils';
-
-function interceptSamples() {
- cy.intercept(`**/datasource/samples*`).as('samples');
-}
-
-function openModalFromMenu(chartType: string) {
- interceptSamples();
-
- cy.get(
- `[data-test-viz-type='${chartType}'] [aria-label='More Options']`,
- ).click();
- cy.get('.ant-dropdown')
- .not('.ant-dropdown-hidden')
- .find("[role='menu'] [role='menuitem']")
- .eq(5)
- .should('contain', 'Drill to detail')
- .click();
- cy.wait('@samples');
-}
-
-function drillToDetail(targetMenuItem: string) {
- interceptSamples();
-
- cy.get('.ant-dropdown')
- .not('.ant-dropdown-hidden')
- .first()
- .find("[role='menu'] [role='menuitem']")
- .contains(new RegExp(`^${targetMenuItem}$`))
- .first()
- .trigger('keydown', { keyCode: 13, which: 13, force: true });
-
- cy.getBySel('metadata-bar').should('be.visible');
- cy.wait('@samples');
-}
-
-const drillToDetailBy = (targetDrill: string) => {
- interceptSamples();
-
- cy.get('.ant-dropdown:not(.ant-dropdown-hidden)')
- .should('be.visible')
- .find("[role='menu'] [role='menuitem']")
- .contains(/^Drill to detail by$/)
- .trigger('mouseover', { force: true });
-
- cy.get(
- '.ant-dropdown-menu-submenu:not(.ant-dropdown-menu-submenu-hidden)
[data-test="drill-to-detail-by-submenu"]',
- )
- .should('be.visible')
- .find('[role="menuitem"]')
- .then($el => {
- cy.wrap($el)
- .contains(new RegExp(`^${targetDrill}$`))
- .trigger('keydown', { keyCode: 13, which: 13, force: true });
- });
-
- cy.getBySel('metadata-bar').should('be.visible');
- return cy.wait('@samples');
-};
-
-function closeModal() {
- cy.get('body').then($body => {
- if ($body.find('[data-test="close-drilltodetail-modal"]').length) {
- cy.getBySel('close-drilltodetail-modal').click({ force: true });
- }
- });
-}
-
-function testTimeChart(vizType: string) {
- interceptSamples();
-
- cy.get(`[data-test-viz-type='${vizType}'] canvas`).then($canvas => {
- cy.wrap($canvas).scrollIntoView();
- cy.wrap($canvas).trigger('mousemove', 85, 93);
- cy.wrap($canvas).rightclick(85, 93);
-
- drillToDetailBy('Drill to detail by 1965');
- cy.getBySel('filter-val').should('contain', '1965');
- closeModal();
-
- cy.wrap($canvas).scrollIntoView();
- cy.wrap($canvas).trigger('mousemove', 85, 93);
- cy.wrap($canvas).rightclick(85, 93);
-
- drillToDetailBy('Drill to detail by boy');
- cy.getBySel('filter-val').should('contain', 'boy');
- closeModal();
-
- cy.wrap($canvas).scrollIntoView();
- cy.wrap($canvas).trigger('mousemove', 85, 93);
- cy.wrap($canvas).rightclick(85, 93);
-
- drillToDetailBy('Drill to detail by all');
- cy.getBySel('filter-val').first().should('contain', '1965');
- cy.getBySel('filter-val').eq(1).should('contain', 'boy');
- closeModal();
- });
-}
-
-// TODO fix this test, it has issues with autoscrolling and the locked title
-// flakes intricately when the righClick is obstructed by the title.
-// Tried many option around scrollIntoView, force, etc. but no luck.
-describe.skip('Drill to detail modal', () => {
- beforeEach(() => {
- closeModal();
- });
-
- describe('Tier 1 charts', () => {
- before(() => {
- cy.visit(SUPPORTED_CHARTS_DASHBOARD);
- openTopLevelTab('Tier 1');
- SUPPORTED_TIER1_CHARTS.forEach(waitForChartLoad);
- });
-
- describe('Modal actions', () => {
- it('opens the modal from the context menu', () => {
- openModalFromMenu('big_number_total');
-
- cy.get("[role='dialog'] .draggable-trigger").should(
- 'contain',
- 'Drill to detail: Big Number',
- );
- });
-
- it('refreshes the data', () => {
- openModalFromMenu('big_number_total');
- // move to the last page
- cy.get('.ant-pagination-item').eq(5).click();
- // skips error on pagination
- cy.on('uncaught:exception', () => false);
- cy.wait('@samples');
- // reload
- cy.get("[aria-label='Reload']").click();
- cy.wait('@samples');
- // make sure it started back from first page
- cy.get('.ant-pagination-item-active').should('contain', '1');
- });
-
- it('paginates', () => {
- openModalFromMenu('big_number_total');
- // checking the data
- cy.getBySel('row-count-label').should('contain', '75.7k rows');
- cy.get('.virtual-table-cell').should($rows => {
- expect($rows).to.contain('Amy');
- });
- // checking the paginated data
- cy.get('.ant-pagination-item')
- .should('have.length', 6)
- .should($pages => {
- expect($pages).to.contain('1');
- expect($pages).to.contain('1514');
- });
- cy.get('.ant-pagination-item').eq(4).click();
- // skips error on pagination
- cy.on('uncaught:exception', () => false);
- cy.wait('@samples');
- cy.get('.virtual-table-cell').should($rows => {
- expect($rows).to.contain('Kimberly');
- });
-
- // verify scroll top on pagination
- cy.getBySelLike('Number-modal').find('.virtual-grid').scrollTo(0, 200);
-
- cy.get('.virtual-grid').contains('Kim').should('not.be.visible');
-
- cy.get('.ant-pagination-item').eq(0).click();
-
- cy.get('.virtual-grid').contains('Aaron').should('be.visible');
- });
- });
-
- describe('Big number total', () => {
- it('opens the modal with no filters', () => {
- interceptSamples();
-
- // opens the modal by clicking on the number on the chart
- cy.get(
- "[data-test-viz-type='big_number_total'] .header-line",
- ).scrollIntoView();
- cy.get(
- "[data-test-viz-type='big_number_total'] .header-line",
- ).rightclick();
-
- drillToDetail('Drill to detail');
-
- cy.getBySel('filter-val').should('not.exist');
- });
- });
-
- describe('Big number with trendline', () => {
- it('opens the modal with the correct data', () => {
- interceptSamples();
-
- // opens the modal by clicking on the number
- cy.get(
- "[data-test-viz-type='big_number'] .header-line",
- ).scrollIntoView();
- cy.get("[data-test-viz-type='big_number'] .header-line").rightclick();
-
- drillToDetail('Drill to detail');
-
- cy.getBySel('filter-val').should('not.exist');
-
- closeModal();
-
- // opens the modal by clicking on the trendline
- cy.get("[data-test-viz-type='big_number'] canvas").then($canvas => {
- cy.wrap($canvas).scrollIntoView();
- cy.wrap($canvas).trigger('mousemove', 1, 14);
- cy.wrap($canvas).rightclick(1, 14);
-
- drillToDetailBy('Drill to detail by 1965');
-
- // checking the filter
- cy.getBySel('filter-val').should('contain', '1965');
- });
- });
- });
-
- describe('Table', () => {
- it('opens the modal with the correct filters', () => {
- interceptSamples();
-
- // focus on table first to trigger browser scroll
- cy.get("[data-test-viz-type='table']").contains('boy').rightclick();
-
- cy.wait(500);
-
cy.get("[data-test-viz-type='table']").contains('boy').scrollIntoView();
- cy.get("[data-test-viz-type='table']").contains('boy').rightclick();
-
- drillToDetailBy('Drill to detail by boy');
-
- cy.getBySel('filter-val').should('contain', 'boy');
-
- closeModal();
-
- // focus on table first to trigger browser scroll
- cy.get("[data-test-viz-type='table']").contains('girl').rightclick();
- cy.wait(500);
- cy.get("[data-test-viz-type='table']").scrollIntoView();
- cy.get("[data-test-viz-type='table']").contains('girl').rightclick();
-
- drillToDetailBy('Drill to detail by girl');
-
- cy.getBySel('filter-val').should('contain', 'girl');
- });
- });
-
- describe('Pivot Table V2', () => {
- it('opens the modal with the correct filters', () => {
- interceptSamples();
-
- cy.get("[data-test-viz-type='pivot_table_v2']").scrollIntoView();
- cy.get("[data-test-viz-type='pivot_table_v2']")
- .find('[role="gridcell"]')
- .first()
- .rightclick();
-
- drillToDetailBy('Drill to detail by boy');
-
- cy.getBySel('filter-val').should('contain', 'boy');
- closeModal();
-
- cy.get("[data-test-viz-type='pivot_table_v2']").scrollIntoView();
- cy.get("[data-test-viz-type='pivot_table_v2']")
- .find('[role="gridcell"]')
- .first()
- .rightclick();
-
- drillToDetailBy('Drill to detail by CA');
-
- cy.getBySel('filter-val').should('contain', 'CA');
- closeModal();
-
- cy.get("[data-test-viz-type='pivot_table_v2']").scrollIntoView();
- cy.get("[data-test-viz-type='pivot_table_v2']")
- .find('[role="gridcell"]')
- .eq(3)
- .rightclick();
-
- drillToDetailBy('Drill to detail by girl');
-
- cy.getBySel('filter-val').should('contain', 'girl');
- closeModal();
-
- cy.get("[data-test-viz-type='pivot_table_v2']").scrollIntoView();
- cy.get("[data-test-viz-type='pivot_table_v2']")
- .find('[role="gridcell"]')
- .eq(3)
- .rightclick();
-
- drillToDetailBy('Drill to detail by FL');
-
- cy.getBySel('filter-val').should('contain', 'FL');
- closeModal();
-
- cy.get("[data-test-viz-type='pivot_table_v2']").scrollIntoView();
- cy.get("[data-test-viz-type='pivot_table_v2']")
- .find('[role="gridcell"]')
- .eq(3)
- .rightclick();
-
- drillToDetailBy('Drill to detail by all');
-
- cy.getBySel('filter-val').first().should('contain', 'girl');
- cy.getBySel('filter-val').eq(1).should('contain', 'FL');
- });
- });
-
- describe('Line Chart', () => {
- it('opens the modal with the correct filters', () => {
- testTimeChart('echarts_timeseries_line');
- });
- });
-
- describe.skip('Bar Chart', () => {
- it('opens the modal with the correct filters', () => {
- interceptSamples();
-
- cy.get("[data-test-viz-type='echarts_timeseries_bar'] canvas").then(
- $canvas => {
- cy.wrap($canvas).scrollIntoView();
- cy.wrap($canvas).rightclick(70, 100);
-
- drillToDetailBy('Drill to detail by 1965');
- cy.getBySel('filter-val').should('contain', '1965');
- closeModal();
-
- cy.wrap($canvas).scrollIntoView();
- cy.wrap($canvas).rightclick(70, 100);
-
- drillToDetailBy('Drill to detail by boy');
- cy.getBySel('filter-val').should('contain', 'boy');
- closeModal();
-
- cy.wrap($canvas).scrollIntoView();
- cy.wrap($canvas).rightclick(70, 100);
-
- drillToDetailBy('Drill to detail by all');
- cy.getBySel('filter-val').first().should('contain', '1965');
- cy.getBySel('filter-val').eq(1).should('contain', 'boy');
- closeModal();
-
- cy.wrap($canvas).scrollIntoView();
- cy.wrap($canvas).rightclick(72, 200);
-
- drillToDetailBy('Drill to detail by girl');
- cy.getBySel('filter-val').should('contain', 'girl');
- },
- );
- });
- });
-
- describe.skip('Area Chart', () => {
- it('opens the modal with the correct filters', () => {
- testTimeChart('echarts_area');
- });
- });
-
- describe('Scatter Chart', () => {
- it('opens the modal with the correct filters', () => {
- testTimeChart('echarts_timeseries_scatter');
- });
- });
-
- describe('Pie', () => {
- it('opens the modal with the correct filters', () => {
- interceptSamples();
-
- // opens the modal by clicking on the slice of the Pie chart
- cy.get("[data-test-viz-type='pie'] canvas").then($canvas => {
- cy.wrap($canvas).scrollIntoView();
- cy.wrap($canvas).rightclick(130, 150);
-
- drillToDetailBy('Drill to detail by girl');
- cy.getBySel('filter-val').should('contain', 'girl');
- closeModal();
-
- cy.wrap($canvas).scrollIntoView();
- cy.wrap($canvas).rightclick(230, 190);
-
- drillToDetailBy('Drill to detail by boy');
- cy.getBySel('filter-val').should('contain', 'boy');
- });
- });
- });
-
- describe.skip('World Map', () => {
- it('opens the modal with the correct filters', () => {
- interceptSamples();
-
- cy.get("[data-test-viz-type='world_map'] svg").then($canvas => {
- cy.wrap($canvas).scrollIntoView();
- cy.wrap($canvas).rightclick(70, 150);
- drillToDetailBy('Drill to detail by USA');
- cy.getBySel('filter-val').should('contain', 'USA');
- closeModal();
- });
- cy.get("[data-test-viz-type='world_map'] svg").then($canvas => {
- cy.wrap($canvas).scrollIntoView();
- cy.wrap($canvas).rightclick(200, 140);
- drillToDetailBy('Drill to detail by SRB');
- cy.getBySel('filter-val').should('contain', 'SRB');
- });
- });
- });
- });
-
- describe('Tier 2 charts', () => {
- before(() => {
- cy.visit(SUPPORTED_CHARTS_DASHBOARD);
- openTopLevelTab('Tier 2');
- SUPPORTED_TIER2_CHARTS.forEach(waitForChartLoad);
- });
-
- describe('Modal actions', () => {
- it('clears filters', () => {
- interceptSamples();
-
- // opens the modal by clicking on the box on the chart
- cy.get("[data-test-viz-type='box_plot'] canvas").then($canvas => {
- const canvasWidth = $canvas.width() || 0;
- const canvasHeight = $canvas.height() || 0;
- const canvasCenterX = canvasWidth / 3 + 15;
- const canvasCenterY = (canvasHeight * 5) / 6;
-
- cy.wrap($canvas).scrollIntoView();
- cy.wrap($canvas).rightclick(canvasCenterX, canvasCenterY, {
- force: true,
- });
-
- drillToDetailBy('Drill to detail by boy');
-
- // checking the filter
- cy.getBySel('filter-val').should('contain', 'boy');
- cy.getBySel('row-count-label').should('contain', '39.2k rows');
- cy.get('.ant-pagination-item')
- .should('have.length', 6)
- .then($pages => {
- expect($pages).to.contain('1');
- expect($pages).to.contain('785');
- });
-
- // close the filter and test that data was reloaded
- cy.getBySel('filter-col').find("[aria-label='Close']").click();
- cy.wait('@samples');
- cy.getBySel('row-count-label').should('contain', '75.7k rows');
- cy.get('.ant-pagination-item-active').should('contain', '1');
- cy.get('.ant-pagination-item')
- .should('have.length', 6)
- .then($pages => {
- expect($pages).to.contain('1');
- expect($pages).to.contain('1514');
- });
- });
- });
- });
-
- describe('Box plot', () => {
- it('opens the modal with the correct filters', () => {
- interceptSamples();
-
- cy.get("[data-test-viz-type='box_plot'] canvas").then($canvas => {
- cy.wrap($canvas).scrollIntoView();
- cy.wrap($canvas).trigger('mousemove', 135, 275);
- cy.wrap($canvas).rightclick(135, 275);
-
- drillToDetailBy('Drill to detail by boy');
- cy.getBySel('filter-val').should('contain', 'boy');
- closeModal();
-
- cy.wrap($canvas).scrollIntoView();
- cy.wrap($canvas).trigger('mousemove', 270, 280);
- cy.wrap($canvas).rightclick(270, 280);
-
- drillToDetailBy('Drill to detail by girl');
- cy.getBySel('filter-val').should('contain', 'girl');
- });
- });
- });
-
- describe('Generic Chart', () => {
- it('opens the modal with the correct filters', () => {
- testTimeChart('echarts_timeseries');
- });
- });
-
- describe('Smooth Chart', () => {
- it('opens the modal with the correct filters', () => {
- testTimeChart('echarts_timeseries_smooth');
- });
- });
-
- describe('Step Line Chart', () => {
- it('opens the modal with the correct filters', () => {
- testTimeChart('echarts_timeseries_step');
- });
- });
-
- describe('Funnel Chart', () => {
- it('opens the modal with the correct filters', () => {
- interceptSamples();
-
- cy.get("[data-test-viz-type='funnel'] canvas").then($canvas => {
- cy.wrap($canvas).scrollIntoView();
- cy.wrap($canvas).rightclick(170, 90);
-
- drillToDetailBy('Drill to detail by boy');
- cy.getBySel('filter-val').should('contain', 'boy');
- closeModal();
-
- cy.wrap($canvas).scrollIntoView();
- cy.wrap($canvas).rightclick(190, 250);
-
- drillToDetailBy('Drill to detail by girl');
- cy.getBySel('filter-val').should('contain', 'girl');
- });
- });
- });
-
- describe('Gauge Chart', () => {
- it('opens the modal with the correct filters', () => {
- interceptSamples();
-
- cy.get("[data-test-viz-type='gauge_chart'] canvas").then($canvas => {
- cy.wrap($canvas).scrollIntoView();
- cy.wrap($canvas).rightclick(135, 95);
-
- drillToDetailBy('Drill to detail by boy');
- cy.getBySel('filter-val').should('contain', 'boy');
- closeModal();
-
- cy.wrap($canvas).scrollIntoView();
- cy.wrap($canvas).rightclick(95, 135);
-
- drillToDetailBy('Drill to detail by girl');
- cy.getBySel('filter-val').should('contain', 'girl');
- });
- });
- });
-
- describe('Mixed Chart', () => {
- it('opens the modal with the correct filters', () => {
- testTimeChart('mixed_timeseries');
- });
- });
-
- describe.skip('Radar Chart', () => {
- it('opens the modal with the correct filters', () => {
- interceptSamples();
-
- cy.get("[data-test-viz-type='radar'] canvas").then($canvas => {
- cy.wrap($canvas).scrollIntoView();
- cy.wrap($canvas).rightclick(180, 45);
-
- drillToDetailBy('Drill to detail by boy');
- cy.getBySel('filter-val').should('contain', 'boy');
- closeModal();
-
- cy.wrap($canvas).scrollIntoView();
- cy.wrap($canvas).rightclick(180, 85);
-
- drillToDetailBy('Drill to detail by girl');
- cy.getBySel('filter-val').should('contain', 'girl');
- });
- });
- });
-
- describe('Treemap', () => {
- it('opens the modal with the correct filters', () => {
- interceptSamples();
-
- cy.get("[data-test-viz-type='treemap_v2'] canvas").then($canvas => {
- cy.wrap($canvas).scrollIntoView();
- cy.wrap($canvas).rightclick(100, 30);
-
- drillToDetailBy('Drill to detail by boy');
- cy.getBySel('filter-val').should('contain', 'boy');
- closeModal();
-
- cy.wrap($canvas).scrollIntoView();
- cy.wrap($canvas).rightclick(150, 250);
-
- drillToDetailBy('Drill to detail by girl');
- cy.getBySel('filter-val').should('contain', 'girl');
- });
- });
- });
- });
-});
diff --git
a/superset-frontend/cypress-base/cypress/e2e/dashboard/shared_dashboard_functions.ts
b/superset-frontend/cypress-base/cypress/e2e/dashboard/shared_dashboard_functions.ts
deleted file mode 100644
index 8bbc1a24e87..00000000000
---
a/superset-frontend/cypress-base/cypress/e2e/dashboard/shared_dashboard_functions.ts
+++ /dev/null
@@ -1,201 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import { SAMPLE_DASHBOARD_1 } from 'cypress/utils/urls';
-import { interceptCharts, interceptDatasets, interceptGet } from './utils';
-
-export const SAMPLE_CHART = { name: 'Most Populated Countries', viz: 'table' };
-
-/**
- * Look up a dataset ID by table name
- */
-export function getDatasetId(tableName: string): Cypress.Chainable<number> {
- return cy
- .request({
- method: 'GET',
- url: `/api/v1/dataset/?q=${encodeURIComponent(
- JSON.stringify({
- filters: [{ col: 'table_name', opr: 'eq', value: tableName }],
- }),
- )}`,
- })
- .then(response => {
- const datasets = response.body.result;
- if (datasets && datasets.length > 0) {
- return datasets[0].id;
- }
- throw new Error(`Dataset with table name "${tableName}" not found`);
- });
-}
-
-/**
- * Look up a chart ID by slice name
- */
-export function getChartId(sliceName: string): Cypress.Chainable<number> {
- return cy
- .request({
- method: 'GET',
- url: `/api/v1/chart/?q=${encodeURIComponent(
- JSON.stringify({
- filters: [{ col: 'slice_name', opr: 'eq', value: sliceName }],
- }),
- )}`,
- })
- .then(response => {
- const charts = response.body.result;
- if (charts && charts.length > 0) {
- return charts[0].id;
- }
- throw new Error(`Chart with slice name "${sliceName}" not found`);
- });
-}
-
-export function visitDashboard(createSample = true) {
- interceptCharts();
- interceptGet();
- interceptDatasets();
-
- if (createSample) {
- cy.createSampleDashboards([0]);
- }
-
- cy.visit(SAMPLE_DASHBOARD_1);
- cy.wait('@get');
- cy.wait('@getCharts');
- cy.wait('@getDatasets');
- cy.url().should('contain', 'native_filters_key');
-}
-
-export function prepareDashboardFilters(
- filters: { name: string; column: string; datasetId?: number }[],
-) {
- cy.createSampleDashboards([0]);
-
- // First, look up the dataset ID and chart ID dynamically
- getDatasetId('wb_health_population').then(datasetId => {
- getChartId('Most Populated Countries').then(chartId => {
- cy.request({
- method: 'GET',
- url: `api/v1/dashboard/1-sample-dashboard`,
- }).then(res => {
- const { body } = res;
- const dashboardId = body.result.id;
- const allFilters: Record<string, unknown>[] = [];
- filters.forEach((f, i) => {
- allFilters.push({
- id: `NATIVE_FILTER-fLH0pxFQ${i}`,
- controlValues: {
- enableEmptyFilter: false,
- defaultToFirstItem: false,
- creatable: true,
- multiSelect: true,
- searchAllOptions: false,
- inverseSelection: false,
- },
- name: f.name,
- filterType: 'filter_select',
- targets: [
- {
- datasetId: f.datasetId ?? datasetId,
- column: { name: f.column },
- },
- ],
- defaultDataMask: {
- extraFormData: {},
- filterState: {},
- ownState: {},
- },
- cascadeParentIds: [],
- scope: {
- rootPath: ['ROOT_ID'],
- excluded: [],
- },
- type: 'NATIVE_FILTER',
- description: '',
- chartsInScope: [chartId],
- tabsInScope: [],
- });
- });
- if (dashboardId) {
- const jsonMetadata = {
- native_filter_configuration: allFilters,
- chart_customization_config: [],
- timed_refresh_immune_slices: [],
- expanded_slices: {},
- expand_all_slices: false,
- refresh_frequency: 0,
- color_scheme: '',
- label_colors: {},
- shared_label_colors: [],
- color_scheme_domain: [],
- cross_filters_enabled: false,
- positions: {
- DASHBOARD_VERSION_KEY: 'v2',
- ROOT_ID: { type: 'ROOT', id: 'ROOT_ID', children: ['GRID_ID'] },
- GRID_ID: {
- type: 'GRID',
- id: 'GRID_ID',
- children: ['ROW-0rHnUz4nMA'],
- parents: ['ROOT_ID'],
- },
- HEADER_ID: {
- id: 'HEADER_ID',
- type: 'HEADER',
- meta: { text: '1 - Sample dashboard' },
- },
- 'CHART-DF6EfI55F-': {
- type: 'CHART',
- id: 'CHART-DF6EfI55F-',
- children: [],
- parents: ['ROOT_ID', 'GRID_ID', 'ROW-0rHnUz4nMA'],
- meta: {
- width: 4,
- height: 50,
- chartId,
- sliceName: 'Most Populated Countries',
- },
- },
- 'ROW-0rHnUz4nMA': {
- type: 'ROW',
- id: 'ROW-0rHnUz4nMA',
- children: ['CHART-DF6EfI55F-'],
- parents: ['ROOT_ID', 'GRID_ID'],
- meta: { background: 'BACKGROUND_TRANSPARENT' },
- },
- },
- default_filters: '{}',
- filter_scopes: {},
- chart_configuration: {},
- };
-
- return cy
- .request({
- method: 'PUT',
- url: `api/v1/dashboard/${dashboardId}`,
- body: {
- json_metadata: JSON.stringify(jsonMetadata),
- },
- })
- .then(() => visitDashboard(false));
- }
- return cy;
- });
- });
- });
-}
diff --git a/superset-frontend/cypress-base/cypress/e2e/dashboard/utils.ts
b/superset-frontend/cypress-base/cypress/e2e/dashboard/utils.ts
deleted file mode 100644
index 0e4e6938771..00000000000
--- a/superset-frontend/cypress-base/cypress/e2e/dashboard/utils.ts
+++ /dev/null
@@ -1,559 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import { dashboardView, nativeFilters } from 'cypress/support/directories';
-import {
- ChartSpec,
- setSelectSearchInput,
- waitForChartLoad,
-} from 'cypress/utils';
-
-export const WORLD_HEALTH_CHARTS = [
- { name: '% Rural', viz: 'world_map' },
- { name: 'Most Populated Countries', viz: 'table' },
- { name: "World's Population", viz: 'big_number' },
- { name: 'Growth Rate', viz: 'echarts_timeseries_line' },
- { name: 'Rural Breakdown', viz: 'sunburst_v2' },
- { name: "World's Pop Growth", viz: 'echarts_area' },
- { name: 'Life Expectancy VS Rural %', viz: 'bubble_v2' },
- { name: 'Treemap', viz: 'treemap_v2' },
- { name: 'Box plot', viz: 'box_plot' },
-] as ChartSpec[];
-
-export const SUPPORTED_TIER1_CHARTS = [
- { name: 'Big Number', viz: 'big_number_total' },
- { name: 'Big Number with Trendline', viz: 'big_number' },
- { name: 'Pie Chart', viz: 'pie' },
- { name: 'Table', viz: 'table' },
- { name: 'Pivot Table', viz: 'pivot_table_v2' },
- { name: 'Line Chart', viz: 'echarts_timeseries_line' },
- { name: 'Area Chart', viz: 'echarts_area' },
- { name: 'Scatter Chart', viz: 'echarts_timeseries_scatter' },
- { name: 'Bar Chart', viz: 'echarts_timeseries_bar' },
-] as ChartSpec[];
-
-export const SUPPORTED_TIER2_CHARTS = [
- { name: 'Box Plot Chart', viz: 'box_plot' },
- { name: 'Generic Chart', viz: 'echarts_timeseries' },
- { name: 'Smooth Line Chart', viz: 'echarts_timeseries_smooth' },
- { name: 'Step Line Chart', viz: 'echarts_timeseries_step' },
- { name: 'Funnel Chart', viz: 'funnel' },
- { name: 'Gauge Chart', viz: 'gauge_chart' },
- { name: 'Radar Chart', viz: 'radar' },
- { name: 'Treemap V2 Chart', viz: 'treemap_v2' },
- { name: 'Mixed Chart', viz: 'mixed_timeseries' },
-] as ChartSpec[];
-
-export const testItems = {
- dashboard: 'Cypress test Dashboard',
- dataset: 'Vehicle Sales',
- datasetForNativeFilter: 'wb_health_population',
- chart: 'Cypress chart',
- newChart: 'New Cypress Chart',
- createdDashboard: 'New Dashboard',
- defaultNameDashboard: '[ untitled dashboard ]',
- newDashboardTitle: `Test dashboard [NEW TEST]`,
- bulkFirstNameDashboard: 'First Dash',
- bulkSecondNameDashboard: 'Second Dash',
- worldBanksDataCopy: `World Bank's Data [copy]`,
- filterType: {
- value: 'Value',
- numerical: 'Numerical range',
- timeColumn: 'Time column',
- timeGrain: 'Time grain',
- timeRange: 'Time range',
- },
- topTenChart: {
- name: 'Most Populated Countries',
- filterColumn: 'country_name',
- filterColumnYear: 'year',
- filterColumnRegion: 'region',
- filterColumnCountryCode: 'country_code',
- },
- filterDefaultValue: 'United States',
- filterOtherCountry: 'China',
- filterTimeGrain: 'Month',
- filterTimeColumn: 'created',
- filterNumericalColumn: 'SP_RUR_TOTL_ZS',
-};
-
-export const nativeFilterTooltips = {
- searchAllFilterOptions:
- 'By default, each filter loads at most 1000 choices at the initial page
load. Check this box if you have more than 1000 filter values and want to
enable dynamically searching that loads filter values as users type (may add
stress to your database).',
- defaultToFirstItem: 'When using this option, default value can’t be set',
- inverseSelection: 'Exclude selected values',
- required: 'User must select a value before applying the filter',
- multipleSelect: 'Allow selecting multiple values',
- defaultValue:
- 'Default value must be set when "Filter value is required" is checked',
- preFilter: `Add filter clauses to control the filter's source query, though
only in the context of the autocomplete i.e., these conditions do not impact
how the filter is applied to the dashboard. This is useful when you want to
improve the query's performance by only scanning a subset of the underlying
data or limit the available values displayed in the filter.`,
-};
-
-export const nativeFilterOptions = [
- 'Filter has default value',
- 'Multiple select',
- 'Filter value is required',
- 'Filter is hierarchical',
- 'Default to first item',
- 'Inverse selection',
- 'Search all filter options',
- 'Pre-filter available values',
- 'Sort filter values',
-];
-
-export const valueNativeFilterOptions = [
- 'Pre-filter available values',
- 'Sort filter values',
- 'Filter has default value',
- 'Select first filter value by default',
- 'Can select multiple values',
- 'Dynamically search all filter values',
- 'Inverse selection',
- 'Filter value is required',
-];
-
-export function interceptGet() {
- cy.intercept('GET', '**/api/v1/dashboard/*').as('get');
-}
-
-export function interceptFiltering() {
- cy.intercept('GET', `**/api/v1/dashboard/?q=*`).as('filtering');
-}
-
-export function interceptBulkDelete() {
- cy.intercept('DELETE', `**/api/v1/dashboard/?q=*`).as('bulkDelete');
-}
-
-export function interceptDelete() {
- cy.intercept('DELETE', `**/api/v1/dashboard/*`).as('delete');
-}
-
-export function interceptUpdate() {
- cy.intercept('PUT', `**/api/v1/dashboard/*`).as('update');
-}
-
-export function interceptExploreUpdate() {
- cy.intercept('PUT', `**/api/v1/chart/*`).as('chartUpdate');
-}
-
-export function interceptPost() {
- cy.intercept('POST', `**/api/v1/dashboard/`).as('post');
-}
-
-export function interceptLog() {
- cy.intercept('**/superset/log/?explode=events&dashboard_id=*').as('logs');
-}
-
-export function interceptDataset() {
- cy.intercept('GET', `**/api/v1/dataset/*`).as('getDataset');
-}
-
-export function interceptCharts() {
- cy.intercept('GET', `**/api/v1/dashboard/*/charts`).as('getCharts');
-}
-
-export function interceptDatasets() {
- cy.intercept('GET', `**/api/v1/dashboard/*/datasets`).as('getDatasets');
-}
-
-export function interceptFilterState() {
- cy.intercept('POST', `**/api/v1/dashboard/*/filter_state*`).as(
- 'postFilterState',
- );
-}
-
-export function setFilter(filter: string, option: string) {
- interceptFiltering();
-
- cy.get(`[aria-label^="${filter}"]`).first().click();
- cy.get(`.ant-select-item-option[title="${option}"]`).first().click({
- force: true,
- });
-
- cy.wait('@filtering');
-}
-
-/** ************************************************************************
- * Expend Native filter from the left panel on dashboard
- * @returns {None}
- * @summary helper for expend native filter
- ************************************************************************* */
-export function expandFilterOnLeftPanel() {
- return cy
- .get(nativeFilters.filterFromDashboardView.expand)
- .should('be.visible')
- .click({ force: true });
-}
-
-/** ************************************************************************
- * Collapses Native Filter from the left panel on dashboard
- * @returns {None}
- * @summary helper for collapse native filter
- ************************************************************************* */
-export function collapseFilterOnLeftPanel() {
- cy.get(nativeFilters.filterFromDashboardView.collapse)
- .should('be.visible')
- .click();
- cy.get(nativeFilters.filterFromDashboardView.collapse).should(
- 'not.be.visible',
- );
-}
-
-/** ************************************************************************
- * Enter Native Filter edit modal from the left panel on dashboard
- * @returns {None}
- * @summary helper for enter native filter edit modal
- ************************************************************************* */
-export function enterNativeFilterEditModal(waitForDataset = true) {
- interceptDataset();
- cy.get(nativeFilters.filtersPanel.filterGear).click({
- force: true,
- });
- cy.get('.ant-dropdown-menu').should('be.visible');
- cy.get(nativeFilters.filterFromDashboardView.createFilterButton).click({
- force: true,
- });
- cy.get(nativeFilters.modal.container).should('be.visible');
- if (waitForDataset) {
- cy.wait('@getDataset');
- }
-}
-
-/** ************************************************************************
- * Clicks on new filter button
- * @returns {None}
- * @summary helper for adding new filter
- ************************************************************************* */
-export function clickOnAddFilterInModal() {
- cy.get('[data-test="new-item-dropdown-button"]').trigger('mouseover');
- cy.get('.ant-dropdown-menu').should('be.visible');
- cy.contains('.ant-dropdown-menu-item', 'Add filter').click();
-}
-
-/** ************************************************************************
- * Fills value native filter form with basic information
- * @param {string} type type for filter: Value, Numerical range,Time
column,Time grain,Time range
- * @param {string} name name for filter
- * @param {string} dataset which dataset should be used
- * @param {string} filterColumn which column should be used
- * @returns {None}
- * @summary helper for filling value native filter form
- ************************************************************************* */
-export function fillNativeFilterForm(
- type: string,
- name: string,
- dataset?: string,
- filterColumn?: string,
-) {
- cy.get(nativeFilters.filtersPanel.filterTypeInput).within(() => {
- cy.get('input').then($input => {
- setSelectSearchInput($input, type);
- });
- });
- cy.get(nativeFilters.modal.container)
- .find(nativeFilters.filtersPanel.filterName)
- .last()
- .click({ scrollBehavior: false });
- cy.get(nativeFilters.modal.container)
- .find(nativeFilters.filtersPanel.filterName)
- .last()
- .clear({ force: true });
- cy.get(nativeFilters.modal.container)
- .find(nativeFilters.filtersPanel.filterName)
- .last()
- .type(name, { scrollBehavior: false, force: true });
-
- if (dataset) {
- cy.get('div[aria-label="Dataset"]').within(() => {
- cy.get('input').then($input => {
- setSelectSearchInput($input, dataset, true);
- });
- });
- cy.get(nativeFilters.silentLoading).should('not.exist');
- }
-
- if (filterColumn) {
- cy.get('div[aria-label="Column select"]').within(() => {
- cy.get('input').then($input => {
- setSelectSearchInput($input, filterColumn, true);
- });
- });
- }
-}
-
-/** ************************************************************************
- * Get native filter placeholder e.g 9 options
- * @param {number} index which input it fills
- * @returns cy object for assertions
- * @summary helper for getting placeholder value
- ************************************************************************* */
-export function getNativeFilterPlaceholderWithIndex(index: number) {
- return cy.get(nativeFilters.filtersPanel.columnEmptyInput).eq(index);
-}
-
-/** ************************************************************************
- * Apply native filter value from dashboard view
- * @param {number} index which input it fills
- * @param {string} value what is filter value
- * @returns {null}
- * @summary put value to nth native filter input in view
- ************************************************************************* */
-export function applyNativeFilterValueWithIndex(index: number, value: string) {
- cy.get(nativeFilters.filterFromDashboardView.filterValueInput)
- .eq(index)
- .should('exist', { timeout: 10000 })
- .type(`${value}{enter}`, { force: true });
- // click the title to dismiss shown options
- cy.get(nativeFilters.filterFromDashboardView.filterName)
- .eq(index)
- .click({ force: true });
-}
-
-/** ************************************************************************
- * Fills parent filter input
- * @param {number} index which input it fills
- * @param {string} value on which filter it depends on
- * @returns {null}
- * @summary takes first or second input and modify the depends on filter value
- ************************************************************************* */
-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"]')
- .eq(index)
- .type(`${value}{enter}`, { delay: 30, force: true });
- });
-}
-
-/** ************************************************************************
- * Save Native Filter Settings
- * @returns {None}
- * @summary helper for save native filters settings
- ************************************************************************* */
-export function saveNativeFilterSettings(charts: ChartSpec[]) {
- cy.get(nativeFilters.modal.footer)
- .contains('Save')
- .should('be.visible')
- .click({ force: true });
-
- // Wait for modal to either close or remain open
- cy.get('body').should($body => {
- const modalExists = $body.find(nativeFilters.modal.container).length > 0;
- if (modalExists) {
- cy.get(nativeFilters.modal.footer)
- .contains('Save')
- .should('be.visible')
- .click({ force: true });
- }
- });
-
- // Ensure modal is closed
- cy.get(nativeFilters.modal.container).should('not.exist');
-
- // Wait for all charts to load
- charts.forEach(chart => {
- waitForChartLoad(chart);
- });
-}
-
-/** ************************************************************************
- * Cancel Native filter settings
- * @returns {None}
- * @summary helper for cancel native filters settings
- ************************************************************************* */
-export function cancelNativeFilterSettings() {
- cy.get(nativeFilters.modal.footer)
- .find(nativeFilters.modal.cancelButton)
- .should('be.visible')
- .click();
- cy.get(nativeFilters.modal.alertXUnsavedFilters)
- .should('be.visible')
- .should('have.text', 'There are unsaved changes.');
- cy.get(nativeFilters.modal.footer)
- .find(nativeFilters.modal.confirmCancelButton)
- .contains('cancel')
- .click({ force: true });
- cy.get(nativeFilters.modal.container).should('not.exist');
-}
-
-/** ************************************************************************
- * Validate filter name on dashboard
- * @param name: filter name to validate
- * @return {null}
- * @summary helper for validate filter name on dashboard
- ************************************************************************* */
-export function validateFilterNameOnDashboard(name: string) {
- cy.get(nativeFilters.filterFromDashboardView.filterName)
- .should('be.visible', { timeout: 40000 })
- .contains(`${name}`);
-}
-
-/** ************************************************************************
- * Validate filter content on dashboard
- * @param filterContent: filter content to validate
- * @return {null}
- * @summary helper for validate filter content on dashboard
- ************************************************************************* */
-export function validateFilterContentOnDashboard(filterContent: string) {
- cy.get(nativeFilters.filterFromDashboardView.filterContent)
- .contains(`${filterContent}`)
- .should('be.visible');
-}
-
-/** ************************************************************************
- * Delete Native filter
- * @return {null}
- * @summary helper for delete native filter
- ************************************************************************* */
-export function deleteNativeFilter() {
- cy.get(nativeFilters.filtersList.removeIcon).first().click();
-}
-
-/** ************************************************************************
- * Undo delete Native filter
- * @return {null}
- * @summary helper for undo delete native filter
- ************************************************************************ */
-export function undoDeleteNativeFilter() {
- deleteNativeFilter();
- cy.contains('Undo?').click();
-}
-
-/** ************************************************************************
- * Check Native Filter tooltip content
- * @param index: tooltip index to check
- * @param value: tooltip value to check
- * @return {null}
- * @summary helper for checking native filter tooltip content by index
- ************************************************************************* */
-export function checkNativeFilterTooltip(index: number, value: string) {
- cy.get(nativeFilters.filterConfigurationSections.infoTooltip)
- .eq(index)
- .trigger('mouseover');
- cy.contains(`${value}`).should('be.visible');
- cy.wait(100);
- cy.get(nativeFilters.filterConfigurationSections.infoTooltip)
- .eq(index)
- .trigger('mouseout');
- cy.get('body').trigger('mousemove', { clientX: 0, clientY: 0 });
- cy.wait(500);
-}
-
-/** ************************************************************************
- * Apply advanced time range filter on dashboard
- * @param startRange: starting time range
- * @param endRange: ending time range
- * @return {null}
- * @summary helper for applying advanced time range filter on dashboard with
customize time range
- ************************************************************************* */
-export function applyAdvancedTimeRangeFilterOnDashboard(
- startRange?: string,
- endRange?: string,
-) {
- cy.get('.control-label').contains('Range type').should('be.visible');
- cy.get('.ant-popover-content .ant-select-content')
- .should('be.visible')
- .click();
- cy.get(`[label="Advanced"]`).should('be.visible').click();
- cy.get('.section-title').contains('Advanced Time
Range').should('be.visible');
- if (startRange) {
- cy.get('.ant-popover-content')
- .find('[class^=ant-input]')
- .first()
- .type(`${startRange}`);
- }
- if (endRange) {
- cy.get('.ant-popover-content')
- .find('[class^=ant-input]')
- .last()
- .type(`${endRange}`);
- }
- cy.get(dashboardView.timeRangeModal.applyButton).click();
- cy.get(nativeFilters.applyFilter).click();
-}
-
-/** ************************************************************************
- * Input default value in Native filter in filter settings
- * @param defaultValue: default value for native filter
- * @return {null}
- * @summary helper for input default value in Native filter in filter settings
- ************************************************************************* */
-export function inputNativeFilterDefaultValue(
- defaultValue: string,
- multiple = false,
-) {
- if (!multiple) {
- cy.contains('Filter has default value').click();
- cy.contains('Please choose a valid value').should('be.visible');
- cy.get(nativeFilters.modal.container).within(() => {
- cy.get(
- nativeFilters.filterConfigurationSections.filterPlaceholder,
- ).contains('options');
- cy.get(
- nativeFilters.filterConfigurationSections.collapsedSectionContainer,
- )
- .eq(1)
- .within(() => {
- cy.get('.ant-select-input').type(`${defaultValue}{enter}`, {
- force: true,
- });
- });
- });
- } else {
- cy.getBySel('default-input').within(() => {
- cy.get('.ant-select-input').click();
- cy.get('.ant-select-item-option-content').contains(defaultValue).click();
- });
- }
-}
-
-/** ************************************************************************
- * add filter for test column 'Country name'
- * @return {null}
- * @summary helper for add filter for test column 'Country name'
- ************************************************************************* */
-export function addCountryNameFilter() {
- fillNativeFilterForm(
- testItems.filterType.value,
- testItems.topTenChart.filterColumn,
- testItems.datasetForNativeFilter,
- testItems.topTenChart.filterColumn,
- );
-}
-
-export function openTab(
- tabComponentIndex: number,
- tabIndex: number,
- target = 'dashboard-component-tabs',
-) {
- cy.getBySel(target)
- .eq(tabComponentIndex)
- .find('[role="tab"]')
- .eq(tabIndex)
- .click();
- cy.wait(500);
-}
-
-export const openTopLevelTab = (tabName: string) => {
- cy.get("div#TABS-TOP div[role='tab']").contains(tabName).click();
-};
diff --git a/superset-frontend/cypress-base/cypress/e2e/explore/chart.test.js
b/superset-frontend/cypress-base/cypress/e2e/explore/chart.test.js
index 59e28ed6b28..16cac29a07d 100644
--- a/superset-frontend/cypress-base/cypress/e2e/explore/chart.test.js
+++ b/superset-frontend/cypress-base/cypress/e2e/explore/chart.test.js
@@ -17,9 +17,9 @@
* under the License.
*/
import { CHART_LIST } from 'cypress/utils/urls';
-import { interceptGet as interceptDashboardGet } from
'cypress/e2e/dashboard/utils';
import { FORM_DATA_DEFAULTS, NUM_METRIC } from
'./visualizations/shared.helper';
import {
+ interceptDashboardGet,
interceptFiltering,
interceptV1ChartData,
saveChartToDashboard,
diff --git a/superset-frontend/cypress-base/cypress/e2e/explore/utils.ts
b/superset-frontend/cypress-base/cypress/e2e/explore/utils.ts
index cbda84749b9..36884392c02 100644
--- a/superset-frontend/cypress-base/cypress/e2e/explore/utils.ts
+++ b/superset-frontend/cypress-base/cypress/e2e/explore/utils.ts
@@ -17,7 +17,9 @@
* under the License.
*/
-import { interceptGet as interceptDashboardGet } from '../dashboard/utils';
+export function interceptDashboardGet() {
+ cy.intercept('GET', '**/api/v1/dashboard/*').as('get');
+}
export function interceptFiltering() {
cy.intercept('GET', `**/api/v1/chart/?q=*`).as('filtering');
diff --git a/superset-frontend/cypress-base/cypress/support/directories.ts
b/superset-frontend/cypress-base/cypress/support/directories.ts
deleted file mode 100644
index 52933f23790..00000000000
--- a/superset-frontend/cypress-base/cypress/support/directories.ts
+++ /dev/null
@@ -1,678 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-const dataTestLocator = (value: string) => `[data-test='${value}']`;
-
-export function dataTestChartName(chartName: string): string {
- return `[data-test-chart-name='${chartName}']`;
-}
-
-export const pageHeader = {
- logo: '.navbar-brand > img',
- headerNavigationItem: '.ant-menu-submenu-title',
- headerNavigationDropdown: "[aria-label='triangle-down']",
- headerNavigationItemMenu: '.ant-menu-item-group-list',
- plusIcon: ':nth-child(2) > .ant-menu-submenu-title',
- plusIconMenuOptions: {
- sqlQueryOption: dataTestLocator('menu-item-SQL query'),
- chartOption: dataTestLocator('menu-item-Chart'),
- dashboardOption: dataTestLocator('menu-item-Dashboard'),
- },
- plusMenu: '.ant-menu-submenu-popup',
- barButtons: '[role="presentation"]',
- sqlLabMenu: '[id="item_3$Menu"]',
- dataMenu: '[id="item_4$Menu"]',
-};
-
-export const profile = {
- activeTab: '.ant-tabs-tab-active',
- inactiveTab: '.ant-tabs-tab',
- emptyFavoritedPlaceholder: '.ant-empty-normal',
- tableRow: '.table-row',
- favoritesSpace: '#rc-tabs-0-panel-2',
-};
-export const securityAccess = {
- rolesBubble: '.ant-badge-count',
-};
-export const homePage = {
- homeSection: {
- sectionArea: '.ant-collapse-body',
- sectionElement: '.ant-card-meta-title',
- },
- sections: {
- expandedSection: '.ant-collapse-item-active',
- expandedSectionHeader: '[aria-expanded="true"]',
- collapseExpandButton: '.ant-collapse-arrow',
- collapsedSection: '[class="ant-collapse-item"]',
- collapsedSectionHeader: '[aria-expanded="false"]',
- section: '[class^="ant-collapse-item"]',
- sectionsMenuContainer: "[role='navigation']",
- sectionsMenuItem: "[role='menuitem']",
- card: dataTestLocator('styled-card'),
- },
- thumbnailsSection: {
- container: "[class='switch']",
- toggle: "[role ='switch']",
- },
-};
-export const databasesPage = {
- addDatabaseButton: dataTestLocator('btn-create-database'),
- searchInput: dataTestLocator('search-input'),
- table: {
- tableRow: dataTestLocator('table-row'),
- tableCell: dataTestLocator('table-row-cell'),
- editButton: dataTestLocator('edit-alt'),
- },
- modal: {
- header: '#rcDialogTitle0 > h4',
- step: '.helper-top',
- selectDbStepTitle: '.select-db > h4',
- preferredBlockBigQuery: '.preferred > :nth-child(1)',
- preferredBlockPostgreSQL: '.preferred > :nth-child(2)',
- preferredBlockSnowflake: '.preferred > :nth-child(3)',
- preferredBlockMySQL: '.preferred > :nth-child(4)',
- preferredBlockAthena: '.preferred > :nth-child(5)',
- preferredBlockSheets: '.preferred > :nth-child(6)',
- supportedDatabasesText: '.control-label',
- orChoose: '.available-label',
- dbDropdown: '.ant-select-input',
- dbDropdownMenu: '.rc-virtual-list-holder-inner',
- dbDropdownMenuItem: '[class="ant-select-item-option-content"]',
- infoAlert: '.ant-alert',
- serviceAccountInput: '[name="credentials_info"]',
- connectionStep: {
- modal: '.ant-modal-container',
- modalBody: '.ant-modal-body',
- stepTitle: '.css-7x6kk > h4',
- helperBottom: '.helper-bottom',
- postgresDatabase: '[name="database"]',
- dbInput: '[name="database_name"]',
- alertMessage: '.ant-alert-message',
- errorField: '[role="alert"]',
- uploadJson: '[title="Upload JSON file"]',
- chooseFile: '[class="ant-btn input-upload-btn"]',
- additionalParameters: '[name="query_input"]',
- sqlAlchemyUriInput: dataTestLocator('sqlalchemy-uri-input'),
- advancedTab: '#rc-tabs-0-tab-2',
- activeTab: '.ant-tabs-tab-active',
- securitySubMenu:
- ':nth-child(3) > .ant-collapse-header > .anticon > svg > path',
- aceTextInput: '.ace_text-input',
- aceContent: '.ace_content',
- connectButton: '.css-16i3wh7',
- hostInput: '[name="host"]',
- portInput: '[name="port"]',
- usernameInput: '[name="username"]',
- passwordInput: '[name="password"]',
- switch: '.ant-switch',
- },
- },
-};
-
-export const sqlLabView = {
- sqlEditorLeftBar: {
- sqlEditorLeftBar: '[data-test="sql-editor-left-bar"]',
- databaseSchemaTableSection:
- '[data-test="sql-editor-left-bar"] > :nth-child(1)',
- tableSchemaSection:
- '[data-test="sql-editor-left-bar"] > :nth-child(1) > :nth-child(3) >
:nth-child(1)',
- tableSchemaInputEmpty: '[aria-label="Select table or type table name"]',
- },
- databaseInput: '[data-test=DatabaseSelector] > :nth-child(1)',
- emptyMenuOptionsPlaceholder: '[class="ant-empty-img-simple"]',
- removeTabButton: '.ant-tabs-tab-remove > .anticon > svg',
- tabsNavList: "[class='ant-tabs-nav-list']",
- tab: "[class='ant-tabs-tab-btn']",
- addTabButton: dataTestLocator('add-tab-icon'),
- tooltip: '.ant-tooltip-content',
- tabName: '.css-1suejie',
- schemaInput: '[data-test=DatabaseSelector] > :nth-child(2)',
- loadingIndicator: '.Select__loading-indicator',
- menuItem: '[class="ant-select-item-option-content"]',
- examplesMenuItem: '[title="examples"]',
- tableInput: ':nth-child(4) > .select > :nth-child(1)',
- sqlEditor: '#brace-editor textarea',
- saveAsButton: '.SaveQuery > .ant-btn',
- saveAsModal: {
- footer: '.ant-modal-footer',
- queryNameInput: 'input[class^="ant-input"]',
- },
- sqlToolbar: {
- toolbar: '#js-sql-toolbar',
- runButton: '.css-d3dxop',
- },
- rowsLimit: {
- dropdown: '.ant-dropdown-menu',
- limitButton: '.ant-dropdown-menu-item',
- limitButtonText: '.css-151uxnz',
- limitTextWithValue: '[class="ant-dropdown-trigger"]',
- },
- renderedTableHeader: '.ReactVirtualized__Table__headerRow',
- renderedTableRow: '.ReactVirtualized__Table__row',
- errorBody: '.error-body',
- alertMessage: '.ant-alert-message',
- historyTable: {
- header: '[role=columnheader]',
- table: '.QueryTable',
- row: dataTestLocator('table-row'),
- failureMarkIcon: '[aria-label=close]',
- successMarkIcon: '[aria-label=check]',
- },
-};
-export const queryHistory = {
- tableHeader: dataTestLocator('sort-header'),
- row: dataTestLocator('table-row'),
- cell: dataTestLocator('table-row-cell'),
- action: '[aria-label=full]',
-};
-export const savedQuery = {
- tableHeader: dataTestLocator('sort-header'),
- row: dataTestLocator('table-row'),
- cell: dataTestLocator('table-row-cell'),
- trash: dataTestLocator('delete-action'),
- deleteQueryIcon: '[data-test="delete-action"]',
- deleteModal: {
- deleteInput: dataTestLocator('delete-modal-input'),
- deleteButton: dataTestLocator('modal-confirm-button'),
- },
-};
-export const annotationLayersView = {
- emptyDescription: {
- description: '.ant-empty-description',
- addAnnotationLayerButton: '.ant-empty-footer > .ant-btn',
- },
- modal: {
- content: {
- content: '.ant-modal-body',
- title: '.ant-modal-body > :nth-child(2) > input',
- description: "[name='descr']",
- },
- footer: {
- footer: '.ant-modal-footer',
- addButton: dataTestLocator('modal-confirm-button'),
- cancelButton: dataTestLocator('modal-cancel-button'),
- },
- },
-};
-export const datasetsList = {
- newDatasetButton: '.css-yff34v',
- searchInput: dataTestLocator('filters-search'),
- newDatasetModal: {
- inputField: '[class="section"]',
- addButton: dataTestLocator('modal-confirm-button'),
- body: '.ant-modal-body',
- },
- table: {
- tableRow: {
- row: dataTestLocator('table-row'),
- rowText: dataTestLocator('cell-text'),
- rowCell: dataTestLocator('table-row-cell'),
- },
- tableRowHeader: {
- header: dataTestLocator('sort-header'),
- unsorted: '[aria-label="sort"]',
- sortAsc: '[aria-label="sort-asc"]',
- sortDesc: '[aria-label="sort-desc"]',
- },
- rowActionItems: dataTestLocator('table-row-cell'),
- actionButton: '.action-button',
- editButton: '[aria-label="edit-alt"]',
- },
- editDatasetModal: {
- modal: dataTestLocator('edit-dataset-tabs'),
- sourceNavigationTab: '#table-tabs-tab-0',
- metricsNavigationTab: dataTestLocator('collection-tab-Metrics'),
- columnsNavigationTab: dataTestLocator('collection-tab-Columns'),
- calculatedColumnsNavigationTab: dataTestLocator(
- 'collection-tab-Calculated columns',
- ),
- settingsNavigationTab: '#table-tabs-tab-4',
- saveButton: dataTestLocator('datasource-modal-save'),
- sourceContent: '#table-tabs-panel-0',
- metricsContent: '#table-tabs-panel-1',
- columnsContent: '#table-tabs-panel-2',
- calculatedColumnsContent: '#table-tabs-panel-3',
- settingsContent: '#table-tabs-panel-4',
- aceTextInput: '.ace_text-input',
- sourceSQLInput: '.ace_content',
- sourceVirtualSQLRadio: ':nth-child(2) > .ant-radio > .ant-radio-inner',
- sourcePadlock: '[aria-label=lock]',
- legacy: {
- panel: '.panel-body',
- sqlInput: '#sql',
- save: '.well > .btn-primary',
- description: '#description',
- },
- },
- deleteDatasetModal: {
- modal: '.ant-modal-container',
- deleteInput: dataTestLocator('delete-modal-input'),
- deleteButton: dataTestLocator('modal-confirm-button'),
- text: '.css-kxmt87',
- },
-};
-export const chartListView = {
- filtersBar: {
- searchField: dataTestLocator('filters-search'),
- },
- top: {
- bulkSelect: dataTestLocator('bulk-select'),
- },
- header: {
- cardView: '[aria-label="card-view"]',
- listView: '[aria-label="list-view"]',
- sort: '.ant-select-input[aria-label="Sort"]',
- sortRecentlyModifiedMenuOption: '[label="Recently modified"]',
- sortAlphabeticalMenuOption: '[label="Alphabetical"]',
- sortDropdown: '.Select__menu',
- },
- card: {
- card: dataTestLocator('styled-card'),
- cardCover: '[class="ant-card-cover"]',
- cardImage: '[class="gradient-container"]',
- starIcon: dataTestLocator('fave-unfave-icon'),
- },
- deleteModal: {
- deleteInput: dataTestLocator('delete-modal-input'),
- deleteButton: dataTestLocator('modal-confirm-button'),
- },
- table: {
- bulkSelect: {
- checkboxOff: 'input[type="checkbox"]:checked',
- checkboxOn: 'input[type="checkbox"]:not(:checked)',
- action: dataTestLocator('bulk-select-action'),
- },
- tableList: dataTestLocator('listview-table'),
- table: '[role="rowgroup"]',
- tableRowHeader: {
- header: dataTestLocator('sort-header'),
- unsorted: '[aria-label="sort"]',
- sortAsc: '[aria-label="sort-asc"]',
- sortDesc: '[aria-label="sort-desc"]',
- },
- tableRow: {
- row: dataTestLocator('table-row'),
- rowText: dataTestLocator('cell-text'),
- rowCell: dataTestLocator('table-row-cell'),
- },
- },
- addChartButton: '.css-yff34v',
-};
-export const nativeFilters = {
- modal: {
- container: '.ant-modal',
- footer: '.ant-modal-footer',
- saveButton: dataTestLocator('native-filter-modal-save-button'),
- cancelButton: dataTestLocator('native-filter-modal-cancel-button'),
- confirmCancelButton: dataTestLocator(
- 'native-filter-modal-confirm-cancel-button',
- ),
- alertXUnsavedFilters: '.ant-alert-message',
- tabsList: {
- filterItemsContainer: dataTestLocator('filter-title-container'),
- tabsContainer: '[class="ant-tabs-nav-list"]',
- tab: '.ant-tabs-tab',
- removeTab: '[aria-label="delete"]',
- },
- addFilter: dataTestLocator('add-filter-button'),
- defaultValueCheck: '.ant-checkbox-checked',
- addNewFilterButton: dataTestLocator('add-new-filter-button'),
- addNewDividerButton: dataTestLocator('add-new-divider-button'),
- },
- filtersPanel: {
- filterName: dataTestLocator('filters-config-modal__name-input'),
- datasetName: dataTestLocator('filters-config-modal__datasource-input'),
- filterInfoInput: '.ant-select-input',
- inputDropdown: '.ant-select-item-option-content',
- columnEmptyInput: '.ant-select-placeholder',
- filterTypeInput: dataTestLocator('filters-config-modal__filter-type'),
- fieldInput: dataTestLocator('field-input'),
- filterTypeItem: '.ant-select-content-has-value,
.ant-select-selection-item',
- filterGear: dataTestLocator('filterbar-orientation-icon'),
- },
- filterFromDashboardView: {
- filterValueInput: '.ant-select-input',
- expand: dataTestLocator('filter-bar__expand-button'),
- collapse: dataTestLocator('filter-bar__collapse-button'),
- filterName: dataTestLocator('filter-control-name'),
- filterContent: '.ant-select-content-has-value, .ant-select-selection-item',
- createFilterButton: dataTestLocator('filter-bar__create-filter'),
- timeRangeFilterContent: dataTestLocator('time-range-trigger'),
- },
- createFilterButton: dataTestLocator('filter-bar__create-filter'),
- removeFilter: '[aria-label="remove"]',
- silentLoading: '.loading inline-centered css-101mkpk',
- filterConfigurationSections: {
- sectionHeader: '.ant-collapse-header',
- displayedSection: 'div[style="height: 100%; overflow-y: auto;"]',
- collapseExpandButton: '.ant-collapse-arrow',
- checkedCheckbox: '.ant-checkbox-wrapper-checked',
- infoTooltip: '[aria-label="Show info tooltip"]',
- parentFilterInput: dataTestLocator('parent-filter-input'),
- filterPlaceholder: '.ant-select-placeholder',
- collapsedSectionContainer: '[class="ant-collapse-body"]',
- },
- filtersList: {
- list: '.ant-tabs-nav-list',
- listItemNotActive: '[class="ant-tabs-tab ant-tabs-tab-with-remove"]',
- listItemActive:
- '[class="ant-tabs-tab ant-tabs-tab-with-remove ant-tabs-tab-active"]',
- removeIcon: '[aria-label="delete"]',
- },
- filterItem: dataTestLocator('form-item-value'),
- filterItemDropdown: '.ant-select-input',
- applyFilter: dataTestLocator('filter-bar__apply-button'),
- defaultInput: dataTestLocator('default-input'),
- filterIcon: dataTestLocator('filter-icon'),
- slider: {
- slider: '[class="ant-slider"]',
- startHandle: '[class="ant-slider-handle ant-slider-handle-1"]',
- endHandle: '[class="ant-slider-handle ant-slider-handle-2"]',
- sliderText: '[class="ant-slider-mark-text ant-slider-mark-text-active"]',
- },
-};
-export const dashboardListView = {
- dashboardListView: dataTestLocator('dashboard-list-view'),
- editItemAction: dataTestLocator('edit-alt'),
- filtersBar: {
- searchField: dataTestLocator('filters-search'),
- },
- top: {
- bulkSelect: dataTestLocator('bulk-select'),
- },
- card: {
- card: dataTestLocator('styled-card'),
- cardCover: '[class="ant-card-cover"]',
- cardImage: '[class="gradient-container"]',
- selectedStarIcon: "[aria-label='star']",
- unselectedStarIcon: "[aria-label='star']",
- starIcon: dataTestLocator('fave-unfave-icon'),
- },
- deleteModal: {
- deleteInput: dataTestLocator('delete-modal-input'),
- deleteButton: dataTestLocator('modal-confirm-button'),
- },
- table: {
- starIcon: dataTestLocator('fave-unfave-icon'),
- selectedStarIcon: "[aria-label='star']",
- unselectedStarIcon: "[aria-label='star']",
- bulkSelect: {
- checkboxOff: '[aria-label="checkbox-off"]',
- checkboxOn: '[aria-label="checkbox-on"]',
- action: dataTestLocator('bulk-select-action'),
- },
- tableRow: {
- sortHeader: dataTestLocator('sort-header'),
- row: dataTestLocator('table-row'),
- rowText: dataTestLocator('cell-text'),
- rowCell: dataTestLocator('table-row-cell'),
- },
- tableRowList: '[role="rowgroup"]',
- tableList: dataTestLocator('listview-table'),
- trashIcon: dataTestLocator('dashboard-list-trash-icon'),
- },
- actions: {
- importButton: dataTestLocator('import-button'),
- newDashboardButton: '.css-yff34v',
- },
- importModal: {
- selectFileButton: '.ant-upload > .ant-btn > span',
- importButton: dataTestLocator('modal-confirm-button'),
- },
- header: {
- cardView: '[aria-label="appstore"]',
- listView: '[aria-label="unordered-list"]',
- sort: dataTestLocator('sort-header'),
- sortDropdown: '.Select__menu',
- statusFilterInput: `${dataTestLocator(
- 'filters-select',
- )}[aria-label='Status']`,
- ownerFilterInput: `${dataTestLocator(
- 'filters-select',
- )}[aria-label='Owner']`,
- createdByFilterInput: `${dataTestLocator(
- 'filters-select',
- )}[aria-label='Created by']`,
- FavoriteFilterInput: `${dataTestLocator(
- 'filters-select',
- )}[aria-label='Favorite']`,
- searchFilterInput: `${dataTestLocator(
- 'filters-search',
- )}[name='dashboard_title']`,
- draftStatusFilterOption: "[title='Draft']",
- },
-};
-export const exploreView = {
- openDatasourceMenu: dataTestLocator('open-datasource-tab'),
- sectionsHeader: '.ant-collapse-header',
- datasourceMenuThreeDots: dataTestLocator('datasource-menu-trigger'),
- threeDotsMenuDropdown: {
- editDataset: dataTestLocator('edit-dataset'),
- },
- chartContainer: dataTestLocator('chart-container'),
- chartHeading: {
- queryMenu: '#query',
- viewQueryButton: dataTestLocator('view-query-menu-item'),
- shortLinkButton: dataTestLocator('short-link-button'),
- embedCodeButton: dataTestLocator('embed-code-button'),
- },
- chartAreaItem: '.nv-legend-text',
- viewQueryModal: {
- container: '.ant-modal-container',
- closeButton: 'button.ant-modal-close',
- },
- embedCodeModal: {
- container: dataTestLocator('embed-code-popover'),
- textfield: dataTestLocator('embed-code-textarea'),
- },
- saveModal: {
- modal: '.ant-modal-container',
- chartNameInput: dataTestLocator('new-chart-name'),
- dashboardNameInput: '.ant-select-input',
- addToDashboardInput: dataTestLocator(
- 'save-chart-modal-select-dashboard-form',
- ),
- saveButton: dataTestLocator('btn-modal-save'),
- saveAsCircle: dataTestLocator('saveas-radio'),
- overwriteCircle: dataTestLocator('save-overwrite-radio'),
- saveAndGoToDashboard: '#btn_modal_save_goto_dash',
- },
- controlPanel: {
- panel: dataTestLocator('control-tabs'),
- categoryArea: '.ant-collapse-body',
- dragField: dataTestLocator('datasource'),
- metricsField: dataTestLocator('metrics'),
- optionField: dataTestLocator('option-label'),
- fieldInput: '.Select__control input',
- removeFieldValue: dataTestLocator('remove-control-button'),
- addFieldValue: '[aria-label="plus"]',
- vizType: dataTestLocator('visualization-type'),
- runButton: dataTestLocator('run-query-button'),
- saveQuery: dataTestLocator('query-save-button'),
- fieldValue: dataTestLocator('control-label'),
- addMetricModal: {
- container: dataTestLocator('metrics-edit-popover'),
- metricNameEdit: {
- editButton: dataTestLocator('AdhocMetricEditTitle#trigger'),
- input: dataTestLocator('AdhocMetricEditTitle#input'),
- },
- simpleTab: {
- tab: '#adhoc-metric-edit-tabs-tab-SIMPLE',
- columnInput: '[name="select-column"]',
- aggregateInput: '[name="select-aggregate"]',
- },
- customSQLTab: {
- tab: '#adhoc-metric-edit-tabs-tab-SQL',
- inputContainerField: '.ace_content',
- input: '.ace_text-input',
- },
- saveButton: dataTestLocator('AdhocMetricEdit#save'),
- },
- querySection: {
- groupByField: dataTestLocator('groupby'),
- filtersField: dataTestLocator('adhoc_filters'),
- filterValue: dataTestLocator('adhoc-filter-simple-value'),
- filterModal: {
- customSQL: {
- tab: '#adhoc-filter-edit-tabs-tab-SQL',
- inputArea: '.ace_content',
- input: '.ace_text-input',
- },
- simple: {
- tab: '#adhoc-filter-edit-tabs-tab-SIMPLE',
- },
- container: dataTestLocator('filter-edit-popover'),
- saveButton: dataTestLocator('adhoc-filter-edit-popover-save-button'),
- },
- },
- annotationLayerSection: {
- addAnnotationLayer: dataTestLocator('annotation_layers'),
- addAnnotationLayerModal: {
- container: dataTestLocator('popover-content'),
- name: dataTestLocator('annotation-layer-name-header'),
- formula: dataTestLocator('annotation-layer-value-header'),
- input: dataTestLocator(''),
- },
- },
- timeSection: {
- timeRangeFilter: dataTestLocator('time-range-trigger'),
- timeRangeFilterModal: {
- container: '.ant-popover-content',
- footer: '.footer',
- cancelButton: dataTestLocator('cancel-button'),
- configureLastTimeRange: {
- container: '.ant-radio-group',
- checkedItem: '.ant-radio-checked + span',
- },
- configureCustomTimeRange: {
- container: dataTestLocator('custom-frame'),
- timeInput: '.ant-input-number-input-wrap > input',
- },
- configureNoFilterTimeRange: {
- container: dataTestLocator('no-filter'),
- },
- },
- },
- advancedAnalyticsSection: {
- timeShift: {
- container: dataTestLocator('time_compare'),
- input: 'input[type=text]',
- selectedValues: '.Select__multi-value__label',
- },
- },
- },
- editDatasetModal: {
- container: '.ant-modal-container',
- datasetTabsContainer: dataTestLocator('edit-dataset-tabs'),
- saveButton: dataTestLocator('datasource-modal-save'),
- metricsTab: {
- addItem: dataTestLocator('crud-add-table-item'),
- rowsContainer: '.ant-table-body',
- },
- confirmModal: {
- okButton: '.ant-modal-confirm-btns .ant-btn-primary',
- },
- },
- visualizationTypeModal: {
- vizTypeButton: dataTestLocator('viztype-selector-container'),
- },
-};
-export const createChartView = {
- chooseDatasetInput: '.ant-select-input',
- chooseDatasetOption: '.ant-select-item-option-content',
- chooseDatasetList: '.rc-virtual-list-holder-inner',
- tableVizType: "[alt='Table']",
-};
-export const editDashboardView = {
- dashboardName: dataTestLocator('dashboard-title-input'),
- dashboardEditingContainer: dataTestLocator('dashboard-content'),
- editComponent: dataTestLocator('new-component'),
- discardChanges: dataTestLocator('discard-changes-button'),
- chartBox: dataTestLocator('chart-grid-component'),
- tabsList: {
- tabsContainer: '[class="ant-tabs-nav-list"]',
- tab: '.ant-tabs-tab',
- },
-};
-export const dashboardView = {
- dashboardContainer: dataTestLocator('grid-container'),
- dashboardAlert: {
- modal: dataTestLocator('toast-container'),
- closeButton: dataTestLocator('close-button'),
- },
- saveModal: {
- modal: '.ant-modal-container',
- dashboardNameInput: '.ant-input',
- saveButton: dataTestLocator('modal-save-dashboard-button'),
- },
- dashboardProperties: {
- modal: '.ant-modal-container',
- dashboardTitleInput: dataTestLocator('dashboard-title-input'),
- modalButton: '[type="button"]',
- },
- chart: {
- trashIcon: dataTestLocator('dashboard-delete-component-button'),
- refreshChart: dataTestLocator('refresh-chart-menu-item'),
- },
- threeDotsMenuIcon:
- '.header-with-actions .right-button-panel .ant-dropdown-trigger',
- threeDotsMenuDropdown: dataTestLocator('header-actions-menu'),
- refreshDashboard: dataTestLocator('refresh-dashboard-menu-item'),
- saveAsMenuOption: dataTestLocator('save-as-menu-item'),
- dashboardTab: dataTestLocator('dragdroppable-object'),
- salesDashboardSpecific: {
- vehicleSalesFilterTimeRange: dataTestLocator('time-range-trigger'),
- secondTabSalesDashboard: dataTestLocator('dragdroppable-object'),
- },
- timeRangeModal: {
- rangeTypeField: '.ant-select-content-has-value,
.ant-select-selection-item',
- startTimeInputNumber: '.ant-input-number-input',
- datePicker: '.ant-picker-input',
- applyButton: dataTestLocator('date-filter-control__apply-button'),
- radioGroup: '.ant-radio-group',
- radioButton: '.ant-radio',
- finalFilterRangePreviewCustom:
- '.css-c2bup7 > :nth-child(6) > :nth-child(2)',
- finalFilterRangePreviewLast: '.css-c2bup7 > :nth-child(7) > :nth-child(2)',
- finalFilterRangePreviewPrevious:
- '.css-c2bup7 > :nth-child(7) > :nth-child(2)',
- },
- treeMapChartModal: {
- selectItem: '.Select_control',
- selectItemInput: '.Select__control input[type=text]',
- applyButton: '.filter button:not(:disabled)',
- clearItemIcon: '.Select__clear-indicator',
- },
- sliceThreeDots: '[aria-label="More Options"]',
- sliceThreeDotsDropdown: '[role="menu"]',
- editDashboardButton: '[aria-label="Edit dashboard"]',
- starIcon: dataTestLocator('fave-unfave-icon'),
- dashboardHeader: dataTestLocator('dashboard-header'),
- dashboardSectionContainer: dataTestLocator(
- 'grid-row-background--transparent',
- ),
- markdownEditor: dataTestLocator('dashboard-markdown-editor'),
- dashboardComponent: dataTestLocator('dashboard-component-chart-holder'),
- tabsList: {
- tabsContainer: dataTestLocator('dashboard-component-tabs'),
- tabsNavList: dataTestLocator('nav-list'),
- tabs: '.ant-tabs-nav-list',
- tab: '.ant-tabs-tab',
- },
-};
diff --git a/superset-frontend/cypress-base/cypress/utils/urls.ts
b/superset-frontend/cypress-base/cypress/utils/urls.ts
index ce8eecaa992..f82ea23fcc6 100644
--- a/superset-frontend/cypress-base/cypress/utils/urls.ts
+++ b/superset-frontend/cypress-base/cypress/utils/urls.ts
@@ -20,7 +20,5 @@
export const DASHBOARD_LIST = '/dashboard/list/';
export const CHART_LIST = '/chart/list/';
export const WORLD_HEALTH_DASHBOARD = '/dashboard/world_health/';
-export const SAMPLE_DASHBOARD_1 = '/dashboard/1-sample-dashboard/';
-export const SUPPORTED_CHARTS_DASHBOARD = '/dashboard/supported_charts_dash/';
export const TABBED_DASHBOARD = '/dashboard/tabbed_dash/';
export const DATABASE_LIST = '/databaseview/list';
diff --git
a/superset-frontend/playwright/tests/dashboard/dashboard-drill-to-detail.spec.ts
b/superset-frontend/playwright/tests/dashboard/dashboard-drill-to-detail.spec.ts
index 4c48b5ecb33..e71490f8295 100644
---
a/superset-frontend/playwright/tests/dashboard/dashboard-drill-to-detail.spec.ts
+++
b/superset-frontend/playwright/tests/dashboard/dashboard-drill-to-detail.spec.ts
@@ -18,9 +18,6 @@
*/
/**
- * E2E migration of the Cypress "Drill to detail modal" suite
- * (dashboard/drilltodetail.test.ts).
- *
* Drill to detail lets a viewer open a modal of the underlying sample rows
for a
* chart — optionally filtered to a single data point — by either the chart's
* "More Options" header menu or a right-click context menu on the chart body.