Skip to content

The easy-to-use open source Business Intelligence and Embedded Analytics tool that lets everyone work with data :bar_chart:

Sunset e2e cross-version tests (#65269)

Nemanja Glumac90f2e42b19db
diff --git a/.github/file-paths.yaml b/.github/file-paths.yaml
index a368c36297e..92dd1aae98c 100644
--- a/.github/file-paths.yaml
+++ b/.github/file-paths.yaml
@@ -127,10 +127,6 @@ e2e_ci: &e2e_ci
e2e_specs: &e2e_specs
- e2e/!(test-host-app)**/*.cy.*.{js,ts}
-e2e_cross_version: &e2e_cross_version
- - ".github/workflows/e2e-cross-version.yml"
- - "e2e/test/scenarios/cross-version/**"
-
e2e_embedding_sdk:
- *frontend_embedding_sdk_ci
- *sources
diff --git a/.github/workflows/e2e-cross-version.yml b/.github/workflows/e2e-cross-version.yml
deleted file mode 100644
index a6c7e8b6b03..00000000000
--- a/.github/workflows/e2e-cross-version.yml
+++ /dev/null
@@ -1,175 +0,0 @@
-name: E2E Cross-version Tests
-
-on:
- schedule:
- - cron: '0 9 * * 1-5'
- pull_request:
- types: [opened, synchronize, reopened, ready_for_review]
-
-jobs:
- files-changed:
- name: Check which files changed
- # don't run this workflow on a cron for forks
- if: ${{ github.event_name != 'schedule' || github.repository == 'metabase/metabase' }}
- runs-on: ubuntu-22.04
- timeout-minutes: 3
- outputs:
- e2e_cross_version: ${{ steps.changes.outputs.e2e_cross_version }}
- steps:
- - uses: actions/checkout@v4
- - name: Test which files changed
- uses: dorny/[email protected]
- id: changes
- with:
- token: ${{ github.token }}
- filters: .github/file-paths.yaml
-
- cross-version-testing:
- needs: files-changed
- if: ${{ needs.files-changed.outputs.e2e_cross_version == 'true' || github.event_name == 'schedule'}}
- runs-on: ubuntu-22.04
- timeout-minutes: 20
- strategy:
- matrix:
- version: [
- # Major OSS upgrade
- { source: v0.42.2, target: v0.48.7 },
- # OSS upgrade
- { source: v0.41.3.1, target: v0.42.2 },
- # EE upgrade
- { source: v1.43.4, target: v1.44.0 },
- # EE downgrade
- { source: v1.42.0, target: v1.41.3.1 },
- # Cross-edition upgrade
- { source: v0.41.3.1, target: v1.42.2 }
- ]
- fail-fast: false
- env:
- CROSS_VERSION_SOURCE: ${{ matrix.version.source }}
- CROSS_VERSION_TARGET: ${{ matrix.version.target }}
-
- steps:
- - name: Checkout
- uses: actions/checkout@v4
- - name: Set source Docker image to OSS
- run: |
- echo "DOCKER_SOURCE_IMAGE=metabase/metabase:${{ matrix.version.source }}" >> $GITHUB_ENV
- if: startsWith(matrix.version.source, 'v0')
- - name: Set source Docker image to EE
- run: |
- echo "DOCKER_SOURCE_IMAGE=metabase/metabase-enterprise:${{ matrix.version.source }}" >> $GITHUB_ENV
- if: startsWith(matrix.version.source, 'v1')
- - name: Prepare front-end environment
- uses: ./.github/actions/prepare-frontend
- - name: Start Metabase ${{ matrix.version.source }}
- run: |
- docker run -d \
- -v $PWD/my-metabase:/metabase.db \
- -p 3000:3000 \
- -e MB_RUN_MODE=e2e \
- -e METASTORE_DEV_SERVER_URL=${{ secrets.METASTORE_DEV_SERVER_URL }} \
- -e CYPRESS_MB_ALL_FEATURES_TOKEN=${{ secrets.STAGING_MB_ALL_FEATURES_TOKEN }} \
- -e CYPRESS_MB_STARTER_CLOUD_TOKEN=${{ secrets.STAGING_MB_STARTER_CLOUD_TOKEN }} \
- -e CYPRESS_MB_PRO_CLOUD_TOKEN=${{ secrets.STAGING_MB_PRO_CLOUD_TOKEN }} \
- -e CYPRESS_MB_PRO_SELF_HOSTED_TOKEN=${{ secrets.STAGING_MB_PRO_SELF_HOSTED_TOKEN }} \
- --name metabase-${{ matrix.version.source }} \
- ${{ env.DOCKER_SOURCE_IMAGE }}
- - name: Wait for Metabase to start on port 3000
- run: while ! curl -s 'http://localhost:3000/api/health' | grep '{"status":"ok"}'; do sleep 1; done
- - name: Prepare Cypress environment
- id: cypress-prep
- uses: ./.github/actions/prepare-cypress
- - name: Run Cypress on the source
- run: |
- yarn cypress run \
- --browser ${{ steps.cypress-prep.outputs.chrome-path }} \
- --config-file e2e/test/scenarios/cross-version/source/shared/cross-version-source.config.js \
- --spec e2e/test/scenarios/cross-version/source/**/*.cy.spec.js
- - name: Stop Metabase ${{ matrix.version.source }}
- run: docker stop metabase-${{ matrix.version.source }}
-
- - name: Set target Docker image to OSS
- run: |
- echo "DOCKER_TARGET_IMAGE=metabase/metabase:${{ matrix.version.source }}" >> $GITHUB_ENV
- if: startsWith(matrix.version.source, 'v0')
- - name: Set target Docker image to EE
- run: |
- echo "DOCKER_TARGET_IMAGE=metabase/metabase-enterprise:${{ matrix.version.source }}" >> $GITHUB_ENV
- if: startsWith(matrix.version.source, 'v1')
- - name: Start Metabase ${{ matrix.version.target }}
- run: |
- docker run -d \
- -v $PWD/my-metabase:/metabase.db \
- -p 3001:3000 \
- -e MB_RUN_MODE=e2e \
- -e METASTORE_DEV_SERVER_URL=${{ secrets.METASTORE_DEV_SERVER_URL }} \
- -e CYPRESS_MB_ALL_FEATURES_TOKEN=${{ secrets.STAGING_MB_ALL_FEATURES_TOKEN }} \
- -e CYPRESS_MB_STARTER_CLOUD_TOKEN=${{ secrets.STAGING_MB_STARTER_CLOUD_TOKEN }} \
- -e CYPRESS_MB_PRO_CLOUD_TOKEN=${{ secrets.STAGING_MB_PRO_CLOUD_TOKEN }} \
- -e CYPRESS_MB_PRO_SELF_HOSTED_TOKEN=${{ secrets.STAGING_MB_PRO_SELF_HOSTED_TOKEN }} \
- --name metabase-${{ matrix.version.target }} \
- ${{ env.DOCKER_TARGET_IMAGE }}
- - name: Wait for Metabase to start on port 3001
- run: while ! curl -s 'http://localhost:3001/api/health' | grep '{"status":"ok"}'; do sleep 1; done
- - name: Run Cypress on the target
- run: |
- yarn cypress run \
- --browser ${{ steps.cypress-prep.outputs.chrome-path }} \
- --config-file e2e/test/scenarios/cross-version/target/shared/cross-version-target.config.js \
- --spec e2e/test/scenarios/cross-version/target/**/*.cy.spec.js
- - name: Upload Cypress Artifacts upon failure
- uses: actions/upload-artifact@v4
- if: failure()
- with:
- name: cypress-artifacts-${{ matrix.version.source}}-to-${{ matrix.version.target }}
- path: |
- ./cypress
- if-no-files-found: ignore
- notify-on-failure:
- needs: cross-version-testing
- if: ${{ always() && contains(needs.*.result, 'failure') && github.event_name == 'schedule' }}
- name: Cross-version test failure
- runs-on: ubuntu-22.04
- timeout-minutes: 5
- steps:
- - uses: actions/setup-node@v4
- with:
- node-version: lts/Jod # 22.x.x
- - run: npm install @slack/web-api
- - name: notify slack of failure
- uses: actions/github-script@v7
- with:
- script: | # js
- const FAILED_RUN_URL = "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}";
- const REF_NAME = "${{ github.ref_name }}";
-
- // notify slack of failure
- const { WebClient } = require('@slack/web-api');
- const slack = new WebClient('${{ secrets.SLACK_BOT_TOKEN }}');
-
- await slack.chat.postMessage({
- channel: 'engineering-ci',
- text: 'Cross-version Tests Have Failed',
- blocks: [
- {
- "type": "header",
- "text": {
- "type": "plain_text",
- "text": `:broken_heart: Cross-version tests are failing on ${REF_NAME}`,
- "emoji": true,
- }
- },
- ],
- attachments: [{
- color: "#BF40BF",
- blocks: [
- {
- "type": "section",
- "text": {
- "type": "mrkdwn",
- "text": `See <${FAILED_RUN_URL}|failing run details>.`
- }
- },
- ]
- }]
- });
diff --git a/e2e/support/config.js b/e2e/support/config.js
index 3cf68f82646..091d28d34ee 100644
--- a/e2e/support/config.js
+++ b/e2e/support/config.js
@@ -30,9 +30,6 @@ const snowplowMicroUrl = process.env["MB_SNOWPLOW_URL"];
const isQaDatabase = process.env["QA_DB_ENABLED"] === "true";
-const sourceVersion = process.env["CROSS_VERSION_SOURCE"];
-const targetVersion = process.env["CROSS_VERSION_TARGET"];
-
const isEmbeddingSdk = process.env.CYPRESS_IS_EMBEDDING_SDK === "true";
// docs say that tsconfig paths should handle aliases, but they don't
@@ -53,7 +50,7 @@ const assetsResolverPlugin = {
};
// these are special and shouldn't be chunked out arbitrarily
-const specBlacklist = ["/embedding-sdk/", "/cross-version/"];
+const specBlacklist = ["/embedding-sdk/"];
function getSplittableSpecs(specs) {
return specs.filter((spec) => {
@@ -152,8 +149,6 @@ const defaultConfig = {
config.env.IS_ENTERPRISE = isEnterprise;
config.env.HAS_SNOWPLOW_MICRO = hasSnowplowMicro;
config.env.SNOWPLOW_MICRO_URL = snowplowMicroUrl;
- config.env.SOURCE_VERSION = sourceVersion;
- config.env.TARGET_VERSION = targetVersion;
require("@cypress/grep/src/plugin")(config);
@@ -238,18 +233,6 @@ const snapshotsConfig = {
video: false,
};
-const crossVersionSourceConfig = {
- ...defaultConfig,
- baseUrl: "http://localhost:3000",
- specPattern: "e2e/test/scenarios/cross-version/source/**/*.cy.spec.{js,ts}",
-};
-
-const crossVersionTargetConfig = {
- ...defaultConfig,
- baseUrl: "http://localhost:3001",
- specPattern: "e2e/test/scenarios/cross-version/target/**/*.cy.spec.{js,ts}",
-};
-
const stressTestConfig = {
...defaultConfig,
retries: 0,
@@ -279,7 +262,5 @@ module.exports = {
mainConfig,
snapshotsConfig,
stressTestConfig,
- crossVersionSourceConfig,
- crossVersionTargetConfig,
embeddingSdkComponentTestConfig,
};
diff --git a/e2e/support/helpers/e2e-table-metadata-helpers.js b/e2e/support/helpers/e2e-table-metadata-helpers.js
index 4e1c52ef2e6..35fe112117e 100644
--- a/e2e/support/helpers/e2e-table-metadata-helpers.js
+++ b/e2e/support/helpers/e2e-table-metadata-helpers.js
@@ -19,19 +19,3 @@ export const createSegment = ({
definition,
});
};
-
-export const createMetric = ({
- name,
- table_id,
- definition,
- description = null,
-}) => {
- cy.log(`Create a metric: ${name}`);
- // This endpoint doesn't exist anymore, but we need this helper for cross-version tests
- return cy.request("POST", "/api/metric", {
- name,
- description,
- table_id,
- definition,
- });
-};
diff --git a/e2e/test/scenarios/cross-version/helpers/cross-version-helpers.js b/e2e/test/scenarios/cross-version/helpers/cross-version-helpers.js
deleted file mode 100644
index 7b7310ce213..00000000000
--- a/e2e/test/scenarios/cross-version/helpers/cross-version-helpers.js
+++ /dev/null
@@ -1,186 +0,0 @@
-export function parseVersionString(versionString) {
- if (typeof versionString === "undefined") {
- return []; // Return empty array if versionString is undefined
- }
-
- const segments = versionString.match(/\d+/g);
- if (!segments) {
- return { version: versionString }; // Return versionString if no segments found
- }
-
- const segmentInts = segments.map((segment) => parseInt(segment, 10));
- const editionIndex = segmentInts[0];
-
- let edition = null;
- if (editionIndex === 1) {
- edition = "ee";
- } else if (editionIndex === 0) {
- edition = "oss";
- }
-
- return {
- version: versionString,
- edition: edition,
- majorVersion: segmentInts[1],
- minorVersion: segmentInts[2],
- patchVersion: segmentInts[3],
- };
-}
-
-// Versions in which a breaking GUI change was introduced. For example, version
-// 32 added a "What will you use Metabase for?" stage in the initial setup.
-
-// Change: Makes the "Sample Database" in setup more prominent
-// GitHub PR: https://github.com/metabase/metabase/pull/60511
-// Date: 2025-07-08
-// Author: nemanjaglumac
-const moreProminentSampleDbInSetupVersion = 56;
-
-// Change: Adds "What will you use Metabase for?" stage in the initial setup.
-// Git sha: d88d32e5e021ad4f47b5d740b78df73945e8ff82
-// Date: 2024-02-08
-// Author: npretto
-const metabasePurposeVersion = 49;
-
-// Change: Question save modal logic changes required different cypress logic
-// to click "Save" button as former cy.clck("Save") became ambiguous.
-// Git sha: f90e4db22e0b668600846e00ed4d1e28d8f92d95
-// Date: 2024-02-23
-// Author: markbastian
-const updatedCypressSaveLogicVersion = 49;
-
-// Change: Sample data times changed.
-// TODO: The specific version in which this changed hasn't been tracked down
-// yet, but this is an upper bound. If more cross-version checks are added for
-// earlier versions and this breaks, this number may need to be adjusted down.
-export const sampleDataTimesChangedVersion = 47;
-
-// Change: In older versions of metabase, when a question was loaded a modal was
-// presented stating "It's okay to play around with saved questions". The user
-// was required to press "Okay" to dismiss this modal. In later versions this
-// modal was not presented in the same location.
-// TODO: The specific version in which this changed hasn't been tracked down
-// yet, but this is an upper bound. If more cross-version checks are added for
-// earlier versions and this breaks, this number may need to be adjusted down.
-export const questionsAreOkToPlayWithModalVersion = 45;
-
-// Change: Older versions of Metabase presented a 3-panel display, the center
-// panel being "Custom question". In later generations, this was accessible via
-// clicking "New" -> "Question" at the top right corner in the UI.
-// TODO: The specific version in which this changed hasn't been tracked down
-// yet, but this is an upper bound. If more cross-version checks are added for
-// earlier versions and this breaks, this number may need to be adjusted down.
-export const newQuestionMenuVersion = 45;
-
-// Change: In older versions of metabase, area and line charts were selectable
-// Visualization types, but the actual operation to fill the area was to select
-// the "area" icon in the Display settings, which is really weird.
-// TODO: The specific version in which this changed hasn't been tracked down
-// yet, but this is an upper bound. If more cross-version checks are added for
-// earlier versions and this breaks, this number may need to be adjusted down.
-export const filledAreaIconRemovedVersion = 45;
-
-export function setupLanguage() {
- // Make sure English is the default selected language
- cy.findByText("English")
- .should("have.css", "background-color")
- .and("eq", "rgb(80, 158, 227)");
-
- cy.button("Next").click();
- cy.findByText("Your language is set to English");
-}
-
-export function setupInstance({ version, majorVersion }) {
- const companyLabel =
- version === "v0.41.3.1"
- ? "Your company or team name"
- : "Company or team name";
-
- const finalSetupButton = version === "v0.41.3.1" ? "Next" : "Finish";
-
- cy.findByLabelText("First name").type("Superuser");
- cy.findByLabelText("Last name").type("Tableton");
- cy.findByLabelText("Email").type("[email protected]");
- cy.findByLabelText(companyLabel).type("Metabase");
- cy.findByLabelText("Create a password").type("12341234");
- cy.findByLabelText("Confirm your password").type("12341234");
- cy.button("Next").click();
- cy.findByText("Hi, Superuser. Nice to meet you!");
-
- // A "What will you use Metabase for?" prompt exists in later versions.
- // If it exists, click through.
- if (majorVersion >= metabasePurposeVersion) {
- cy.button("Next").click();
- }
-
- const continueWithoutAddingDatabaseCopy =
- majorVersion >= moreProminentSampleDbInSetupVersion
- ? "Continue with sample data"
- : "I'll add my data later";
-
- cy.findByText(continueWithoutAddingDatabaseCopy).click();
- cy.findByText("I'll add my own data later");
-
- // Collection defaults to on and describes data collection
- cy.findByText("All collection is completely anonymous.");
- // turn collection off, which hides data collection description
- cy.findByLabelText(
- "Allow Metabase to anonymously collect usage events",
- ).click();
- cy.findByText("All collection is completely anonymous.").should("not.exist");
- cy.findByText(finalSetupButton).click();
- cy.findByText("Take me to Metabase").click();
-
- cy.location("pathname").should("eq", "/");
- cy.contains("Reviews");
-}
-
-export function newQuestion({ majorVersion }) {
- if (majorVersion < newQuestionMenuVersion) {
- cy.findByText("Custom question").click();
- } else {
- cy.button("New").click();
- cy.findByText("Question").click();
- }
-}
-
-export function saveQuestion({ majorVersion }) {
- if (majorVersion < updatedCypressSaveLogicVersion) {
- cy.button("Save").click();
- } else {
- cy.findByTestId("save-question-modal").within((modal) => {
- cy.findByText("Save").click();
- });
- }
-}
-
-export function assertTimelineData({ majorVersion }) {
- if (majorVersion < sampleDataTimesChangedVersion) {
- cy.get(".x.axis .tick")
- .should("contain", "Q1 - 2017")
- .and("contain", "Q1 - 2018")
- .and("contain", "Q1 - 2019")
- .and("contain", "Q1 - 2020");
- } else {
- cy.get(".x.axis .tick")
- .should("contain", "Q1 2023")
- .and("contain", "Q1 2024")
- .and("contain", "Q1 2025")
- .and("contain", "Q1 2026");
- }
-}
-
-export function dismissOkToPlayWithQuestionsModal({ majorVersion }) {
- if (majorVersion < questionsAreOkToPlayWithModalVersion) {
- cy.findByText("It's okay to play around with saved questions");
- cy.button("Okay").click();
- }
-}
-
-export function fillAreaUnderLineChart({ majorVersion }) {
- if (majorVersion < filledAreaIconRemovedVersion) {
- cy.findByTestId("sidebar-left").within((element) => {
- cy.icon("area").click();
- });
- }
-}
diff --git a/e2e/test/scenarios/cross-version/source/00-setup.cy.spec.js b/e2e/test/scenarios/cross-version/source/00-setup.cy.spec.js
deleted file mode 100644
index 9175ebd136c..00000000000
--- a/e2e/test/scenarios/cross-version/source/00-setup.cy.spec.js
+++ /dev/null
@@ -1,26 +0,0 @@
-import {
- setupInstance,
- setupLanguage,
-} from "e2e/test/scenarios/cross-version/helpers/cross-version-helpers.js";
-
-import { version } from "./helpers/cross-version-source-helpers";
-
-describe(`setup on ${version}`, () => {
- it("should set up metabase", () => {
- cy.visit("/");
- // It redirects to the setup page
- cy.location("pathname").should("eq", "/setup");
- // eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
- cy.findByText("Welcome to Metabase");
- // eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
- cy.findByText("Let's get started").click();
-
- setupLanguage(version);
- setupInstance(version);
-
- cy.visit("/admin");
- // Find an element on the admin page so we know we've landed.
- // eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
- cy.findByText("Setup");
- });
-});
diff --git a/e2e/test/scenarios/cross-version/source/01-generate-metadata.cy.spec.js b/e2e/test/scenarios/cross-version/source/01-generate-metadata.cy.spec.js
deleted file mode 100644
index 4fe79c95626..00000000000
--- a/e2e/test/scenarios/cross-version/source/01-generate-metadata.cy.spec.js
+++ /dev/null
@@ -1,9 +0,0 @@
-const { H } = cy;
-
-it("should generate metadata", () => {
- cy.signInAsAdmin();
-
- H.withSampleDatabase((SAMPLE_DATABASE) => {
- cy.writeFile("e2e/support/cypress_sample_database.json", SAMPLE_DATABASE);
- });
-});
diff --git a/e2e/test/scenarios/cross-version/source/02-datamodel.cy.spec.js b/e2e/test/scenarios/cross-version/source/02-datamodel.cy.spec.js
deleted file mode 100644
index 84d56c996d8..00000000000
--- a/e2e/test/scenarios/cross-version/source/02-datamodel.cy.spec.js
+++ /dev/null
@@ -1,158 +0,0 @@
-import { SAMPLE_DB_ID } from "e2e/support/cypress_data";
-import { SAMPLE_DATABASE } from "e2e/support/cypress_sample_database";
-import {
- createMetric,
- createSegment,
-} from "e2e/support/helpers/e2e-table-metadata-helpers";
-
-const { ORDERS, ORDERS_ID, REVIEWS, PRODUCTS, PEOPLE } = SAMPLE_DATABASE;
-
-const sampleDBDataModelPage = `/admin/datamodel/database/${SAMPLE_DB_ID}`;
-
-it("should configure data model settings", () => {
- cy.intercept("GET", "/api/segment").as("getSegments");
- cy.intercept("GET", "/api/metric").as("getMetrics");
-
- cy.signInAsAdmin();
-
- cy.visit("/admin/datamodel");
- cy.location("pathname").should("eq", sampleDBDataModelPage);
-
- // Remap ORDERS.PRODUCT_ID display value to PRODUCTS.TITLE
- cy.intercept("POST", `/api/field/${ORDERS.PRODUCT_ID}/dimension`).as(
- "updateProductId",
- );
-
- cy.get(".AdminList").findByText("Orders").click();
-
- cy.findByDisplayValue("Product ID")
- .parent()
- .parent()
- .find(".Icon-gear")
- .click();
-
- // eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
- cy.findByText("Use original value").click();
- // eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
- cy.findByText("Use foreign key").click();
- // eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
- cy.findByText("Title").click();
- cy.wait("@updateProductId");
-
- cy.visit(sampleDBDataModelPage);
-
- cy.get(".AdminList").findByText("Reviews").click();
- cy.intercept("POST", `/api/field/${REVIEWS.RATING}/values`).as(
- "remapRatingValues",
- );
-
- cy.findByDisplayValue("Rating").parent().parent().find(".Icon-gear").click();
-
- // eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
- cy.findByText("Use original value").click();
- // eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
- cy.findByText("Custom mapping").click();
- cy.wait("@remapRatingValues");
- // eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
- cy.findByText(
- "You might want to update the field name to make sure it still makes sense based on your remapping choices.",
- );
-
- const customMap = {
- 1: "Awful",
- 2: "Unpleasant",
- 3: "Meh",
- 4: "Enjoyable",
- 5: "Perfecto",
- };
-
- Object.entries(customMap).forEach(([key, value]) => {
- cy.findByDisplayValue(key).click().clear().type(value, { delay: 0 });
- });
-
- cy.button("Save").click();
- cy.wait("@remapRatingValues");
-
- // Hide PRODUCTS.EAN
- cy.visit(sampleDBDataModelPage);
- cy.get(".AdminList").findByText("Products").click();
-
- cy.intercept("PUT", `/api/field/${PRODUCTS.EAN}`).as("hideEan");
-
- cy.findByDisplayValue("Ean").parent().parent().contains("Everywhere").click();
-
- // eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
- cy.findByText("Do not include").click();
- cy.wait("@hideEan");
-
- cy.intercept("PUT", `/api/field/${PRODUCTS.PRICE}`).as("updatePriceField");
-
- cy.findByDisplayValue("Price")
- .parent()
- .parent()
- .findByText("No semantic type")
- .click();
-
- cy.get(".MB-Select").should("be.visible");
-
- cy.get(".MB-Select")
- .scrollTo("top")
- .within(() => {
- cy.findByPlaceholderText("Find...").type("Pr");
- cy.findByText("Price").click();
- });
- cy.wait("@updatePriceField");
- // eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
- cy.findByText("US Dollar").click();
- // eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
- cy.findByText("Euro").click();
- cy.wait("@updatePriceField");
-
- // Hide PEOPLE.PASSWORD
- cy.get(".AdminList").findByText("People").click();
-
- cy.intercept("PUT", `/api/field/${PEOPLE.PASSWORD}`).as("hidePassword");
-
- cy.findByDisplayValue("Password")
- .parent()
- .parent()
- .contains("Everywhere")
- .click();
-
- // eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
- cy.findByText("Do not include").click();
- cy.wait("@hidePassword");
-
- const metric = {
- name: "Revenue",
- description: "Sum of orders subtotal",
- table_id: ORDERS_ID, // legacy api
- definition: {
- "source-table": ORDERS_ID,
- aggregation: [["sum", ["field", ORDERS.SUBTOTAL, null]]],
- },
- };
-
- const segment = {
- name: "Large Purchases",
- description: "Orders over $100.",
- table_id: ORDERS_ID,
- definition: {
- "source-table": ORDERS_ID,
- filter: [">", ["field", ORDERS.TOTAL, null], 100],
- },
- };
-
- createMetric(metric); // legacy api
- createSegment(segment);
-
- cy.visit("/admin/datamodel/segments");
- cy.wait("@getSegments");
- // eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
- cy.findByText(segment.name);
-
- cy.visit("/admin/datamodel/metrics");
- cy.wait("@getMetrics");
- // eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
- cy.findByText(metric.name);
-});
diff --git a/e2e/test/scenarios/cross-version/source/03-questions.cy.spec.js b/e2e/test/scenarios/cross-version/source/03-questions.cy.spec.js
deleted file mode 100644
index 55b2c174e1f..00000000000
--- a/e2e/test/scenarios/cross-version/source/03-questions.cy.spec.js
+++ /dev/null
@@ -1,136 +0,0 @@
-const { H } = cy;
-import {
- fillAreaUnderLineChart,
- newQuestion,
- saveQuestion,
-} from "e2e/test/scenarios/cross-version/helpers/cross-version-helpers.js";
-
-import { version } from "./helpers/cross-version-source-helpers";
-
-it("should create questions", () => {
- cy.signInAsAdmin();
-
- cy.visit("/question/new");
-
- newQuestion(version);
-
- // eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
- cy.findByText("Orders").click();
-
- cy.icon("join_left_outer").click();
- // eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
- cy.findByText("Products").click();
- // Make sure `on` condition is populated automatically
- // eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
- cy.findByText("Product ID").click();
-
- // eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
- cy.findByText("Add filters to narrow your answer").click();
- // eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
- cy.findByText("Large Purchases").click();
-
- // eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
- cy.findByText("Pick the metric you want to see").click();
- // eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
- cy.findByText(/^Average of/).click();
-
- cy.findByRole("heading", { name: /Products?/ }).click();
- // eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
- cy.findByText("Rating").click();
-
- // eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
- cy.findByText("Pick a column to group by").click();
-
- // Older versions were Products, newer use Product
- cy.get(".List-section-title")
- .contains(/Products?/)
- .click();
-
- // eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
- cy.findByText("Category").click();
-
- H.visualize();
-
- cy.get(".bar").should("have.length", 4);
-
- cy.findByTestId("viz-settings-button").click();
-
- //NOTE: In older versions of Metabase, Display is selected by default. Newer
- // versions default to Data. This will ensure we've selected the right tab
- // either way.
- // eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
- cy.findByText("Display").click();
-
- // eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
- cy.contains("Show values on data points").next().click();
- // eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
- cy.contains("3.71");
-
- // eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
- cy.findByText("Save").click();
- cy.findByLabelText("Name").clear().type("Rating of Best-selling Products");
- cy.findByLabelText("Description").type(
- "The average rating of our top selling products broken down into categories.",
- { delay: 0 },
- );
-
- saveQuestion(version);
-
- // eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
- cy.findByText("Not now").click();
-
- cy.visit("/question/new");
-
- newQuestion(version);
-
- // eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
- cy.findByText(/Sample (Dataset|Database)/).click();
- // eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
- cy.findByText("Orders").click();
-
- // eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
- cy.findByText("Pick the metric you want to see").click();
- // eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
- cy.findByText("Common Metrics").click();
- // eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
- cy.findByText("Revenue").click();
-
- // eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
- cy.findByText("Pick a column to group by").click();
- // eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
- cy.findByText("Created At")
- .closest(".List-item")
- .findByText("by month")
- .click({ force: true });
- // eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
- cy.findByText("Quarter").click();
- // eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
- cy.findByText("Created At: Quarter");
-
- H.visualize();
- cy.get("circle");
-
- cy.findByTestId("viz-type-button").click();
- cy.findByTestId("Area-button").click();
-
- // eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
- cy.findByText("Display").click();
-
- fillAreaUnderLineChart(version);
-
- // eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
- cy.findByText("Goal line").next().click();
- cy.findByDisplayValue("0").type("100000").blur();
- cy.get(".line");
- // eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
- cy.findByText("Goal");
-
- // eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
- cy.findByText("Save").click();
- cy.findByLabelText("Name").clear().type("Quarterly Revenue");
-
- saveQuestion(version);
-
- // eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
- cy.findByText("Not now").click();
-});
diff --git a/e2e/test/scenarios/cross-version/source/helpers/cross-version-source-helpers.js b/e2e/test/scenarios/cross-version/source/helpers/cross-version-source-helpers.js
deleted file mode 100644
index fd0d967def0..00000000000
--- a/e2e/test/scenarios/cross-version/source/helpers/cross-version-source-helpers.js
+++ /dev/null
@@ -1,3 +0,0 @@
-import { parseVersionString } from "e2e/test/scenarios/cross-version/helpers/cross-version-helpers.js";
-
-export const version = parseVersionString(Cypress.env("SOURCE_VERSION"));
diff --git a/e2e/test/scenarios/cross-version/source/shared/cross-version-source.config.js b/e2e/test/scenarios/cross-version/source/shared/cross-version-source.config.js
deleted file mode 100644
index c1d9d85c38c..00000000000
--- a/e2e/test/scenarios/cross-version/source/shared/cross-version-source.config.js
+++ /dev/null
@@ -1,5 +0,0 @@
-const { defineConfig } = require("cypress");
-
-const { crossVersionSourceConfig } = require("e2e/support/config");
-
-module.exports = defineConfig({ e2e: crossVersionSourceConfig });
diff --git a/e2e/test/scenarios/cross-version/target/helpers/cross-version-target-helpers.js b/e2e/test/scenarios/cross-version/target/helpers/cross-version-target-helpers.js
deleted file mode 100644
index 50008974091..00000000000
--- a/e2e/test/scenarios/cross-version/target/helpers/cross-version-target-helpers.js
+++ /dev/null
@@ -1,3 +0,0 @@
-import { parseVersionString } from "e2e/test/scenarios/cross-version/helpers/cross-version-helpers.js";
-
-export const version = parseVersionString(Cypress.env("TARGET_VERSION"));
diff --git a/e2e/test/scenarios/cross-version/target/shared/cross-version-target.config.js b/e2e/test/scenarios/cross-version/target/shared/cross-version-target.config.js
deleted file mode 100644
index d7da3526c9f..00000000000
--- a/e2e/test/scenarios/cross-version/target/shared/cross-version-target.config.js
+++ /dev/null
@@ -1,5 +0,0 @@
-const { defineConfig } = require("cypress");
-
-const { crossVersionTargetConfig } = require("e2e/support/config");
-
-module.exports = defineConfig({ e2e: crossVersionTargetConfig });
diff --git a/e2e/test/scenarios/cross-version/target/smoke.cy.spec.js b/e2e/test/scenarios/cross-version/target/smoke.cy.spec.js
deleted file mode 100644
index 04a7efd5dfd..00000000000
--- a/e2e/test/scenarios/cross-version/target/smoke.cy.spec.js
+++ /dev/null
@@ -1,67 +0,0 @@
-import {
- assertTimelineData,
- dismissOkToPlayWithQuestionsModal,
-} from "e2e/test/scenarios/cross-version/helpers/cross-version-helpers";
-import { version } from "e2e/test/scenarios/cross-version/source/helpers/cross-version-source-helpers.js";
-
-describe(`smoke test the migration to the version ${version}`, () => {
- it("should already be set up", () => {
- cy.intercept("POST", "/api/card/*/query").as("cardQuery");
-
- cy.visit("/");
- // eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
- cy.findByText("Sign in to Metabase");
-
- cy.findByLabelText("Email address").type("[email protected]");
- cy.findByLabelText("Password").type("12341234");
- cy.button("Sign in").click();
-
- cy.findByPlaceholderText("Search…");
-
- // Question 1
- cy.visit("/collection/root");
- // eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
- cy.findByText("Quarterly Revenue").click();
- cy.wait("@cardQuery");
-
- dismissOkToPlayWithQuestionsModal(version);
-
- cy.get("circle");
- cy.get(".line");
- // eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
- cy.findByText("Goal");
- cy.get(".x-axis-label").invoke("text").should("eq", "Created At");
- cy.get(".y-axis-label").invoke("text").should("eq", "Revenue");
-
- assertTimelineData(version);
-
- cy.get(".y.axis .tick")
- .should("contain", "20,000")
- .and("contain", "100,000")
- .and("contain", "140,000");
-
- // Question 2
- cy.visit("/collection/root");
- // eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
- cy.findByText("Rating of Best-selling Products").click();
- cy.wait("@cardQuery");
-
- cy.get(".bar").should("have.length", 4);
- cy.get(".x.axis .tick")
- .should("contain", "Gizmo")
- .and("contain", "Gadget")
- .and("contain", "Doohickey")
- .and("contain", "Widget");
-
- cy.get(".value-labels")
- .should("contain", "3.27")
- .and("contain", "3.3")
- .and("contain", "3.71")
- .and("contain", "3.4");
-
- cy.get(".x-axis-label").invoke("text").should("eq", "Products → Category");
- cy.get(".y-axis-label")
- .invoke("text")
- .should("eq", "Average of Products → Rating");
- });
-});