From 450abef66230dc7e4d6a8f5412f9bdeb1222db7d Mon Sep 17 00:00:00 2001 From: Nemanja Glumac <31325167+nemanjaglumac@users.noreply.github.com> Date: Mon, 4 Apr 2022 11:00:05 +0200 Subject: [PATCH] Run E2E tests using Chrome instead of Electron (#21438) * Run E2E tests using Chrome * Create snapshots using Chrome * Test in GHA once again * Set browser in the base Cypress config * Change branch back to `master` for E2E workflow --- frontend/test/__runner__/cypress-runner-generate-snapshots.js | 1 + frontend/test/__runner__/cypress-runner-run-tests.js | 1 + package.json | 4 ++-- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/frontend/test/__runner__/cypress-runner-generate-snapshots.js b/frontend/test/__runner__/cypress-runner-generate-snapshots.js index 373a707f2d7..ba7b4af9863 100644 --- a/frontend/test/__runner__/cypress-runner-generate-snapshots.js +++ b/frontend/test/__runner__/cypress-runner-generate-snapshots.js @@ -2,6 +2,7 @@ const cypress = require("cypress"); const getConfig = baseUrl => { return { + browser: "chrome", configFile: "frontend/test/__support__/e2e/cypress-snapshots.json", config: { baseUrl, diff --git a/frontend/test/__runner__/cypress-runner-run-tests.js b/frontend/test/__runner__/cypress-runner-run-tests.js index 53894986124..32e936f5333 100644 --- a/frontend/test/__runner__/cypress-runner-run-tests.js +++ b/frontend/test/__runner__/cypress-runner-run-tests.js @@ -58,6 +58,7 @@ const runCypress = async (baseUrl, exitFunction) => { } const defaultConfig = { + browser: "chrome", configFile: "frontend/test/__support__/e2e/cypress.json", config: { baseUrl, diff --git a/package.json b/package.json index cc879b4d502..fa07e7a256c 100644 --- a/package.json +++ b/package.json @@ -300,8 +300,8 @@ "test-cypress": "yarn build && ./bin/build-for-test && yarn test-cypress-no-build", "test-cypress-open": "./bin/build-for-test && yarn test-cypress-no-build --open", "test-cypress-open-no-backend": "E2E_HOST='http://localhost:3000' yarn test-cypress-no-build --open", - "test-cypress-no-build": "yarn && ELECTRON_EXTRA_LAUNCH_ARGS=\"--force-prefers-reduced-motion\" babel-node ./frontend/test/__runner__/run_cypress_tests.js", - "test-visual": "ELECTRON_EXTRA_LAUNCH_ARGS=\"--force-prefers-reduced-motion\" yarn build && ./bin/build-for-test && yarn test-visual-no-build", + "test-cypress-no-build": "yarn && babel-node ./frontend/test/__runner__/run_cypress_tests.js", + "test-visual": "yarn build && ./bin/build-for-test && yarn test-visual-no-build", "test-visual-no-build": "percy exec -- yarn test-cypress-no-build --spec \"./frontend/test/metabase-visual/**/*.cy.spec.js\"", "test-visual-open": "percy exec -- yarn test-cypress-open", "prepare": "husky install", -- GitLab