This is an automated email from the ASF dual-hosted git repository.
diegopucci pushed a commit to branch chore/d2d-e2e-tests
in repository https://gitbox.apache.org/repos/asf/superset.git
The following commit(s) were added to refs/heads/chore/d2d-e2e-tests by this
push:
new 371a47f856 Enhance tests
371a47f856 is described below
commit 371a47f856c357b123d531e9f9887b984334587b
Author: geido <[email protected]>
AuthorDate: Mon Oct 3 16:44:31 2022 +0300
Enhance tests
---
.../new-chart-2022-09-09T14-22-31.728Z.jpg | Bin 16879 -> 0 bytes
.../integration/dashboard/drilltodetail.test.ts | 344 ++++-----------------
.../explore/visualizations/area.test.js | 8 +-
.../explore/visualizations/big_number.test.js | 6 +-
.../visualizations/big_number_total.test.js | 6 +-
.../explore/visualizations/box_plot.test.js | 8 +-
.../explore/visualizations/bubble.test.js | 8 +-
.../explore/visualizations/compare.test.js | 8 +-
.../explore/visualizations/dist_bar.test.js | 21 +-
.../explore/visualizations/dual_line.test.js | 8 +-
.../explore/visualizations/gauge.test.js | 8 +-
.../explore/visualizations/graph.test.ts | 8 +-
.../explore/visualizations/histogram.test.ts | 8 +-
.../explore/visualizations/line.test.ts | 6 +-
.../integration/explore/visualizations/pie.test.js | 8 +-
.../explore/visualizations/pivot_table.test.js | 6 +-
.../explore/visualizations/sankey.test.js | 8 +-
.../explore/visualizations/sunburst.test.js | 8 +-
.../explore/visualizations/table.test.ts | 6 +-
.../explore/visualizations/time_table.js | 6 +-
.../explore/visualizations/treemap.test.js | 8 +-
.../explore/visualizations/world_map.test.js | 8 +-
superset/examples/supported_charts_dashboard.py | 14 +-
23 files changed, 192 insertions(+), 327 deletions(-)
diff --git
a/superset-frontend/cypress-base/cypress/downloads/new-chart-2022-09-09T14-22-31.728Z.jpg
b/superset-frontend/cypress-base/cypress/downloads/new-chart-2022-09-09T14-22-31.728Z.jpg
deleted file mode 100644
index 81bcb35cff..0000000000
Binary files
a/superset-frontend/cypress-base/cypress/downloads/new-chart-2022-09-09T14-22-31.728Z.jpg
and /dev/null differ
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 4d83f854f6..8c38a8e7b9 100644
---
a/superset-frontend/cypress-base/cypress/integration/dashboard/drilltodetail.test.ts
+++
b/superset-frontend/cypress-base/cypress/integration/dashboard/drilltodetail.test.ts
@@ -65,6 +65,41 @@ function setTopLevelTab(tabName: string) {
cy.get("div#TABS-TOP div[role='tab']").contains(tabName).click();
}
+function testTimeChart(vizType: string) {
+ interceptSamples();
+
+ cy.get(`[data-test-viz-type='${vizType}'] canvas`).then($canvas => {
+ cy.wrap($canvas).scrollIntoView().click(70, 93).rightclick(70, 93);
+
+ openModalFromChartContext('Drill to detail by 1965');
+ cy.getBySel('filter-val').should('contain', '1965');
+ closeModal();
+
+ cy.wrap($canvas).scrollIntoView().click(70, 93).rightclick(70, 93);
+
+ openModalFromChartContext('Drill to detail by boy');
+ cy.getBySel('filter-val').should('contain', 'boy');
+ closeModal();
+
+ cy.wrap($canvas).scrollIntoView().click(70, 93).rightclick(70, 93);
+
+ openModalFromChartContext('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().click(70, 145).rightclick(70, 145);
+ openModalFromChartContext('Drill to detail by girl');
+ cy.getBySel('filter-val').should('contain', 'girl');
+ closeModal();
+
+ cy.wrap($canvas).scrollIntoView().click(70, 145).rightclick(70, 145);
+ openModalFromChartContext('Drill to detail by all');
+ cy.getBySel('filter-val').first().should('contain', '1965');
+ cy.getBySel('filter-val').eq(1).should('contain', 'girl');
+ });
+}
+
describe('Drill to detail modal', () => {
beforeEach(() => {
cy.preserveLogin();
@@ -264,46 +299,7 @@ describe('Drill to detail modal', () => {
describe('Time-Series Line Chart', () => {
it('opens the modal with the correct filters', () => {
- interceptSamples();
-
- cy.get("[data-test-viz-type='echarts_timeseries_line'] canvas").then(
- $canvas => {
- cy.wrap($canvas).scrollIntoView().click(70, 93).rightclick(70, 93);
-
- openModalFromChartContext('Drill to detail by 1965');
- cy.getBySel('filter-val').should('contain', '1965');
- closeModal();
-
- cy.wrap($canvas).scrollIntoView().click(70, 93).rightclick(70, 93);
-
- openModalFromChartContext('Drill to detail by boy');
- cy.getBySel('filter-val').should('contain', 'boy');
- closeModal();
-
- cy.wrap($canvas).scrollIntoView().click(70, 93).rightclick(70, 93);
-
- openModalFromChartContext('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()
- .click(70, 145)
- .rightclick(70, 145);
- openModalFromChartContext('Drill to detail by girl');
- cy.getBySel('filter-val').should('contain', 'girl');
- closeModal();
-
- cy.wrap($canvas)
- .scrollIntoView()
- .click(70, 145)
- .rightclick(70, 145);
- openModalFromChartContext('Drill to detail by all');
- cy.getBySel('filter-val').first().should('contain', '1965');
- cy.getBySel('filter-val').eq(1).should('contain', 'girl');
- },
- );
+ testTimeChart('echarts_timeseries_line');
});
});
@@ -336,15 +332,6 @@ describe('Drill to detail modal', () => {
openModalFromChartContext('Drill to detail by girl');
cy.getBySel('filter-val').should('contain', 'girl');
- closeModal();
-
- cy.wrap($canvas)
- .scrollIntoView()
- .click(70, 145)
- .rightclick(70, 145);
- openModalFromChartContext('Drill to detail by all');
- cy.getBySel('filter-val').first().should('contain', '1965');
- cy.getBySel('filter-val').eq(1).should('contain', 'girl');
},
);
});
@@ -352,83 +339,13 @@ describe('Drill to detail modal', () => {
describe('Time-Series Area Chart', () => {
it('opens the modal with the correct filters', () => {
- interceptSamples();
-
- cy.get("[data-test-viz-type='echarts_area'] canvas").then($canvas => {
- cy.wrap($canvas).scrollIntoView().click(70, 93).rightclick(70, 93);
-
- openModalFromChartContext('Drill to detail by 1965');
- cy.getBySel('filter-val').should('contain', '1965');
- closeModal();
-
- cy.wrap($canvas).scrollIntoView().click(70, 93).rightclick(70, 93);
-
- openModalFromChartContext('Drill to detail by boy');
- cy.getBySel('filter-val').should('contain', 'boy');
- closeModal();
-
- cy.wrap($canvas).scrollIntoView().click(70, 93).rightclick(70, 93);
-
- openModalFromChartContext('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().click(70, 145).rightclick(70, 145);
- openModalFromChartContext('Drill to detail by girl');
- cy.getBySel('filter-val').should('contain', 'girl');
- closeModal();
-
- cy.wrap($canvas).scrollIntoView().click(70, 145).rightclick(70, 145);
- openModalFromChartContext('Drill to detail by all');
- cy.getBySel('filter-val').first().should('contain', '1965');
- cy.getBySel('filter-val').eq(1).should('contain', 'girl');
- });
+ testTimeChart('echarts_area');
});
});
describe('Time-Series Scatter Chart', () => {
it('opens the modal with the correct filters', () => {
- interceptSamples();
-
- cy.get("[data-test-viz-type='echarts_timeseries_scatter']
canvas").then(
- $canvas => {
- cy.wrap($canvas).scrollIntoView().click(70, 93).rightclick(70, 93);
-
- openModalFromChartContext('Drill to detail by 1965');
- cy.getBySel('filter-val').should('contain', '1965');
- closeModal();
-
- cy.wrap($canvas).scrollIntoView().click(70, 93).rightclick(70, 93);
-
- openModalFromChartContext('Drill to detail by boy');
- cy.getBySel('filter-val').should('contain', 'boy');
- closeModal();
-
- cy.wrap($canvas).scrollIntoView().click(70, 93).rightclick(70, 93);
-
- openModalFromChartContext('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()
- .click(70, 145)
- .rightclick(70, 145);
- openModalFromChartContext('Drill to detail by girl');
- cy.getBySel('filter-val').should('contain', 'girl');
- closeModal();
-
- cy.wrap($canvas)
- .scrollIntoView()
- .click(70, 145)
- .rightclick(70, 145);
- openModalFromChartContext('Drill to detail by all');
- cy.getBySel('filter-val').first().should('contain', '1965');
- cy.getBySel('filter-val').eq(1).should('contain', 'girl');
- },
- );
+ testTimeChart('echarts_timeseries_scatter');
});
});
@@ -451,6 +368,24 @@ describe('Drill to detail modal', () => {
});
});
});
+
+ describe('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().rightclick(70, 150);
+ openModalFromChartContext('Drill to detail by United States');
+ cy.getBySel('filter-val').should('contain', 'United States');
+ closeModal();
+ });
+ cy.get("[data-test-viz-type='world_map'] svg").then($canvas => {
+ cy.wrap($canvas).scrollIntoView().rightclick(200, 140);
+ openModalFromChartContext('Drill to detail by Slovakia');
+ cy.getBySel('filter-val').should('contain', 'Slovakia');
+ });
+ });
+ });
});
describe('Tier 2 charts', () => {
@@ -532,139 +467,19 @@ describe('Drill to detail modal', () => {
describe('Time-Series Generic Chart', () => {
it('opens the modal with the correct filters', () => {
- interceptSamples();
-
- cy.get("[data-test-viz-type='echarts_timeseries'] canvas").then(
- $canvas => {
- cy.wrap($canvas).scrollIntoView().click(70, 93).rightclick(70, 93);
-
- openModalFromChartContext('Drill to detail by 1965');
- cy.getBySel('filter-val').should('contain', '1965');
- closeModal();
-
- cy.wrap($canvas).scrollIntoView().click(70, 93).rightclick(70, 93);
-
- openModalFromChartContext('Drill to detail by boy');
- cy.getBySel('filter-val').should('contain', 'boy');
- closeModal();
-
- cy.wrap($canvas).scrollIntoView().click(70, 93).rightclick(70, 93);
-
- openModalFromChartContext('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()
- .click(70, 145)
- .rightclick(70, 145);
- openModalFromChartContext('Drill to detail by girl');
- cy.getBySel('filter-val').should('contain', 'girl');
-
- closeModal();
-
- cy.wrap($canvas)
- .scrollIntoView()
- .click(70, 145)
- .rightclick(70, 145);
- openModalFromChartContext('Drill to detail by all');
- cy.getBySel('filter-val').first().should('contain', '1965');
- cy.getBySel('filter-val').eq(1).should('contain', 'girl');
- },
- );
+ testTimeChart('echarts_timeseries');
});
});
describe('Time-Series Smooth Chart', () => {
it('opens the modal with the correct filters', () => {
- interceptSamples();
-
- cy.get("[data-test-viz-type='echarts_timeseries_smooth'] canvas").then(
- $canvas => {
- cy.wrap($canvas).scrollIntoView().click(70, 93).rightclick(70, 93);
-
- openModalFromChartContext('Drill to detail by 1965');
- cy.getBySel('filter-val').should('contain', '1965');
- closeModal();
-
- cy.wrap($canvas).scrollIntoView().click(70, 93).rightclick(70, 93);
-
- openModalFromChartContext('Drill to detail by boy');
- cy.getBySel('filter-val').should('contain', 'boy');
- closeModal();
-
- cy.wrap($canvas).scrollIntoView().click(70, 93).rightclick(70, 93);
-
- openModalFromChartContext('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()
- .click(70, 145)
- .rightclick(70, 145);
- openModalFromChartContext('Drill to detail by girl');
- cy.getBySel('filter-val').should('contain', 'girl');
-
- closeModal();
-
- cy.wrap($canvas)
- .scrollIntoView()
- .click(70, 145)
- .rightclick(70, 145);
- openModalFromChartContext('Drill to detail by all');
- cy.getBySel('filter-val').first().should('contain', '1965');
- cy.getBySel('filter-val').eq(1).should('contain', 'girl');
- },
- );
+ testTimeChart('echarts_timeseries_smooth');
});
});
describe('Time-Series Step Line Chart', () => {
it('opens the modal with the correct filters', () => {
- interceptSamples();
-
- cy.get("[data-test-viz-type='echarts_timeseries_step'] canvas").then(
- $canvas => {
- cy.wrap($canvas).scrollIntoView().click(70, 93).rightclick(70, 93);
-
- openModalFromChartContext('Drill to detail by 1965');
- cy.getBySel('filter-val').should('contain', '1965');
- closeModal();
-
- cy.wrap($canvas).scrollIntoView().click(70, 93).rightclick(70, 93);
-
- openModalFromChartContext('Drill to detail by boy');
- cy.getBySel('filter-val').should('contain', 'boy');
- closeModal();
-
- cy.wrap($canvas).scrollIntoView().click(70, 93).rightclick(70, 93);
-
- openModalFromChartContext('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()
- .click(70, 145)
- .rightclick(70, 145);
- openModalFromChartContext('Drill to detail by girl');
- cy.getBySel('filter-val').should('contain', 'girl');
-
- closeModal();
-
- cy.wrap($canvas)
- .scrollIntoView()
- .click(70, 145)
- .rightclick(70, 145);
- openModalFromChartContext('Drill to detail by all');
- cy.getBySel('filter-val').first().should('contain', '1965');
- cy.getBySel('filter-val').eq(1).should('contain', 'girl');
- },
- );
+ testTimeChart('echarts_timeseries_step');
});
});
@@ -708,46 +523,7 @@ describe('Drill to detail modal', () => {
describe('Mixed Chart', () => {
it('opens the modal with the correct filters', () => {
- interceptSamples();
-
- cy.get("[data-test-viz-type='mixed_timeseries'] canvas").then(
- $canvas => {
- cy.wrap($canvas).scrollIntoView().click(70, 93).rightclick(70, 93);
-
- openModalFromChartContext('Drill to detail by 1965');
- cy.getBySel('filter-val').should('contain', '1965');
- closeModal();
-
- cy.wrap($canvas).scrollIntoView().click(70, 93).rightclick(70, 93);
-
- openModalFromChartContext('Drill to detail by boy');
- cy.getBySel('filter-val').should('contain', 'boy');
- closeModal();
-
- cy.wrap($canvas).scrollIntoView().click(70, 93).rightclick(70, 93);
-
- openModalFromChartContext('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()
- .click(70, 145)
- .rightclick(70, 145);
- openModalFromChartContext('Drill to detail by girl');
- cy.getBySel('filter-val').should('contain', 'girl');
- closeModal();
-
- cy.wrap($canvas)
- .scrollIntoView()
- .click(70, 145)
- .rightclick(70, 145);
- openModalFromChartContext('Drill to detail by all');
- cy.getBySel('filter-val').first().should('contain', '1965');
- cy.getBySel('filter-val').eq(1).should('contain', 'girl');
- },
- );
+ testTimeChart('mixed_timeseries');
});
});
diff --git
a/superset-frontend/cypress-base/cypress/integration/explore/visualizations/area.test.js
b/superset-frontend/cypress-base/cypress/integration/explore/visualizations/area.test.js
index 069b457aa7..dd7ca3188b 100644
---
a/superset-frontend/cypress-base/cypress/integration/explore/visualizations/area.test.js
+++
b/superset-frontend/cypress-base/cypress/integration/explore/visualizations/area.test.js
@@ -55,8 +55,12 @@ describe('Visualization > Area', () => {
cy.verifySliceSuccess({ waitAlias: '@getJson', chartSelector: 'svg' });
}
- beforeEach(() => {
+ before(() => {
cy.login();
+ });
+
+ beforeEach(() => {
+ cy.preserveLogin();
cy.intercept('POST', '/superset/explore_json/**').as('getJson');
});
@@ -105,6 +109,8 @@ describe('Visualization > Area', () => {
});
it('should allow type to search color schemes and apply the scheme', () => {
+ verify(AREA_FORM_DATA);
+
cy.get('#controlSections-tab-display').click();
cy.get('.Control[data-test="color_scheme"]').scrollIntoView();
cy.get('.Control[data-test="color_scheme"] input[type="search"]')
diff --git
a/superset-frontend/cypress-base/cypress/integration/explore/visualizations/big_number.test.js
b/superset-frontend/cypress-base/cypress/integration/explore/visualizations/big_number.test.js
index ede7ed47f9..691311059a 100644
---
a/superset-frontend/cypress-base/cypress/integration/explore/visualizations/big_number.test.js
+++
b/superset-frontend/cypress-base/cypress/integration/explore/visualizations/big_number.test.js
@@ -49,8 +49,12 @@ describe('Visualization > Big Number with Trendline', () => {
});
}
- beforeEach(() => {
+ before(() => {
cy.login();
+ });
+
+ beforeEach(() => {
+ cy.preserveLogin();
interceptChart({ legacy: false }).as('chartData');
});
diff --git
a/superset-frontend/cypress-base/cypress/integration/explore/visualizations/big_number_total.test.js
b/superset-frontend/cypress-base/cypress/integration/explore/visualizations/big_number_total.test.js
index e2fcc5a1a1..9058c955d5 100644
---
a/superset-frontend/cypress-base/cypress/integration/explore/visualizations/big_number_total.test.js
+++
b/superset-frontend/cypress-base/cypress/integration/explore/visualizations/big_number_total.test.js
@@ -25,8 +25,12 @@ describe('Visualization > Big Number Total', () => {
viz_type: 'big_number_total',
};
- beforeEach(() => {
+ before(() => {
cy.login();
+ });
+
+ beforeEach(() => {
+ cy.preserveLogin();
interceptChart({ legacy: false }).as('chartData');
});
diff --git
a/superset-frontend/cypress-base/cypress/integration/explore/visualizations/box_plot.test.js
b/superset-frontend/cypress-base/cypress/integration/explore/visualizations/box_plot.test.js
index 46242e0114..adbd5bcef2 100644
---
a/superset-frontend/cypress-base/cypress/integration/explore/visualizations/box_plot.test.js
+++
b/superset-frontend/cypress-base/cypress/integration/explore/visualizations/box_plot.test.js
@@ -37,8 +37,12 @@ describe('Visualization > Box Plot', () => {
cy.verifySliceSuccess({ waitAlias: '@getJson' });
}
- beforeEach(() => {
+ before(() => {
cy.login();
+ });
+
+ beforeEach(() => {
+ cy.preserveLogin();
cy.intercept('POST', '/api/v1/chart/data*').as('getJson');
});
@@ -48,6 +52,8 @@ describe('Visualization > Box Plot', () => {
});
it('should allow type to search color schemes', () => {
+ verify(BOX_PLOT_FORM_DATA);
+
cy.get('#controlSections-tab-display').click();
cy.get('.Control[data-test="color_scheme"]').scrollIntoView();
cy.get('.Control[data-test="color_scheme"] input[type="search"]')
diff --git
a/superset-frontend/cypress-base/cypress/integration/explore/visualizations/bubble.test.js
b/superset-frontend/cypress-base/cypress/integration/explore/visualizations/bubble.test.js
index e41535b549..955ec16618 100644
---
a/superset-frontend/cypress-base/cypress/integration/explore/visualizations/bubble.test.js
+++
b/superset-frontend/cypress-base/cypress/integration/explore/visualizations/bubble.test.js
@@ -51,8 +51,12 @@ describe('Visualization > Bubble', () => {
cy.verifySliceSuccess({ waitAlias: '@getJson', chartSelector: 'svg' });
}
- beforeEach(() => {
+ before(() => {
cy.login();
+ });
+
+ beforeEach(() => {
+ cy.preserveLogin();
cy.intercept('POST', '/superset/explore_json/**').as('getJson');
});
@@ -109,6 +113,8 @@ describe('Visualization > Bubble', () => {
});
it('should allow type to search color schemes and apply the scheme', () => {
+ cy.visitChartByParams(BUBBLE_FORM_DATA);
+
cy.get('.Control[data-test="color_scheme"]').scrollIntoView();
cy.get('.Control[data-test="color_scheme"] input[type="search"]')
.focus()
diff --git
a/superset-frontend/cypress-base/cypress/integration/explore/visualizations/compare.test.js
b/superset-frontend/cypress-base/cypress/integration/explore/visualizations/compare.test.js
index 71f61c1432..efce9db819 100644
---
a/superset-frontend/cypress-base/cypress/integration/explore/visualizations/compare.test.js
+++
b/superset-frontend/cypress-base/cypress/integration/explore/visualizations/compare.test.js
@@ -51,8 +51,12 @@ describe('Visualization > Compare', () => {
cy.verifySliceSuccess({ waitAlias: '@getJson', chartSelector: 'svg' });
}
- beforeEach(() => {
+ before(() => {
cy.login();
+ });
+
+ beforeEach(() => {
+ cy.preserveLogin();
cy.intercept('POST', '/superset/explore_json/**').as('getJson');
});
@@ -88,6 +92,8 @@ describe('Visualization > Compare', () => {
});
it('should allow type to search color schemes and apply the scheme', () => {
+ verify(COMPARE_FORM_DATA);
+
cy.get('#controlSections-tab-display').click();
cy.get('.Control[data-test="color_scheme"]').scrollIntoView();
cy.get('.Control[data-test="color_scheme"] input[type="search"]')
diff --git
a/superset-frontend/cypress-base/cypress/integration/explore/visualizations/dist_bar.test.js
b/superset-frontend/cypress-base/cypress/integration/explore/visualizations/dist_bar.test.js
index 9f62003c82..cff5c2705a 100644
---
a/superset-frontend/cypress-base/cypress/integration/explore/visualizations/dist_bar.test.js
+++
b/superset-frontend/cypress-base/cypress/integration/explore/visualizations/dist_bar.test.js
@@ -20,20 +20,23 @@ import { FORM_DATA_DEFAULTS, NUM_METRIC } from
'./shared.helper';
describe('Visualization > Distribution bar chart', () => {
const VIZ_DEFAULTS = { ...FORM_DATA_DEFAULTS, viz_type: 'dist_bar' };
+ const DISTBAR_FORM_DATA = {
+ ...VIZ_DEFAULTS,
+ metrics: NUM_METRIC,
+ groupby: ['state'],
+ };
- beforeEach(() => {
+ before(() => {
cy.login();
+ });
+
+ beforeEach(() => {
+ cy.preserveLogin();
cy.intercept('POST', '/superset/explore_json/**').as('getJson');
});
it('should work with adhoc metric', () => {
- const formData = {
- ...VIZ_DEFAULTS,
- metrics: NUM_METRIC,
- groupby: ['state'],
- };
-
- cy.visitChartByParams(formData);
+ cy.visitChartByParams(DISTBAR_FORM_DATA);
cy.verifySliceSuccess({
waitAlias: '@getJson',
querySubstring: NUM_METRIC.label,
@@ -79,6 +82,8 @@ describe('Visualization > Distribution bar chart', () => {
});
it('should allow type to search color schemes and apply the scheme', () => {
+ cy.visitChartByParams(DISTBAR_FORM_DATA);
+
cy.get('#controlSections-tab-display').click();
cy.get('.Control[data-test="color_scheme"]').scrollIntoView();
cy.get('.Control[data-test="color_scheme"] input[type="search"]')
diff --git
a/superset-frontend/cypress-base/cypress/integration/explore/visualizations/dual_line.test.js
b/superset-frontend/cypress-base/cypress/integration/explore/visualizations/dual_line.test.js
index 1e7ed4c454..c39d614dd5 100644
---
a/superset-frontend/cypress-base/cypress/integration/explore/visualizations/dual_line.test.js
+++
b/superset-frontend/cypress-base/cypress/integration/explore/visualizations/dual_line.test.js
@@ -39,8 +39,12 @@ describe('Visualization > Dual Line', () => {
cy.verifySliceSuccess({ waitAlias: '@getJson', chartSelector: 'svg' });
}
- beforeEach(() => {
+ before(() => {
cy.login();
+ });
+
+ beforeEach(() => {
+ cy.preserveLogin();
cy.intercept('POST', '/superset/explore_json/**').as('getJson');
});
@@ -68,6 +72,8 @@ describe('Visualization > Dual Line', () => {
});
it('should allow type to search color schemes and apply the scheme', () => {
+ verify(DUAL_LINE_FORM_DATA);
+
cy.get('#controlSections-tab-display').click();
cy.get('.Control[data-test="color_scheme"]').scrollIntoView();
cy.get('.Control[data-test="color_scheme"] input[type="search"]')
diff --git
a/superset-frontend/cypress-base/cypress/integration/explore/visualizations/gauge.test.js
b/superset-frontend/cypress-base/cypress/integration/explore/visualizations/gauge.test.js
index e8a85e83d0..ccce5981f2 100644
---
a/superset-frontend/cypress-base/cypress/integration/explore/visualizations/gauge.test.js
+++
b/superset-frontend/cypress-base/cypress/integration/explore/visualizations/gauge.test.js
@@ -17,14 +17,13 @@
* under the License.
*/
-// TODO(kgabryje): fix it and un-skip
-describe.skip('Visualization > Gauge', () => {
+describe('Visualization > Gauge', () => {
const GAUGE_FORM_DATA = {
- datasource: '2__table',
+ datasource: '3__table',
viz_type: 'gauge_chart',
metric: 'count',
adhoc_filters: [],
- slice_id: 49,
+ slice_id: 54,
row_limit: 10,
};
@@ -64,6 +63,7 @@ describe.skip('Visualization > Gauge', () => {
});
it('should allow type to search color schemes', () => {
+ verify(GAUGE_FORM_DATA);
cy.get('#controlSections-tab-display').click();
cy.get('.Control[data-test="color_scheme"]').scrollIntoView();
cy.get('.Control[data-test="color_scheme"] input[type="search"]')
diff --git
a/superset-frontend/cypress-base/cypress/integration/explore/visualizations/graph.test.ts
b/superset-frontend/cypress-base/cypress/integration/explore/visualizations/graph.test.ts
index 16747d7221..8fae1cd331 100644
---
a/superset-frontend/cypress-base/cypress/integration/explore/visualizations/graph.test.ts
+++
b/superset-frontend/cypress-base/cypress/integration/explore/visualizations/graph.test.ts
@@ -50,8 +50,12 @@ describe('Visualization > Graph', () => {
cy.verifySliceSuccess({ waitAlias: '@getJson' });
}
- beforeEach(() => {
+ before(() => {
cy.login();
+ });
+
+ beforeEach(() => {
+ cy.preserveLogin();
cy.intercept('POST', '/api/v1/chart/data*').as('getJson');
});
@@ -79,6 +83,8 @@ describe('Visualization > Graph', () => {
});
it('should allow type to search color schemes', () => {
+ verify(GRAPH_FORM_DATA);
+
cy.get('#controlSections-tab-display').click();
cy.get('.Control[data-test="color_scheme"]').scrollIntoView();
cy.get('.Control[data-test="color_scheme"] input[type="search"]')
diff --git
a/superset-frontend/cypress-base/cypress/integration/explore/visualizations/histogram.test.ts
b/superset-frontend/cypress-base/cypress/integration/explore/visualizations/histogram.test.ts
index fbd5cfadeb..c86f74ea3f 100644
---
a/superset-frontend/cypress-base/cypress/integration/explore/visualizations/histogram.test.ts
+++
b/superset-frontend/cypress-base/cypress/integration/explore/visualizations/histogram.test.ts
@@ -43,8 +43,12 @@ describe('Visualization > Histogram', () => {
cy.verifySliceSuccess({ waitAlias: '@getJson', chartSelector: 'svg' });
}
- beforeEach(() => {
+ before(() => {
cy.login();
+ });
+
+ beforeEach(() => {
+ cy.preserveLogin();
cy.intercept('POST', '/superset/explore_json/**').as('getJson');
});
@@ -86,6 +90,8 @@ describe('Visualization > Histogram', () => {
});
it('should allow type to search color schemes and apply the scheme', () => {
+ verify(HISTOGRAM_FORM_DATA);
+
cy.get('#controlSections-tab-display').click();
cy.get('.Control[data-test="color_scheme"]').scrollIntoView();
cy.get('.Control[data-test="color_scheme"] input[type="search"]')
diff --git
a/superset-frontend/cypress-base/cypress/integration/explore/visualizations/line.test.ts
b/superset-frontend/cypress-base/cypress/integration/explore/visualizations/line.test.ts
index 03ab7a6ed0..f614c65de9 100644
---
a/superset-frontend/cypress-base/cypress/integration/explore/visualizations/line.test.ts
+++
b/superset-frontend/cypress-base/cypress/integration/explore/visualizations/line.test.ts
@@ -21,8 +21,12 @@ import { FORM_DATA_DEFAULTS, NUM_METRIC, SIMPLE_FILTER }
from './shared.helper';
describe('Visualization > Line', () => {
const LINE_CHART_DEFAULTS = { ...FORM_DATA_DEFAULTS, viz_type: 'line' };
- beforeEach(() => {
+ before(() => {
cy.login();
+ });
+
+ beforeEach(() => {
+ cy.preserveLogin();
cy.intercept('POST', '/superset/explore_json/**').as('getJson');
});
diff --git
a/superset-frontend/cypress-base/cypress/integration/explore/visualizations/pie.test.js
b/superset-frontend/cypress-base/cypress/integration/explore/visualizations/pie.test.js
index 6c6d33e6e6..1fa63942a5 100644
---
a/superset-frontend/cypress-base/cypress/integration/explore/visualizations/pie.test.js
+++
b/superset-frontend/cypress-base/cypress/integration/explore/visualizations/pie.test.js
@@ -41,8 +41,12 @@ describe('Visualization > Pie', () => {
cy.verifySliceSuccess({ waitAlias: '@getJson' });
}
- beforeEach(() => {
+ before(() => {
cy.login();
+ });
+
+ beforeEach(() => {
+ cy.preserveLogin();
cy.intercept('POST', '/api/v1/chart/data*').as('getJson');
});
@@ -70,6 +74,8 @@ describe('Visualization > Pie', () => {
});
it('should allow type to search color schemes', () => {
+ verify(PIE_FORM_DATA);
+
cy.get('#controlSections-tab-display').click();
cy.get('.Control[data-test="color_scheme"]').scrollIntoView();
cy.get('.Control[data-test="color_scheme"] input[type="search"]')
diff --git
a/superset-frontend/cypress-base/cypress/integration/explore/visualizations/pivot_table.test.js
b/superset-frontend/cypress-base/cypress/integration/explore/visualizations/pivot_table.test.js
index ef62beb381..1669ceb070 100644
---
a/superset-frontend/cypress-base/cypress/integration/explore/visualizations/pivot_table.test.js
+++
b/superset-frontend/cypress-base/cypress/integration/explore/visualizations/pivot_table.test.js
@@ -58,8 +58,12 @@ describe('Visualization > Pivot Table', () => {
cy.verifySliceSuccess({ waitAlias: '@getJson', chartSelector: 'table' });
}
- beforeEach(() => {
+ before(() => {
cy.login();
+ });
+
+ beforeEach(() => {
+ cy.preserveLogin();
cy.intercept('POST', '/superset/explore_json/**').as('getJson');
});
diff --git
a/superset-frontend/cypress-base/cypress/integration/explore/visualizations/sankey.test.js
b/superset-frontend/cypress-base/cypress/integration/explore/visualizations/sankey.test.js
index fccefecf32..97a47f0a85 100644
---
a/superset-frontend/cypress-base/cypress/integration/explore/visualizations/sankey.test.js
+++
b/superset-frontend/cypress-base/cypress/integration/explore/visualizations/sankey.test.js
@@ -37,8 +37,12 @@ describe('Visualization > Sankey', () => {
cy.verifySliceSuccess({ waitAlias: '@getJson', chartSelector: 'svg' });
}
- beforeEach(() => {
+ before(() => {
cy.login();
+ });
+
+ beforeEach(() => {
+ cy.preserveLogin();
cy.intercept('POST', '/superset/explore_json/**').as('getJson');
});
@@ -75,6 +79,8 @@ describe('Visualization > Sankey', () => {
});
it('should allow type to search color schemes', () => {
+ verify(SANKEY_FORM_DATA);
+
cy.get('#controlSections-tab-display').click();
cy.get('.Control[data-test="color_scheme"]').scrollIntoView();
cy.get('.Control[data-test="color_scheme"] input[type="search"]')
diff --git
a/superset-frontend/cypress-base/cypress/integration/explore/visualizations/sunburst.test.js
b/superset-frontend/cypress-base/cypress/integration/explore/visualizations/sunburst.test.js
index 990d1d5294..74f4720bc7 100644
---
a/superset-frontend/cypress-base/cypress/integration/explore/visualizations/sunburst.test.js
+++
b/superset-frontend/cypress-base/cypress/integration/explore/visualizations/sunburst.test.js
@@ -36,8 +36,12 @@ describe('Visualization > Sunburst', () => {
cy.verifySliceSuccess({ waitAlias: '@getJson', chartSelector: 'svg' });
}
- beforeEach(() => {
+ before(() => {
cy.login();
+ });
+
+ beforeEach(() => {
+ cy.preserveLogin();
cy.intercept('POST', '/superset/explore_json/**').as('getJson');
});
@@ -82,6 +86,8 @@ describe('Visualization > Sunburst', () => {
});
it('should allow type to search color schemes', () => {
+ verify(SUNBURST_FORM_DATA);
+
cy.get('#controlSections-tab-display').click();
cy.get('.Control[data-test="color_scheme"]').scrollIntoView();
cy.get('.Control[data-test="color_scheme"] input[type="search"]')
diff --git
a/superset-frontend/cypress-base/cypress/integration/explore/visualizations/table.test.ts
b/superset-frontend/cypress-base/cypress/integration/explore/visualizations/table.test.ts
index f11b23d595..9a383f810c 100644
---
a/superset-frontend/cypress-base/cypress/integration/explore/visualizations/table.test.ts
+++
b/superset-frontend/cypress-base/cypress/integration/explore/visualizations/table.test.ts
@@ -43,8 +43,12 @@ describe('Visualization > Table', () => {
optionName: 'metric_6qwzgc8bh2v_zox7hil1mzs',
};
- beforeEach(() => {
+ before(() => {
cy.login();
+ });
+
+ beforeEach(() => {
+ cy.preserveLogin();
interceptChart({ legacy: false }).as('chartData');
});
diff --git
a/superset-frontend/cypress-base/cypress/integration/explore/visualizations/time_table.js
b/superset-frontend/cypress-base/cypress/integration/explore/visualizations/time_table.js
index eb81d17a3b..cf86c43aa2 100644
---
a/superset-frontend/cypress-base/cypress/integration/explore/visualizations/time_table.js
+++
b/superset-frontend/cypress-base/cypress/integration/explore/visualizations/time_table.js
@@ -21,8 +21,12 @@ import { FORM_DATA_DEFAULTS, NUM_METRIC } from
'./shared.helper';
describe('Visualization > Time TableViz', () => {
const VIZ_DEFAULTS = { ...FORM_DATA_DEFAULTS, viz_type: 'time_table' };
- beforeEach(() => {
+ before(() => {
cy.login();
+ });
+
+ beforeEach(() => {
+ cy.preserveLogin();
cy.intercept('POST', '/superset/explore_json/**').as('getJson');
});
diff --git
a/superset-frontend/cypress-base/cypress/integration/explore/visualizations/treemap.test.js
b/superset-frontend/cypress-base/cypress/integration/explore/visualizations/treemap.test.js
index efd92a3e4e..5a22aae6a5 100644
---
a/superset-frontend/cypress-base/cypress/integration/explore/visualizations/treemap.test.js
+++
b/superset-frontend/cypress-base/cypress/integration/explore/visualizations/treemap.test.js
@@ -42,8 +42,12 @@ describe('Visualization > Treemap', () => {
cy.verifySliceSuccess({ waitAlias: '@getJson', chartSelector: 'svg' });
}
- beforeEach(() => {
+ before(() => {
cy.login();
+ });
+
+ beforeEach(() => {
+ cy.preserveLogin();
cy.intercept('POST', '/superset/explore_json/**').as('getJson');
});
@@ -82,6 +86,8 @@ describe('Visualization > Treemap', () => {
});
it('should allow type to search color schemes and apply the scheme', () => {
+ verify(TREEMAP_FORM_DATA);
+
cy.get('.Control[data-test="color_scheme"]').scrollIntoView();
cy.get('.Control[data-test="color_scheme"] input[type="search"]')
.focus()
diff --git
a/superset-frontend/cypress-base/cypress/integration/explore/visualizations/world_map.test.js
b/superset-frontend/cypress-base/cypress/integration/explore/visualizations/world_map.test.js
index 8faa4e412b..d9297c613a 100644
---
a/superset-frontend/cypress-base/cypress/integration/explore/visualizations/world_map.test.js
+++
b/superset-frontend/cypress-base/cypress/integration/explore/visualizations/world_map.test.js
@@ -39,8 +39,12 @@ describe('Visualization > World Map', () => {
cy.verifySliceSuccess({ waitAlias: '@getJson', chartSelector: 'svg' });
}
- beforeEach(() => {
+ before(() => {
cy.login();
+ });
+
+ beforeEach(() => {
+ cy.preserveLogin();
cy.intercept('POST', '/superset/explore_json/**').as('getJson');
});
@@ -82,6 +86,8 @@ describe('Visualization > World Map', () => {
});
it('should allow type to search color schemes', () => {
+ verify(WORLD_MAP_FORM_DATA);
+
cy.get('.Control[data-test="linear_color_scheme"]').scrollIntoView();
cy.get('.Control[data-test="linear_color_scheme"] input[type="search"]')
.focus()
diff --git a/superset/examples/supported_charts_dashboard.py
b/superset/examples/supported_charts_dashboard.py
index 8d0b3570ea..aa4f404ccb 100644
--- a/superset/examples/supported_charts_dashboard.py
+++ b/superset/examples/supported_charts_dashboard.py
@@ -171,18 +171,6 @@ def create_slices(tbl: SqlaTable) -> List[Slice]:
groupby=["gender"],
),
),
- # TODO: use a different dataset for world map
- Slice(
- **slice_props,
- slice_name="World Map",
- viz_type="world_map",
- params=get_slice_json(
- defaults,
- viz_type="world_map",
- metric="sum__num",
- entity="gender",
- ),
- ),
# ---------------------
# TIER 2
# ---------------------
@@ -673,7 +661,7 @@ def load_supported_charts_dashboard() -> None:
"meta": {
"chartId": 11,
"height": 50,
- "sliceName": "World Map",
+ "sliceName": "% Rural",
"width": 4
},
"type": "CHART"