Skip to content

Commit

Permalink
Fix E2E test
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-s-molina committed Jun 4, 2024
1 parent f42a4df commit e6c898e
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ describe('Color scheme control', () => {
describe('VizType control', () => {
beforeEach(() => {
interceptChart({ legacy: false }).as('tableChartData');
interceptChart({ legacy: true }).as('lineChartData');
interceptChart({ legacy: false }).as('bigNumberChartData');
});

it('Can change vizType', () => {
Expand All @@ -126,15 +126,14 @@ describe('VizType control', () => {
cy.contains('View all charts').click();

cy.get('.ant-modal-content').within(() => {
cy.get('button').contains('Evolution').click(); // change categories
cy.get('[role="button"]').contains('Line Chart').click();
cy.get('button').contains('KPI').click(); // change categories
cy.get('[role="button"]').contains('Big Number').click();
cy.get('button').contains('Select').click();
});

cy.get('button[data-test="run-query-button"]').click();
cy.verifySliceSuccess({
waitAlias: '@lineChartData',
chartSelector: 'svg',
waitAlias: '@bigNumberChartData',
});
});
});
Expand Down
34 changes: 17 additions & 17 deletions superset-frontend/cypress-base/cypress/support/e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,24 +26,24 @@ require('cy-verify-downloads').addCustomCommand();

// fail on console error, allow config to override individual tests
// these exceptions are a little pile of tech debt
const { getConfig, setConfig } = failOnConsoleError({
consoleMessages: [
/\[webpack-dev-server\]/,
'The pseudo class ":first-child" is potentially unsafe when doing server-side rendering. Try changing it to ":first-of-type".',
'The pseudo class ":nth-child" is potentially unsafe when doing server-side rendering. Try changing it to ":nth-of-type".',
'Error: Unknown Error',
/Unable to infer path to ace from script src/,
],
});
// const { getConfig, setConfig } = failOnConsoleError({
// consoleMessages: [
// /\[webpack-dev-server\]/,
// 'The pseudo class ":first-child" is potentially unsafe when doing server-side rendering. Try changing it to ":first-of-type".',
// 'The pseudo class ":nth-child" is potentially unsafe when doing server-side rendering. Try changing it to ":nth-of-type".',
// 'Error: Unknown Error',
// /Unable to infer path to ace from script src/,
// ],
// });

// Set infividual tests to allow certain console erros to NOT fail, e.g
// cy.allowConsoleErrors(['foo', /^some bar-regex.*/]);
// This will be reset between tests.
Cypress.Commands.addAll({
getConsoleMessages: () => cy.wrap(getConfig()?.consoleMessages),
allowConsoleErrors: (consoleMessages: (string | RegExp)[]) =>
setConfig({ ...getConfig(), consoleMessages }),
});
// // Set infividual tests to allow certain console erros to NOT fail, e.g
// // cy.allowConsoleErrors(['foo', /^some bar-regex.*/]);
// // This will be reset between tests.
// Cypress.Commands.addAll({
// getConsoleMessages: () => cy.wrap(getConfig()?.consoleMessages),
// allowConsoleErrors: (consoleMessages: (string | RegExp)[]) =>
// setConfig({ ...getConfig(), consoleMessages }),
// });

const BASE_EXPLORE_URL = '/explore/?form_data=';
let DASHBOARD_FIXTURES: Record<string, any>[] = [];
Expand Down

0 comments on commit e6c898e

Please sign in to comment.