diff --git a/frontend/test/__support__/cypress.js b/frontend/test/__support__/cypress.js index e13f621338db78fd640ebf80a626871a001ebb8c..fb9992a39aa395361225326b6d6652f10d0da7fd 100644 --- a/frontend/test/__support__/cypress.js +++ b/frontend/test/__support__/cypress.js @@ -9,3 +9,5 @@ export function signInAsNormalUser() { } export const plainDbHost = Cypress.env("PLAIN_DB_HOST"); + +Cypress.on("uncaught:exception", (err, runnable) => false); diff --git a/frontend/test/cypress.json b/frontend/test/cypress.json index 102200676d4002135758bf8b0adc4339009bba9c..08d537427b2bc7761d035d358e57b2610500bd79 100644 --- a/frontend/test/cypress.json +++ b/frontend/test/cypress.json @@ -2,5 +2,5 @@ "testFiles": "**/*.cy.spec.js", "pluginsFile": "frontend/test/cypress-plugins.js", "integrationFolder": "frontend/test", - "supportFile": false + "supportFile": "frontend/test/__support__/cypress.js" } diff --git a/frontend/test/metabase/dashboard/dashboard.cy.spec.js b/frontend/test/metabase/dashboard/dashboard.cy.spec.js index c3ae236f4bd4c4bcd9e1738afb8930b15a051d14..b77fe5b490a2cb6550d5b0bd2a9bd1232149bc50 100644 --- a/frontend/test/metabase/dashboard/dashboard.cy.spec.js +++ b/frontend/test/metabase/dashboard/dashboard.cy.spec.js @@ -1,7 +1,6 @@ import { signInAsAdmin } from "__support__/cypress"; describe("dashboard", () => { - Cypress.on("uncaught:exception", (err, runnable) => false); beforeEach(signInAsAdmin); it("should have the correct embed snippet", () => { diff --git a/frontend/test/metabase/query_builder/components/NativeQueryEditor.cy.spec.js b/frontend/test/metabase/query_builder/components/NativeQueryEditor.cy.spec.js index 7a3ba943096f4260e9ad95a587d060514959a039..ac957f88ab1c6cd57b54941b098a3132ef54c9b3 100644 --- a/frontend/test/metabase/query_builder/components/NativeQueryEditor.cy.spec.js +++ b/frontend/test/metabase/query_builder/components/NativeQueryEditor.cy.spec.js @@ -1,16 +1,6 @@ import { signInAsNormalUser } from "__support__/cypress"; describe("NativeQueryEditor", () => { - beforeEach(() => { - signInAsNormalUser(); - cy.on("uncaught:exception", (err, runnable) => { - // ignore the error if it's a "script error" - if (err.message.match(/^Script error./)) { - return false; - } - // otherwise, let Cypress fail as usual - return true; - }); - }); + beforeEach(signInAsNormalUser); it("lets you create and run a SQL question", () => { cy.visit("/question/new");