You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by ru...@apache.org on 2023/08/10 16:52:13 UTC

[superset] branch fail-cypress-on-console-errors updated: more sensible method name.

This is an automated email from the ASF dual-hosted git repository.

rusackas pushed a commit to branch fail-cypress-on-console-errors
in repository https://gitbox.apache.org/repos/asf/superset.git


The following commit(s) were added to refs/heads/fail-cypress-on-console-errors by this push:
     new d509608570 more sensible method name.
d509608570 is described below

commit d50960857096383302585edaf609079f639bc65b
Author: Evan Rusackas <ev...@rusackas.com>
AuthorDate: Thu Aug 10 10:52:04 2023 -0600

    more sensible method name.
---
 superset-frontend/cypress-base/cypress/e2e/dashboard/editmode.test.ts | 2 +-
 superset-frontend/cypress-base/cypress/support/e2e.ts                 | 4 ++--
 superset-frontend/cypress-base/cypress/support/index.d.ts             | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/superset-frontend/cypress-base/cypress/e2e/dashboard/editmode.test.ts b/superset-frontend/cypress-base/cypress/e2e/dashboard/editmode.test.ts
index c07607cb1b..812ad945da 100644
--- a/superset-frontend/cypress-base/cypress/e2e/dashboard/editmode.test.ts
+++ b/superset-frontend/cypress-base/cypress/e2e/dashboard/editmode.test.ts
@@ -662,7 +662,7 @@ describe('Dashboard edit', () => {
       openAdvancedProperties();
       clearMetadata();
       // allow console error
-      cy.setConsoleMessages(['Error: A valid color scheme is required']);
+      cy.allowConsoleErrors(['Error: A valid color scheme is required']);
       writeMetadata('{"color_scheme":"wrongcolorscheme"}');
       applyChanges();
       cy.get('.ant-modal-body')
diff --git a/superset-frontend/cypress-base/cypress/support/e2e.ts b/superset-frontend/cypress-base/cypress/support/e2e.ts
index bf75de6e2f..143a1f5df8 100644
--- a/superset-frontend/cypress-base/cypress/support/e2e.ts
+++ b/superset-frontend/cypress-base/cypress/support/e2e.ts
@@ -36,11 +36,11 @@ const { getConfig, setConfig } = failOnConsoleError({
 });
 
 // Set infividual tests to allow certain console erros to NOT fail, e.g
-// cy.setConsoleMessages(['foo', /^some bar-regex.*/]);
+// cy.allowConsoleErrors(['foo', /^some bar-regex.*/]);
 // This will be reset between tests.
 Cypress.Commands.addAll({
   getConsoleMessages: () => cy.wrap(getConfig()?.consoleMessages),
-  setConsoleMessages: (consoleMessages: (string | RegExp)[]) =>
+  allowConsoleErrors: (consoleMessages: (string | RegExp)[]) =>
     setConfig({ ...getConfig(), consoleMessages }),
 });
 
diff --git a/superset-frontend/cypress-base/cypress/support/index.d.ts b/superset-frontend/cypress-base/cypress/support/index.d.ts
index b9d2ed8578..4d84521ccc 100644
--- a/superset-frontend/cypress-base/cypress/support/index.d.ts
+++ b/superset-frontend/cypress-base/cypress/support/index.d.ts
@@ -41,7 +41,7 @@ declare namespace Cypress {
     cleanDashboards(): cy;
     loadChartFixtures(): cy;
     loadDashboardFixtures(): cy;
-    setConsoleMessages(consoleMessages: (string | RegExp)[]): cy;
+    allowConsoleErrors(consoleMessages: (string | RegExp)[]): cy;
 
     visitChartByParams(params: string | Record<string, unknown>): cy;
     visitChartByName(name: string): cy;