Skip to content

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

Delete skipped e2e tests (#81011)

Nemanja Glumac15ef5d5b9731
diff --git a/.github/workflows/e2e-coverage-shard.yml b/.github/workflows/e2e-coverage-shard.yml
index 549a2812c6b..95e8a4fb6b6 100644
--- a/.github/workflows/e2e-coverage-shard.yml
+++ b/.github/workflows/e2e-coverage-shard.yml
@@ -97,7 +97,7 @@ jobs:
CYPRESS_BROWSER: ${{ steps.cypress-prep.outputs.chrome-path }}
run: |
node e2e/runner/run_cypress_ci.js e2e \
- --expose grepTags="-@mongo+-@python+-@OSS+-@skip"
+ --expose grepTags="-@mongo+-@python+-@OSS"
# Don't let a single failing/flaky spec abort the shard — we still want
# coverage from the specs that did run.
continue-on-error: true
diff --git a/.github/workflows/e2e-test.yml b/.github/workflows/e2e-test.yml
index b02f45d367b..37fac3fe45f 100644
--- a/.github/workflows/e2e-test.yml
+++ b/.github/workflows/e2e-test.yml
@@ -181,7 +181,7 @@ jobs:
run: |
echo "Running tests with specs: $SPEC_PATH"
node e2e/runner/run_cypress_ci.js e2e \
- --expose grepTags="-@mongo+-@python+-@OSS+-@skip" \
+ --expose grepTags="-@mongo+-@python+-@OSS" \
--spec "$SPEC_PATH"
# Keep this step continue-on-error because the quarantine logic controls whether it ultimately fails.
continue-on-error: true
@@ -198,7 +198,7 @@ jobs:
run: |
echo "Running tests with specs: $SPEC_PATH"
node e2e/runner/run_cypress_ci.js e2e \
- --expose grepTags="${{inputs.tags && format('{0}+-@skip', inputs.tags) || '-@mongo+-@python+-@OSS+-@skip'}}" \
+ --expose grepTags="${{ inputs.tags || '-@mongo+-@python+-@OSS' }}" \
--spec "$SPEC_PATH"
# Keep this step continue-on-error because the quarantine logic controls whether it ultimately fails.
continue-on-error: true
diff --git a/e2e/test/scenarios/admin-2/people.cy.spec.js b/e2e/test/scenarios/admin-2/people.cy.spec.js
index 5907ecaf5d4..b3798ae5f3d 100644
--- a/e2e/test/scenarios/admin-2/people.cy.spec.js
+++ b/e2e/test/scenarios/admin-2/people.cy.spec.js
@@ -8,12 +8,11 @@ import {
NORMAL_USER_ID,
} from "e2e/support/cypress_sample_instance_data";
-const { sandboxed, normal, admin, nodata, nocollection } = USERS;
+const { normal, admin, nocollection } = USERS;
const { ALL_USERS_GROUP, DATA_GROUP } = USER_GROUPS;
const TOTAL_USERS = Object.entries(USERS).length;
const TOTAL_GROUPS = Object.entries(USER_GROUPS).length;
-const { ORDERS, ORDERS_ID } = SAMPLE_DATABASE;
-const { COLLECTION_GROUP } = USER_GROUPS;
+const { ORDERS_ID } = SAMPLE_DATABASE;
const TEST_USER = {
first_name: "Testy",
@@ -26,8 +25,6 @@ const adminUserName = H.getFullName(admin);
const noCollectionUserName = H.getFullName(nocollection);
const normalUserName = H.getFullName(normal);
-const totalUsers = Object.keys(USERS).length;
-
describe("scenarios > admin > people", () => {
beforeEach(() => {
cy.intercept("GET", "/api/permissions/group").as("getGroups");
@@ -892,77 +889,6 @@ describe("scenarios > admin > people > group managers", () => {
});
});
-// TODO: remove skip when this issue gets fixed. Initial attempt: https://github.com/metabase/metabase/pull/23825,
-// reverted in https://github.com/metabase/metabase/pull/24760 to fix a security vulnerability.
-describe("issue 23689", { tags: "@skip" }, () => {
- function findUserByFullName(user) {
- const { first_name, last_name } = user;
- return cy.findByText(`${first_name} ${last_name}`);
- }
-
- function visitGroupPermissionsPage(groupId) {
- cy.visit(`/admin/people/groups/${groupId}`);
- cy.wait("@membership");
- }
-
- beforeEach(() => {
- cy.intercept("GET", "/api/permissions/membership").as("membership");
-
- H.restore();
- cy.signInAsAdmin();
- H.activateToken("pro-self-hosted");
-
- visitGroupPermissionsPage(COLLECTION_GROUP);
-
- // eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
- cy.findByText("3 members");
-
- findUserByFullName(normal);
- findUserByFullName(nodata);
-
- // Make sandboxed user a group manager
- findUserByFullName(sandboxed)
- .closest("tr")
- .findByTestId("user-type-toggle")
- .click({ force: true });
-
- // Sanity check instead of waiting for the PUT request
- // eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
- cy.findByText("Manager");
-
- cy.sandboxTable({
- table_id: ORDERS_ID,
- attribute_remappings: {
- attr_uid: ["dimension", ["field", ORDERS.USER_ID, null]],
- },
- });
-
- cy.signOut();
- cy.signInAsSandboxedUser();
- });
-
- it("sandboxed group manager should see all other members (metabase#23689)", () => {
- visitGroupPermissionsPage(COLLECTION_GROUP);
-
- // eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
- cy.findByText("3 members");
-
- findUserByFullName(sandboxed);
- findUserByFullName(normal);
- findUserByFullName(nodata);
-
- cy.visit("/admin/people");
- cy.wait("@membership");
-
- // eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
- cy.findByText(`${totalUsers} people found`);
- findUserByFullName(sandboxed);
- findUserByFullName(normal);
- findUserByFullName(nodata);
- findUserByFullName(nocollection);
- });
-});
-
function showUserOptions(full_name) {
cy.findByText(full_name)
.closest("tr")
diff --git a/e2e/test/scenarios/admin/datamodel/datamodel.cy.spec.ts b/e2e/test/scenarios/admin/datamodel/datamodel.cy.spec.ts
index e6d0dfb239a..fce8d48e242 100644
--- a/e2e/test/scenarios/admin/datamodel/datamodel.cy.spec.ts
+++ b/e2e/test/scenarios/admin/datamodel/datamodel.cy.spec.ts
@@ -9,15 +9,8 @@ import { ORDERS_QUESTION_ID } from "e2e/support/cypress_sample_instance_data";
import type { TableId } from "metabase-types/api";
const { H } = cy;
-const {
- ORDERS,
- ORDERS_ID,
- PEOPLE_ID,
- PRODUCTS,
- REVIEWS,
- REVIEWS_ID,
- PRODUCTS_ID,
-} = SAMPLE_DATABASE;
+const { ORDERS, ORDERS_ID, PEOPLE_ID, REVIEWS, REVIEWS_ID, PRODUCTS_ID } =
+ SAMPLE_DATABASE;
const { ALL_USERS_GROUP } = USER_GROUPS;
const { FieldSection, PreviewSection, TablePicker, TableSection } = H.DataModel;
@@ -423,54 +416,6 @@ describe("scenarios > admin > datamodel", () => {
H.queryBuilderHeader().findByText("View-only").should("be.visible");
});
-
- it("question with joins (metabase#15947-2)", { tags: "@skip" }, () => {
- H.createQuestion({
- name: "15947",
- query: {
- "source-table": ORDERS_ID,
- joins: [
- {
- fields: "all",
- "source-table": PRODUCTS_ID,
- condition: [
- "=",
- ["field", ORDERS.PRODUCT_ID, null],
- ["field", PRODUCTS.ID, { "join-alias": "Products" }],
- ],
- alias: "Products",
- },
- ],
- filter: [
- "and",
- ["=", ["field", ORDERS.QUANTITY, null], 1],
- [
- ">",
- ["field", PRODUCTS.RATING, { "join-alias": "Products" }],
- 3,
- ],
- ],
- aggregation: [
- ["sum", ["field", ORDERS.TOTAL, null]],
- [
- "sum",
- ["field", PRODUCTS.RATING, { "join-alias": "Products" }],
- ],
- ],
- breakout: [
- ["field", ORDERS.CREATED_AT, { "temporal-unit": "year" }],
- ["field", PRODUCTS.CATEGORY, { "join-alias": "Products" }],
- ],
- },
- }).then(({ body: { id: QUESTION_ID } }) => {
- turnTableVisibilityOff(PRODUCTS_ID);
- cy.visit(`/question/${QUESTION_ID}/notebook`);
- cy.findByText("Products");
- cy.findByText("Quantity is equal to 1");
- cy.findByText("Rating is greater than 3");
- H.queryBuilderHeader().findByText("View-only").should("be.visible");
- });
- });
});
});
});
diff --git a/e2e/test/scenarios/collections/personal-collections.cy.spec.js b/e2e/test/scenarios/collections/personal-collections.cy.spec.js
index 4d285fcf012..255dff6dbf0 100644
--- a/e2e/test/scenarios/collections/personal-collections.cy.spec.js
+++ b/e2e/test/scenarios/collections/personal-collections.cy.spec.js
@@ -16,40 +16,6 @@ describe("personal collections", () => {
cy.signInAsAdmin();
});
- /**
- * This reproduction is here only as a placeholder until a proper backend tests is added.
- *
- * Not entirely sure how this issue will be resolved!
- * Thus, test might not work as expected by that point.
- *
- * For example:
- * 1. FE might decide not to fetch the full collection tree on the home page or
- * 2. BE might alter this endpoint
- *
- * TODO:
- * - When the solution for this problem is ready, either adjust the test or completely remove it!
- */
-
- it(
- "shouldn't get API response containing all other personal collections when visiting the home page (metabase#24330)",
- { tags: "@skip" },
- () => {
- cy.intercept("GET", "/api/collection/tree*").as("getCollections");
-
- cy.visit("/");
-
- cy.wait("@getCollections").then(({ response: { body } }) => {
- const personalCollections = body.filter(({ personal_owner_id }) => {
- return personal_owner_id !== null;
- });
-
- // Admin can only see their own personal collection, so this list should return only that
- // Loading all other users' personal collections can lead to performance issues!
- expect(personalCollections).to.have.lengthOf(1);
- });
- },
- );
-
it("should see a link to other users' personal collections only if there are other users", () => {
cy.intercept("GET", "/api/session/properties", (req) => {
req.continue((res) => {
diff --git a/e2e/test/scenarios/custom-column/custom-column-1.cy.spec.js b/e2e/test/scenarios/custom-column/custom-column-1.cy.spec.js
index 2b4aca78dfe..7f8c2c05afe 100644
--- a/e2e/test/scenarios/custom-column/custom-column-1.cy.spec.js
+++ b/e2e/test/scenarios/custom-column/custom-column-1.cy.spec.js
@@ -164,32 +164,6 @@ describe("scenarios > question > custom column", () => {
H.getNotebookStep("summarize").findByText("UserLAT").should("be.visible");
});
- // flaky test (#19454)
- it(
- "should show info popovers when hovering over custom column dimensions in the summarize sidebar",
- { tags: "@skip" },
- () => {
- H.openOrdersTable({ mode: "notebook" });
- cy.findByLabelText("Custom column").click();
-
- H.enterCustomColumnDetails({ formula: "1 + 1", name: "Math" });
- cy.button("Done").click();
-
- H.visualize();
-
- H.summarize();
-
- // eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
- cy.findByText("Group by")
- .parent()
- .findByText("Math")
- .trigger("mouseenter");
-
- H.popover().contains("Math");
- H.popover().contains("No description");
- },
- );
-
it("can create a custom column with an existing column name", () => {
const customFormulas = [
{
diff --git a/e2e/test/scenarios/custom-column/custom-column-reproductions-1.cy.spec.js b/e2e/test/scenarios/custom-column/custom-column-reproductions-1.cy.spec.js
index 7b772aceab6..f9400a3cf36 100644
--- a/e2e/test/scenarios/custom-column/custom-column-reproductions-1.cy.spec.js
+++ b/e2e/test/scenarios/custom-column/custom-column-reproductions-1.cy.spec.js
@@ -6,42 +6,6 @@ import { SAMPLE_DATABASE } from "e2e/support/cypress_sample_database";
const { PRODUCTS, PRODUCTS_ID, ORDERS, ORDERS_ID } = SAMPLE_DATABASE;
-describe("issue 12445", { tags: ["@external", "@skip"] }, () => {
- const CC_NAME = "Abbr";
-
- beforeEach(() => {
- H.restore("mysql-8");
- cy.signInAsAdmin();
- });
-
- it("should correctly apply substring for a custom column (metabase#12445)", () => {
- H.withDatabase(2, ({ PEOPLE, PEOPLE_ID }) => {
- cy.log("Create a question with `Source` column and abbreviated CC");
- H.createQuestion(
- {
- name: "12445",
- query: {
- "source-table": PEOPLE_ID,
- breakout: [["expression", CC_NAME]],
- expressions: {
- [CC_NAME]: [
- "substring",
- ["field", PEOPLE.SOURCE, null],
- 1,
- 4, // we want 4 letter abbreviation
- ],
- },
- },
- database: 2,
- },
- { visitQuestion: true },
- );
-
- cy.findByText(CC_NAME);
- cy.findByText("Goog");
- });
- });
-});
describe("issue 13751", { tags: "@external" }, () => {
const CC_NAME = "C-States";
const PG_DB_NAME = "QA Postgres12";
@@ -81,42 +45,6 @@ describe("issue 13751", { tags: "@external" }, () => {
});
});
-describe(
- "postgres > question > custom columns",
- { tags: ["@external", "@skip"] },
- () => {
- const PG_DB_NAME = "QA Postgres12";
-
- // Ironically, both Prettier and Cypress remove escape characters from our code as well
- // We're testing for the literal sting `(?<=\/\/)[^\/]*`, but we need to escape the escape characters to make it work
- const ESCAPED_REGEX = "(?<=\\/\\/)[^\\/]*";
-
- beforeEach(() => {
- H.restore("postgres-12");
- cy.signInAsAdmin();
-
- H.startNewQuestion();
- // eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
- cy.findByText(PG_DB_NAME).should("be.visible").click();
- cy.findByTextEnsureVisible("People").click();
- });
-
- it("should not remove regex escape characters (metabase#14517)", () => {
- cy.log("Create custom column using `regexExtract()`");
- cy.findByLabelText("Custom Column").click();
- H.popover().within(() => {
- cy.get("[contenteditable='true']")
- .type(`regexExtract([State], "${ESCAPED_REGEX}")`)
- .blur();
-
- // It removes escaped characters already on blur
- cy.log("Reported failing on v0.36.4");
- cy.contains(ESCAPED_REGEX);
- });
- });
- },
-);
-
describe("issue 14843", () => {
const { PEOPLE, PEOPLE_ID } = SAMPLE_DATABASE;
const CC_NAME = "City Length";
@@ -674,78 +602,6 @@ describe("issue 24922", () => {
});
});
-describe("issue 25189", { tags: "@skip" }, () => {
- const ccTable = "Custom Created";
- const ccFunction = "Custom Total";
-
- const questionDetails = {
- name: "25189",
- query: {
- "source-table": ORDERS_ID,
- limit: 5,
- expressions: {
- [ccTable]: ["field", ORDERS.CREATED_AT, null],
- [ccFunction]: [
- "case",
- [[[">", ["field", ORDERS.TOTAL, null], 100], "Yay"]],
- {
- default: "Nay",
- },
- ],
- },
- },
- };
-
- beforeEach(() => {
- cy.intercept("POST", "/api/dataset").as("dataset");
-
- H.restore();
- cy.signInAsAdmin();
-
- H.createQuestion(questionDetails).then(
- ({ body: { id: baseQuestionId } }) => {
- H.createQuestion(
- {
- name: "Nested 25189",
- query: { "source-table": `card__${baseQuestionId}` },
- },
- { visitQuestion: true },
- );
- },
- );
- });
-
- it("custom column referencing only a single column should not be dropped in a nested question (metabase#25189)", () => {
- // 1. Column should not be dropped
- cy.findAllByTestId("header-cell")
- .should("contain", ccFunction)
- .and("contain", ccTable);
-
- // 2. We shouldn't see duplication in the bulk filter modal
- H.filter();
- H.modal().within(() => {
- // Implicit assertion - will fail if more than one element is found
- cy.findByText(ccFunction);
- cy.findByText(ccTable);
-
- cy.findByText("Today").click();
- cy.button("Apply Filters").click();
- });
-
- cy.wait("@dataset");
- // eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
- cy.findByText("No results");
-
- // 3. We shouldn't see duplication in the breakout fields
- H.summarize();
- cy.findByTestId("sidebar-content").within(() => {
- // Another implicit assertion
- cy.findByText(ccFunction);
- cy.findByText(ccTable);
- });
- });
-});
-
["postgres" /*, "mysql" */].forEach((dialect) => {
describe(`issue 27745 (${dialect})`, { tags: "@external" }, () => {
const tableName = "colors27745";
@@ -793,140 +649,6 @@ describe("issue 25189", { tags: "@skip" }, () => {
});
});
});
-// broken. see https://github.com/metabase/metabase/issues/55673
-describe("issue 42949", { tags: "@skip" }, () => {
- beforeEach(() => {
- H.restore();
- cy.signInAsAdmin();
- });
-
- it("should correctly show available shortcuts for date and number columns (metabase#42949)", () => {
- H.createNativeQuestion(
- {
- native: {
- query: `
- SELECT DATE '2024-05-21' AS created_at, null as v
- UNION ALL SELECT DATE '2024-05-20', 1
- UNION ALL SELECT DATE '2024-05-19', 2
- ORDER BY created_at
- `,
- },
- },
- { visitQuestion: true },
- );
- cy.findByTestId("qb-header").findByText("Explore results").click();
-
- cy.log("Verify header drills - CREATED_AT");
- H.tableHeaderClick("CREATED_AT");
- H.popover().findByText("Extract day, month…").should("be.visible");
- H.popover().findByText("Combine columns").should("not.exist");
- cy.realPress("Escape");
- H.popover({ skipVisibilityCheck: true }).should("not.be.visible");
-
- cy.log("Verify header drills - V");
- H.tableHeaderClick("V");
- H.popover().findByText("Extract part of column").should("not.exist");
- H.popover().findByText("Combine columns").should("not.exist");
- cy.realPress("Escape");
- H.popover({ skipVisibilityCheck: true }).should("not.be.visible");
-
- cy.log("Verify plus button - extract column");
- cy.button("Add column").click();
- H.popover().findByText("Extract part of column").click();
- H.popover().findByText("CREATED_AT").click();
- H.popover().within(() => {
- cy.findByText("Day of month").should("be.visible");
- cy.findByText("Day of week").should("be.visible");
- cy.findByText("Month of year").should("be.visible");
- cy.findByText("Quarter of year").should("be.visible");
- cy.findByText("Year").should("be.visible").click();
- });
- cy.findAllByTestId("header-cell").eq(2).should("have.text", "Year");
-
- cy.log("Verify plus button - combine columns");
- cy.button("Add column").click();
- H.popover().findByText("Combine columns").click();
- H.popover().findAllByTestId("column-input").eq(0).click();
- // eslint-disable-next-line metabase/no-unsafe-element-filtering
- H.popover()
- .last()
- .within(() => {
- cy.findByText("CREATED_AT").should("be.visible");
- cy.findByText("V").should("be.visible");
- cy.findByText("Year").should("be.visible").click();
- });
- H.popover().button("Done").click();
-
- cy.findAllByTestId("header-cell")
- .eq(3)
- .should("have.text", "Combined Year, V");
-
- cy.findAllByTestId("cell-data").eq(6).should("have.text", "2,024");
- cy.findAllByTestId("cell-data").eq(7).should("have.text", "2024 2");
- cy.findAllByTestId("cell-data").eq(10).should("have.text", "2,024");
- cy.findAllByTestId("cell-data").eq(11).should("have.text", "2024 1");
- cy.findAllByTestId("cell-data").eq(13).should("have.text", "2,024");
- cy.findAllByTestId("cell-data").eq(14).should("have.text", "2024 ");
- });
-
- it("should correctly show available shortcuts for a number column (metabase#42949)", () => {
- H.createNativeQuestion(
- {
- native: {
- query: "select 1 as n",
- },
- },
- { visitQuestion: true },
- );
-
- cy.findByTestId("qb-header").findByText("Explore results").click();
- cy.findByLabelText("Switch to data").click();
-
- cy.log("Verify header drills");
- H.tableHeaderClick("N");
- H.popover().findByText("Extract part of column").should("not.exist");
- H.popover().findByText("Combine columns").should("not.exist");
- cy.realPress("Escape");
- H.popover({ skipVisibilityCheck: true }).should("not.be.visible");
-
- cy.log("Verify plus button");
- cy.button("Add column").click();
- H.popover().findByText("Extract part of column").should("not.exist");
- H.popover().findByText("Combine columns").click();
- H.popover().findAllByTestId("column-input").eq(0).click();
- // eslint-disable-next-line metabase/no-unsafe-element-filtering
- H.popover().last().findByText("N").should("be.visible");
- });
-
- it("should correctly show available shortcuts for a string column (metabase#42949)", () => {
- H.createNativeQuestion(
- {
- native: {
- query: "select 'abc'",
- },
- },
- { visitQuestion: true },
- );
-
- cy.findByTestId("qb-header").findByText("Explore results").click();
- cy.findByLabelText("Switch to data").click();
-
- cy.log("Verify header drills");
- H.tableHeaderClick("'abc'");
- H.popover().findByText("Extract part of column").should("not.exist");
- H.popover().findByText("Combine columns").should("be.visible");
- cy.realPress("Escape");
- H.popover({ skipVisibilityCheck: true }).should("not.be.visible");
-
- cy.log("Verify plus button");
- cy.button("Add column").click();
- H.popover().findByText("Extract part of column").should("not.exist");
- H.popover().findByText("Combine columns").click();
- H.popover().findAllByTestId("column-input").eq(0).click();
- // eslint-disable-next-line metabase/no-unsafe-element-filtering
- H.popover().last().findByText("'abc'").should("be.visible");
- });
-});
describe("issue 49342", () => {
beforeEach(() => {
@@ -1038,23 +760,6 @@ describe("issue 49882", () => {
},
);
- // TODO: we no longer have wrapped lines (for now)
- it(
- "should allow moving cursor between wrapped lines with arrow up and arrow down keys (metabase#49882-3)",
- { tags: "@skip" },
- () => {
- H.enterCustomColumnDetails({
- formula:
- 'case([Tax] > 1, case([Total] > 200, [Total], "Nothing"), [Tax]){leftarrow}{leftarrow}{uparrow}x{downarrow}y',
- });
-
- H.CustomExpressionEditor.value().should(
- "equal",
- 'case([Tax] > 1, xcase([Total] > 200, [Total], "Nothing"), [Tax]y)',
- );
- },
- );
-
it("should update currently selected suggestion when suggestions list is updated (metabase#49882-4)", () => {
const selectProductRating =
"{downarrow}{downarrow}{downarrow}{downarrow}{downarrow}";
diff --git a/e2e/test/scenarios/custom-column/custom-column-reproductions-2.cy.spec.js b/e2e/test/scenarios/custom-column/custom-column-reproductions-2.cy.spec.js
index 0be654405de..288963c4a7f 100644
--- a/e2e/test/scenarios/custom-column/custom-column-reproductions-2.cy.spec.js
+++ b/e2e/test/scenarios/custom-column/custom-column-reproductions-2.cy.spec.js
@@ -473,78 +473,6 @@ describe("issue 55687", () => {
});
});
-describe("issue 58371", { tags: "@skip" }, () => {
- beforeEach(() => {
- H.restore();
- cy.signInAsAdmin();
-
- cy.request("PUT", `/api/field/${ORDERS.PRODUCT_ID}`, {
- display_name: null,
- });
-
- const baseQuestion = {
- name: "Base Question",
- query: {
- "source-table": PRODUCTS_ID,
- aggregation: [
- [
- "aggregation-options",
- ["count-where", ["=", ["field", PRODUCTS.TITLE, null], "OK"]],
- { "display-name": "Aggregation with Dash-in-name" },
- ],
- ],
- breakout: [["field", PRODUCTS.ID, null]],
- },
- };
-
- H.createQuestion(baseQuestion, { wrapId: true }).then((questionId) => {
- const questionDetails = {
- query: {
- "source-table": ORDERS_ID,
- joins: [
- {
- fields: "all",
- "source-table": `card__${questionId}`,
- alias: "Other Question",
- condition: [
- "=",
- ["field", ORDERS.PRODUCT_ID, null],
- ["field", PRODUCTS.ID, { "join-alias": "Other Question" }],
- ],
- },
- ],
- expressions: {
- Foo: [
- "+",
- 0,
- [
- "field",
- "count_where",
- {
- "base-type": "type/Float",
- "join-alias": "Other Question",
- },
- ],
- ],
- },
- },
- };
-
- H.createQuestion(questionDetails, { visitQuestion: true });
- });
-
- H.openNotebook();
- });
-
- it("should allow using names with a dash in them from joined tables (metabase#58371)", () => {
- H.getNotebookStep("expression").findByText("Foo").click();
- H.CustomExpressionEditor.value().should(
- "eq",
- "0 + [Other Question → Aggregation with Dash-in-name]",
- );
- });
-});
-
describe("Issue 58230", () => {
beforeEach(() => {
H.restore();
@@ -585,27 +513,6 @@ describe("issue 57674", () => {
H.openOrdersTable({ mode: "notebook" });
});
- // TODO: re-enable this test once we have a fix for metabase#61264
- it(
- "should show an error when using a case or if expression with mismatched types (metabase#57674)",
- { tags: "@skip" },
- () => {
- H.getNotebookStep("data").button("Custom column").click();
-
- H.CustomExpressionEditor.clear();
- H.popover().findByText("Types are incompatible.").should("not.exist");
-
- H.CustomExpressionEditor.type(
- 'case([Total] > 100, [Created At], "foo")',
- {
- allowFastSet: true,
- },
- ).blur();
-
- H.popover().findByText("Types are incompatible.").should("be.visible");
- },
- );
-
it("should not show an error when using a case or if expression with compatible types (metabase#57674)", () => {
H.getNotebookStep("data").button("Custom column").click();
diff --git a/e2e/test/scenarios/dashboard-cards/dashboard-card-reproductions.cy.spec.js b/e2e/test/scenarios/dashboard-cards/dashboard-card-reproductions.cy.spec.js
index 966095fc2c5..8f75b3223b6 100644
--- a/e2e/test/scenarios/dashboard-cards/dashboard-card-reproductions.cy.spec.js
+++ b/e2e/test/scenarios/dashboard-cards/dashboard-card-reproductions.cy.spec.js
@@ -431,14 +431,6 @@ describe("issue 17160", () => {
});
}
- function visitPublicSourceDashboard() {
- cy.get("@sourceDashboardUUID").then((uuid) => {
- cy.visit(`/public/dashboard/${uuid}`);
-
- cy.findByTextEnsureVisible("Enormous Wool Car");
- });
- }
-
beforeEach(() => {
cy.intercept("POST", "/api/card/*/query").as("cardQuery");
@@ -478,37 +470,6 @@ describe("issue 17160", () => {
assertMultipleValuesFilterState();
});
-
- it(
- "should pass multiple filter values to public questions and dashboards (metabase#17160-2)",
- { tags: "@skip" },
- () => {
- // FIXME: setup public dashboards
- setup();
-
- // 1. Check click behavior connected to a public question
- visitPublicSourceDashboard();
-
- cy.findAllByText("click-behavior-question-label").eq(0).click();
-
- cy.url().should("include", "/public/question");
-
- assertMultipleValuesFilterState();
-
- // 2. Check click behavior connected to a publicdashboard
- visitPublicSourceDashboard();
-
- cy.findAllByText("click-behavior-dashboard-label").eq(0).click();
-
- cy.url().should("include", "/public/dashboard");
- cy.location("search").should("eq", "?category=Doohickey&category=Gadget");
-
- // eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
- cy.findByText(TARGET_DASHBOARD_NAME);
-
- assertMultipleValuesFilterState();
- },
- );
});
describe("issue 18454", () => {
diff --git a/e2e/test/scenarios/dashboard-cards/dashboard-drill.cy.spec.js b/e2e/test/scenarios/dashboard-cards/dashboard-drill.cy.spec.js
index 89ac445d668..54cce53eeca 100644
--- a/e2e/test/scenarios/dashboard-cards/dashboard-drill.cy.spec.js
+++ b/e2e/test/scenarios/dashboard-cards/dashboard-drill.cy.spec.js
@@ -302,49 +302,6 @@ describe("scenarios > dashboard > dashboard drill", () => {
});
});
- // This was flaking. Example: https://dashboard.cypress.io/projects/a394u1/runs/2109/test-results/91a15b66-4b80-40bf-b569-de28abe21f42
- it("should handle cross-filter on a table", { tags: "@skip" }, () => {
- createDashboardWithQuestion({}, (dashboardId) =>
- H.visitDashboard(dashboardId),
- );
- cy.icon("pencil").click();
- H.showDashboardCardActions();
- cy.findByTestId("dashboardcard-actions-panel").within(() => {
- cy.icon("click").click();
- });
-
- // configure clicks on "MY_NUMBER to update the param
- // eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
- cy.findByText("On-click behavior for each column")
- .parent()
- .parent()
- // eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
- .within(() => cy.findByText("MY_NUMBER").click());
- // eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
- cy.findByText("Update a dashboard filter").click();
- // eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
- cy.findByText("Pick one or more filters to update")
- .parent()
- // eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
- .within(() => cy.findByText("My Param").click());
- // eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
- H.selectDropdown().within(() => cy.findByText("MY_STRING").click());
- // eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
- cy.findByText("Save").click();
-
- // click on table value
- // eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
- cy.findByText("111").click();
-
- // check that param was set to "foo"
- cy.location("search").should("eq", "?my_param=foo");
- // eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
- cy.findByText("My Param")
- .parent()
- // eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
- .within(() => cy.findByText("foo"));
- });
-
describe("should pass multiple filters for numeric column on drill-through (metabase#13062)", () => {
const questionDetails = {
name: "13062Q",
diff --git a/e2e/test/scenarios/dashboard/dashboard-reproductions.cy.spec.js b/e2e/test/scenarios/dashboard/dashboard-reproductions.cy.spec.js
index cf6437a2046..ce4bee39094 100644
--- a/e2e/test/scenarios/dashboard/dashboard-reproductions.cy.spec.js
+++ b/e2e/test/scenarios/dashboard/dashboard-reproductions.cy.spec.js
@@ -1934,102 +1934,6 @@ describe("issue 56716", () => {
H.getDashboardCard().findByText("200 rows").should("be.visible");
});
});
-
-describe("Issue 46337", () => {
- const MODEL_NAME = "Model 46337";
-
- beforeEach(() => {
- H.restore();
- cy.signInAsAdmin();
- H.createQuestion({
- type: "model",
- name: MODEL_NAME,
- query: {
- "source-table": ORDERS_ID,
- fields: [
- [
- "field",
- ORDERS.ID,
- {
- "base-type": "type/BigInteger",
- },
- ],
- [
- "field",
- ORDERS.TAX,
- {
- "base-type": "type/Float",
- },
- ],
- [
- "field",
- ORDERS.TOTAL,
- {
- "base-type": "type/Float",
- },
- ],
- [
- "field",
- ORDERS.DISCOUNT,
- {
- "base-type": "type/Float",
- },
- ],
- [
- "field",
- ORDERS.QUANTITY,
- {
- "base-type": "type/Integer",
- },
- ],
- [
- "field",
- ORDERS.CREATED_AT,
- {
- "base-type": "type/DateTime",
- },
- ],
- [
- "field",
- ORDERS.PRODUCT_ID,
- {
- "base-type": "type/Integer",
- },
- ],
- ],
- joins: [
- {
- fields: "all",
- alias: "Products",
- "source-table": PEOPLE_ID,
- strategy: "left-join",
- condition: [
- "=",
- ["field", ORDERS.USER_ID, {}],
- ["field", PEOPLE.ID, { "join-alias": "Products" }],
- ],
- },
- ],
- },
- }).then(({ body: model }) => {
- cy.visit(`/auto/dashboard/model/${model.id}`);
- });
- });
-
- // TODO: unskip when metabase#46337 is fixed
- // See: https://github.com/metabase/metabase/issues/46337
- it("should (metabase#46337)", { tags: "@skip" }, () => {
- cy.log("ensure the dashcards render data not errors");
-
- cy.findByTestId("dashboard-grid").within(() => {
- cy.findByText("There was a problem displaying this chart.").should(
- "not.exist",
- );
- cy.findByText(`Total ${MODEL_NAME}`).should("be.visible");
- });
- });
-});
-
function slowDownCardQuery() {
return cy.intercept("POST", "/api/card/*/query", (req) => {
req.on("response", (res) => {
diff --git a/e2e/test/scenarios/dashboard/dashboard.cy.spec.js b/e2e/test/scenarios/dashboard/dashboard.cy.spec.js
index f4f244cc868..b88093bada1 100644
--- a/e2e/test/scenarios/dashboard/dashboard.cy.spec.js
+++ b/e2e/test/scenarios/dashboard/dashboard.cy.spec.js
@@ -1535,70 +1535,6 @@ function assertScrollBarExists() {
});
}
-describe("LOCAL TESTING ONLY > dashboard", () => {
- beforeEach(() => {
- H.restore();
- cy.signInAsAdmin();
- });
-
- /**
- * WARNING:
- * https://github.com/metabase/metabase/issues/15656
- * - We are currently not able to test translations in CI
- * - DO NOT unskip this test even after the issue is fixed
- * - To be used for local testing only
- * - Make sure you have translation resources built first.
- * - Run `./bin/i18n/build-translation-resources`
- * - Then start the server and Cypress tests
- */
-
- it(
- "dashboard filter should not show placeholder for translated languages (metabase#15694)",
- { tags: "@skip" },
- () => {
- cy.request("GET", "/api/user/current").then(
- ({ body: { id: USER_ID } }) => {
- cy.request("PUT", `/api/user/${USER_ID}`, { locale: "fr" });
- },
- );
- H.createQuestionAndDashboard({
- questionDetails: {
- name: "15694",
- query: { "source-table": PEOPLE_ID },
- },
- dashboardDetails: {
- parameters: [
- {
- name: "Location",
- slug: "location",
- id: "5aefc725",
- type: "string/=",
- sectionId: "location",
- },
- ],
- },
- }).then(({ body: { card_id, dashboard_id } }) => {
- H.addOrUpdateDashboardCard({
- card_id,
- dashboard_id,
- card: {
- parameter_mappings: [
- {
- parameter_id: "5aefc725",
- card_id,
- target: ["dimension", ["field", PEOPLE.STATE, null]],
- },
- ],
- },
- });
-
- cy.visit(`/dashboard/${dashboard_id}?location=AK&location=CA`);
- H.filterWidget().contains(/\{0\}/).should("not.exist");
- });
- },
- );
-});
-
describe("scenarios > dashboard > permissions", () => {
let dashboardId;
diff --git a/e2e/test/scenarios/dashboard/visualizer/filters.cy.spec.ts b/e2e/test/scenarios/dashboard/visualizer/filters.cy.spec.ts
deleted file mode 100644
index deadd012b24..00000000000
--- a/e2e/test/scenarios/dashboard/visualizer/filters.cy.spec.ts
+++ /dev/null
@@ -1,78 +0,0 @@
-const { H } = cy;
-
-import {
- PRODUCTS_AVERAGE_BY_CATEGORY,
- PRODUCTS_COUNT_BY_CATEGORY,
-} from "e2e/support/test-visualizer-data";
-
-describe("scenarios > dashboard > visualizer > filters", () => {
- beforeEach(() => {
- H.restore();
-
- cy.intercept("POST", "/api/dataset").as("dataset");
- cy.intercept("POST", "/api/card/*/query").as("cardQuery");
- cy.intercept("POST", "/api/dashboard/*/dashcard/*/card/*/query").as(
- "dashcardQuery",
- );
-
- cy.signInAsNormalUser();
-
- H.createQuestion(PRODUCTS_COUNT_BY_CATEGORY, {
- idAlias: "productsCountByCategoryQuestionId",
- wrapId: true,
- });
-
- H.createQuestion(PRODUCTS_AVERAGE_BY_CATEGORY, {
- idAlias: "productsAvgByCreatedAtQuestionId",
- wrapId: true,
- });
- });
-
- // TODO those two datasets should be compatible with each other
- it(
- "should create and update a dashcard with 'Visualize another way' button",
- { tags: "@skip" },
- () => {
- H.createDashboard().then(({ body: { id: dashboardId } }) => {
- H.visitDashboard(dashboardId);
- });
-
- H.editDashboard();
- H.openQuestionsSidebar();
- H.clickVisualizeAnotherWay(PRODUCTS_COUNT_BY_CATEGORY.name);
-
- H.modal().within(() => {
- H.switchToAddMoreData();
- H.selectDataset(PRODUCTS_AVERAGE_BY_CATEGORY.name);
-
- H.assertWellItemsCount({
- vertical: 2,
- });
- });
-
- H.saveDashcardVisualizerModal({ mode: "create" });
-
- H.setFilter("Text or Category", "Is");
-
- // Doing it twice to populate the two filters
- H.selectDashboardFilter(H.getDashboardCard(0), "Category");
- H.selectDashboardFilter(H.getDashboardCard(0), "Category");
-
- H.saveDashboard();
-
- H.getDashboardCard(0).within(() => {
- cy.findByText("Doohickey").should("exist");
- });
-
- H.filterWidget().contains("Text").click();
- H.popover().within(() => {
- cy.findByText("Gadget").click();
- cy.button("Add filter").click();
- });
-
- H.getDashboardCard(0).within(() => {
- cy.findByText("Doohickey").should("not.exist");
- });
- },
- );
-});
diff --git a/e2e/test/scenarios/embedding/embedding-reproductions.cy.spec.js b/e2e/test/scenarios/embedding/embedding-reproductions.cy.spec.js
index 17d0ba5edf9..d6068114c9e 100644
--- a/e2e/test/scenarios/embedding/embedding-reproductions.cy.spec.js
+++ b/e2e/test/scenarios/embedding/embedding-reproductions.cy.spec.js
@@ -6,178 +6,6 @@ import { defer } from "metabase/utils/promise";
const { PRODUCTS, PRODUCTS_ID, ORDERS, ORDERS_ID, FEEDBACK, FEEDBACK_ID } =
SAMPLE_DATABASE;
-describe("issue 15860", { tags: "@skip" }, () => {
- const q1IdFilter = {
- name: "Q1 ID",
- slug: "q1_id",
- id: "fde6db8b",
- type: "id",
- sectionId: "id",
- default: [1],
- };
-
- const q1CategoryFilter = {
- name: "Q1 Category",
- slug: "q1_category",
- id: "e8ff3175",
- type: "string/=",
- sectionId: "string",
- filteringParameters: [q1IdFilter.id],
- };
-
- const q2IdFilter = {
- name: "Q2 ID",
- slug: "q2_id",
- id: "t3e6hb7b",
- type: "id",
- sectionId: "id",
- default: [3],
- };
-
- const q2CategoryFilter = {
- name: "Q2 Category",
- slug: "q2_category",
- id: "ca1n357o",
- type: "string/=",
- sectionId: "string",
- filteringParameters: [q2IdFilter.id],
- };
-
- function setDefaultValueForLockedFilter(filter, value) {
- cy.findByText("Previewing locked parameters")
- .parent()
- .within(() => {
- cy.findByText(filter).click({ force: true });
- });
-
- cy.findByPlaceholderText("Enter an ID").type(`${value}{enter}`);
- cy.button("Add filter").click();
- }
-
- beforeEach(() => {
- H.restore();
- cy.signInAsAdmin();
-
- H.createQuestionAndDashboard({
- questionDetails: {
- name: "Q1",
- query: { "source-table": PRODUCTS_ID },
- },
- dashboardDetails: {
- embedding_params: {
- q1_id: "locked",
- q1_category: "enabled",
- q2_id: "locked",
- q2_category: "enabled",
- },
- enable_embedding: true,
- parameters: [
- q1IdFilter,
- q1CategoryFilter,
- q2IdFilter,
- q2CategoryFilter,
- ],
- },
- cardDetails: {
- size_x: 11,
- size_y: 6,
- },
- }).then(({ body: { card_id: q1, dashboard_id } }) => {
- // Create a second question with the same source table
- H.createQuestion({
- name: "Q2",
- query: { "source-table": PRODUCTS_ID },
- }).then(({ body: { id: q2 } }) => {
- H.updateDashboardCards({
- dashboard_id,
- cards: [
- // Add card for second question with parameter mappings
- {
- card_id: q2,
- row: 0,
- col: 8,
- size_x: 13,
- size_y: 6,
- parameter_mappings: [
- {
- parameter_id: q2IdFilter.id,
- card_id: q2,
- target: ["dimension", ["field", PRODUCTS.ID, null]],
- },
- {
- parameter_id: q2CategoryFilter.id,
- card_id: q2,
- target: ["dimension", ["field", PRODUCTS.CATEGORY, null]],
- },
- ],
- },
- // Add parameter mappings to first question's card
- {
- card_id: q1,
- parameter_mappings: [
- {
- parameter_id: q1IdFilter.id,
- card_id: q1,
- target: ["dimension", ["field", PRODUCTS.ID, null]],
- },
- {
- parameter_id: q1CategoryFilter.id,
- card_id: q1,
- target: ["dimension", ["field", PRODUCTS.CATEGORY, null]],
- },
- ],
- },
- ],
- });
- });
-
- cy.request("PUT", `/api/dashboard/${dashboard_id}`, {
- embedding_params: {
- q1_id: "locked",
- q1_category: "enabled",
- q2_id: "locked",
- q2_category: "enabled",
- },
- enable_embedding: true,
- });
-
- H.visitDashboard(dashboard_id);
-
- H.openLegacyStaticEmbeddingModal({
- resource: "dashboard",
- resourceId: dashboard_id,
- activeTab: "parameters",
- unpublishBeforeOpen: false,
- });
- });
- });
-
- it("should work for locked linked filters connected to different cards with the same source table (metabase#15860)", () => {
- setDefaultValueForLockedFilter("Q1 ID", 1);
- setDefaultValueForLockedFilter("Q2 ID", 3);
-
- H.visitIframe();
-
- // eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
- cy.findByText("Q1 Category").click();
-
- H.popover().within(() => {
- cy.findByRole("listitem")
- .should("have.length", 1)
- .and("contain", "Gizmo");
- });
-
- // eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
- cy.findByText("Q2 Category").click();
-
- H.popover().within(() => {
- cy.findByRole("listitem")
- .should("have.length", 1)
- .and("contain", "Doohickey");
- });
- });
-});
-
describe("issue 20438", () => {
const questionDetails = {
name: "20438",
@@ -1003,45 +831,6 @@ describe("issue 40660", () => {
});
});
-// Skipped since it does not make sense when CSP is disabled
-describe("issue 49142", { tags: "@skip" }, () => {
- const questionDetails = {
- name: "Products",
- query: { "source-table": PRODUCTS_ID, limit: 2 },
- };
-
- const dashboardDetails = {
- name: "Embeddable dashboard",
- enable_embedding: true,
- };
-
- beforeEach(() => {
- H.restore();
- cy.signInAsAdmin();
- });
-
- it("embedding preview should be always working", () => {
- H.createQuestionAndDashboard({
- questionDetails,
- dashboardDetails,
- }).then(({ body: { dashboard_id } }) => {
- H.visitDashboard(dashboard_id);
-
- H.openLegacyStaticEmbeddingModal({
- resource: "dashboard",
- resourceId: dashboard_id,
- activeTab: "lookAndFeel",
- previewMode: "preview",
- });
- });
-
- cy.findByTestId("embed-preview-iframe")
- .its("0.contentDocument.body")
- .should("be.visible")
- .and("contain", "Embeddable dashboard");
- });
-});
-
describe("issue 8490", () => {
beforeEach(() => {
H.restore();
diff --git a/e2e/test/scenarios/embedding/sdk-iframe-embedding-setup/select-embed-experience.cy.spec.ts b/e2e/test/scenarios/embedding/sdk-iframe-embedding-setup/select-embed-experience.cy.spec.ts
index 23dc3459052..3d905b16d93 100644
--- a/e2e/test/scenarios/embedding/sdk-iframe-embedding-setup/select-embed-experience.cy.spec.ts
+++ b/e2e/test/scenarios/embedding/sdk-iframe-embedding-setup/select-embed-experience.cy.spec.ts
@@ -106,30 +106,6 @@ describe(suiteTitle, () => {
});
});
- it("shows exploration template when selected", { tags: "@skip" }, () => {
- visitNewEmbedPage();
-
- getEmbedSidebar().within(() => {
- cy.findByLabelText("Metabase account (SSO)").click();
-
- cy.findByText("Exploration").click();
- cy.findByText("Next").click();
- });
-
- H.expectUnstructuredSnowplowEvent({
- event: "embed_wizard_experience_completed",
- event_detail:
- "authType=sso,experience=exploration,isDefaultExperience=false",
- });
-
- H.waitForSimpleEmbedIframesToLoad();
-
- H.getSimpleEmbedIframeContent().within(() => {
- cy.log("data picker is visible");
- cy.findByText("Pick your starting data").should("be.visible");
- });
- });
-
it("shows browser template when selected", () => {
visitNewEmbedPage();
@@ -193,38 +169,6 @@ describe(suiteTitle, () => {
cy.findByText("Person detail").should("be.visible");
});
});
-
- it(
- "shows question of id=1 when activity log is empty and chart is selected",
- { tags: "@skip" },
- () => {
- visitNewEmbedPage();
- cy.wait("@emptyRecentItems");
-
- getEmbedSidebar().within(() => {
- cy.findByLabelText("Guest").click();
- });
- embedModalEnableEmbedding();
-
- getEmbedSidebar().within(() => {
- cy.findByText("Chart").click();
- cy.findByText("Next").click();
- });
-
- H.expectUnstructuredSnowplowEvent({
- event: "embed_wizard_experience_completed",
- event_detail:
- "authType=guest-embed,experience=chart,isDefaultExperience=false",
- });
-
- H.waitForSimpleEmbedIframesToLoad();
-
- H.getSimpleEmbedIframeContent().within(() => {
- cy.log("question title of id=1 is visible");
- cy.findByText("Query log").should("be.visible");
- });
- },
- );
});
it("should show a fake loading indicator in embed preview", () => {
diff --git a/e2e/test/scenarios/filters-reproductions/dashboard-filters-reproductions-1.cy.spec.js b/e2e/test/scenarios/filters-reproductions/dashboard-filters-reproductions-1.cy.spec.js
index 339999b490c..ec6be422224 100644
--- a/e2e/test/scenarios/filters-reproductions/dashboard-filters-reproductions-1.cy.spec.js
+++ b/e2e/test/scenarios/filters-reproductions/dashboard-filters-reproductions-1.cy.spec.js
@@ -414,67 +414,6 @@ describe("issue 12985 > dashboard filter dropdown/search", () => {
// eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
cy.findByText("Ergonomic Silk Coat");
});
-
- it(
- "should work for aggregated questions (metabase#12985-2)",
- { tags: "@skip" },
- () => {
- const questionDetails = {
- name: "12985-v2",
- query: {
- "source-query": {
- "source-table": PRODUCTS_ID,
- aggregation: [["count"]],
- breakout: [["field", PRODUCTS.CATEGORY, null]],
- },
- filter: [">", ["field", "count", { "base-type": "type/Integer" }], 1],
- },
- };
-
- H.createQuestionAndDashboard({ questionDetails, dashboardDetails }).then(
- ({ body: { id, card_id, dashboard_id } }) => {
- cy.log("Connect dashboard filter to the aggregated card");
-
- cy.request("PUT", `/api/dashboard/${dashboard_id}`, {
- dashcards: [
- {
- id,
- card_id,
- row: 0,
- col: 0,
- size_x: 11,
- size_y: 6,
- series: [],
- visualization_settings: {},
- // Connect filter to the card
- parameter_mappings: [
- {
- parameter_id: categoryFilter.id,
- card_id,
- target: [
- "dimension",
- ["field", "CATEGORY", { "base-type": "type/Text" }],
- ],
- },
- ],
- },
- ],
- });
-
- H.visitDashboard(dashboard_id);
- },
- );
-
- H.filterWidget().contains("Category").click();
- // It will fail at this point until the issue is fixed because popover never appears
- H.popover().contains("Gadget").click();
- // eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
- cy.findByText("Add filter").click();
- cy.url().should("contain", "?category=Gadget");
- // eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
- cy.findByText("Ergonomic Silk Coat");
- },
- );
});
describe("issues 15119 and 16112", () => {
diff --git a/e2e/test/scenarios/filters-reproductions/dashboard-filters-reproductions-2.cy.spec.js b/e2e/test/scenarios/filters-reproductions/dashboard-filters-reproductions-2.cy.spec.js
index f80af64a554..794594a24e1 100644
--- a/e2e/test/scenarios/filters-reproductions/dashboard-filters-reproductions-2.cy.spec.js
+++ b/e2e/test/scenarios/filters-reproductions/dashboard-filters-reproductions-2.cy.spec.js
@@ -1266,63 +1266,6 @@ describe("issue 17061", () => {
});
});
-// TODO ranquild unskip after v54 release
-describe("issue 48824", { tags: "@skip" }, () => {
- const dateParameter = {
- id: "abc",
- name: "Date filter",
- slug: "filter-date",
- type: "date/all-options",
- default: "past30days-from-7days",
- };
-
- beforeEach(() => {
- H.restore();
- cy.signInAsNormalUser();
- });
-
- it("should correctly translate relative filters in dashboards (metabase#48824)", () => {
- cy.log("set locale");
- cy.request("GET", "/api/user/current").then(({ body: user }) => {
- cy.request("PUT", `/api/user/${user.id}`, { locale: "en-ZZ" });
- });
-
- cy.log("add a date parameter with a relative default value to a dashboard");
- cy.request("PUT", `/api/dashboard/${ORDERS_DASHBOARD_ID}`, {
- parameters: [dateParameter],
- });
- H.updateDashboardCards({
- dashboard_id: ORDERS_DASHBOARD_ID,
- cards: [
- {
- card_id: ORDERS_QUESTION_ID,
- parameter_mappings: [
- {
- card_id: ORDERS_QUESTION_ID,
- parameter_id: dateParameter.id,
- target: ["dimension", ["field", ORDERS.CREATED_AT, null]],
- },
- ],
- },
- ],
- });
-
- cy.log("check translations");
- H.visitDashboard(ORDERS_DASHBOARD_ID, {
- params: { [dateParameter.slug]: "past30days" },
- });
-
- cy.log("Previous 30 days");
- H.filterWidget().findByText("[zz] Previous 30 days").should("be.visible");
- H.filterWidget().icon("revert").click();
-
- cy.log("Previous 30 days, starting 7 days ago");
- H.filterWidget()
- .findByText("[zz] Previous 30 days, [zz] starting 7 days ago")
- .should("be.visible");
- });
-});
-
describe("issue 62627", () => {
beforeEach(() => {
H.restore();
diff --git a/e2e/test/scenarios/filters-reproductions/filters-reproductions.cy.spec.js b/e2e/test/scenarios/filters-reproductions/filters-reproductions.cy.spec.js
index 8687e2a719b..2009577fe3a 100644
--- a/e2e/test/scenarios/filters-reproductions/filters-reproductions.cy.spec.js
+++ b/e2e/test/scenarios/filters-reproductions/filters-reproductions.cy.spec.js
@@ -357,57 +357,6 @@ describe("issue 45410", () => {
});
});
});
-describe("issue 26861", { tags: "@skip" }, () => {
- const filter = {
- id: "a3b95feb-b6d2-33b6-660b-bb656f59b1d7",
- name: "filter",
- "display-name": "Filter",
- type: "dimension",
- dimension: ["field", ORDERS.CREATED_AT, null],
- "widget-type": "date/all-options",
- default: null,
- };
-
- const nativeQuery = {
- name: "26861",
- native: {
- query: "select * from orders where {{filter}} limit 2",
- "template-tags": {
- filter,
- },
- },
- };
-
- beforeEach(() => {
- cy.intercept("POST", "/api/dataset").as("dataset");
-
- H.restore();
- cy.signInAsAdmin();
-
- H.createNativeQuestion(nativeQuery, { visitQuestion: true });
- });
-
- it("exclude filter shouldn't break native questions with field filters (metabase#26861)", () => {
- H.filterWidget().click();
- // eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
- cy.findByText("Exclude…").click();
-
- // eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
- cy.findByText("Days of the week…").click();
- // eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
- cy.findByText("Tuesday").click();
-
- cy.button("Update filter").click();
- // In all other places in application, POST /api/dataset fires immediately after "Update filter"
- // A part of this bug is that we have to manually run the query so the next step will fail
- cy.wait("@dataset");
-
- // eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
- cy.findByText("CREATED_AT excludes Tuesday");
- // eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
- cy.findByText("117.03").should("not.exist");
- });
-});
describe("issue 27123", () => {
const questionDetails = {
diff --git a/e2e/test/scenarios/filters/filter.cy.spec.js b/e2e/test/scenarios/filters/filter.cy.spec.js
index 582b4c127a2..08d11b671ab 100644
--- a/e2e/test/scenarios/filters/filter.cy.spec.js
+++ b/e2e/test/scenarios/filters/filter.cy.spec.js
@@ -466,35 +466,6 @@ describe("scenarios > question > filter", () => {
});
});
- it(
- "column filters should work for metrics (metabase#15333)",
- { tags: "@skip" },
- () => {
- H.visitQuestionAdhoc({
- dataset_query: {
- type: "query",
- query: {
- "source-table": PRODUCTS_ID,
- aggregation: [["count"]],
- breakout: [["field-id", PRODUCTS.CATEGORY]],
- },
- database: SAMPLE_DB_ID,
- },
- display: "table",
- });
-
- cy.get("[data-testid=cell-data]").contains("Count").click();
- // eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
- cy.findByText("Filter by this column").click();
- cy.findByPlaceholderText("Enter a number").type("42");
- cy.button("Update filter").should("not.be.disabled").click();
- // eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
- cy.findByText("Doohickey");
- // eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
- cy.findByText("Gizmo").should("not.exist");
- },
- );
-
it("custom expression filter should reference fields by their name, not by their id (metabase#15748)", () => {
H.openOrdersTable({ mode: "notebook" });
diff --git a/e2e/test/scenarios/models/reproductions-3.cy.spec.ts b/e2e/test/scenarios/models/reproductions-3.cy.spec.ts
index 0d0250b081e..9e747a04735 100644
--- a/e2e/test/scenarios/models/reproductions-3.cy.spec.ts
+++ b/e2e/test/scenarios/models/reproductions-3.cy.spec.ts
@@ -5,10 +5,7 @@ import { ORDERS_QUESTION_ID } from "e2e/support/cypress_sample_instance_data";
import type { StructuredQuestionDetails } from "e2e/support/helpers";
import type { NativeQuestionDetails } from "e2e/support/helpers/api/createQuestion";
-import {
- openDetailsSidebar,
- turnIntoModel,
-} from "./helpers/e2e-models-helpers";
+import { turnIntoModel } from "./helpers/e2e-models-helpers";
const { ORDERS_ID, ORDERS, PRODUCTS_ID } = SAMPLE_DATABASE;
@@ -103,110 +100,6 @@ describe("issue 20045", () => {
});
});
-describe("issue 20624", { tags: "@skip" }, () => {
- const renamedColumn = "TITLE renamed";
-
- const questionDetails: NativeQuestionDetails = {
- name: "20624",
- type: "model",
- native: { query: "select * from PRODUCTS limit 2" },
- visualization_settings: {
- column_settings: { '["name","TITLE"]': { column_title: renamedColumn } },
- },
- };
-
- beforeEach(() => {
- cy.intercept("PUT", "/api/card/*").as("updateCard");
-
- H.restore();
- cy.signInAsAdmin();
-
- H.createNativeQuestion(questionDetails, { visitQuestion: true });
- });
-
- it("models metadata should override previously defined column settings (metabase#20624)", () => {
- openDetailsSidebar();
- // eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
- cy.findByText("Customize metadata").click();
-
- // Open settings for this column
- // eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
- cy.findByText(renamedColumn).click();
- // Let's set a new name for it
- cy.findByDisplayValue(renamedColumn).clear().type("Foo").blur();
-
- cy.button("Save changes").click();
- cy.wait("@updateCard");
-
- cy.get("[data-testid=cell-data]").should("contain", "Foo");
- });
-});
-
-describe("issue 22517", () => {
- function renameColumn(column: string, newName: string) {
- cy.findByDisplayValue(column).clear().type(newName).blur();
- }
-
- beforeEach(() => {
- cy.intercept("POST", "/api/card/*/query").as("cardQuery");
- cy.intercept("PUT", "/api/card/*").as("updateMetadata");
-
- H.restore();
- cy.signInAsAdmin();
-
- H.createNativeQuestion(
- {
- name: "22517",
- native: { query: "select * from orders" },
- type: "model",
- },
- { visitQuestion: true },
- );
-
- H.openQuestionActions();
- // eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
- cy.findByText("Edit metadata").click();
-
- renameColumn("ID", "Foo");
-
- cy.button("Save changes").click();
- cy.wait("@updateMetadata");
- });
-
- it(
- "adding or removing a column should not drop previously edited metadata (metabase#22517)",
- { tags: "@skip" },
- () => {
- H.openQuestionActions();
- // eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
- cy.findByText("Edit query definition").click();
-
- // Make sure previous metadata changes are reflected in the UI
- // eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
- cy.findByText("Foo");
-
- // This will edit the original query and add the `SIZE` column
- // Updated query: `select *, case when quantity > 4 then 'large' else 'small' end size from orders`
- H.NativeEditor.focus().type(
- "{leftarrow}".repeat(" from orders".length) +
- ", case when quantity > 4 then 'large' else 'small' end size ",
- );
-
- cy.findByTestId("native-query-editor-container").icon("play").click();
- cy.wait("@dataset");
-
- // eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
- cy.findByText("Foo");
-
- // eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
- cy.findByText("Save changes").click();
-
- // eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
- cy.findByText("Foo");
- },
- );
-});
-
describe("issue 22518", () => {
beforeEach(() => {
H.restore();
diff --git a/e2e/test/scenarios/models/reproductions.cy.spec.js b/e2e/test/scenarios/models/reproductions.cy.spec.js
index d7ded3e7d15..a650050a925 100644
--- a/e2e/test/scenarios/models/reproductions.cy.spec.js
+++ b/e2e/test/scenarios/models/reproductions.cy.spec.js
@@ -1,13 +1,11 @@
const { H } = cy;
-import { SAMPLE_DB_ID, SAMPLE_DB_SCHEMA_ID } from "e2e/support/cypress_data";
+import { SAMPLE_DB_ID } from "e2e/support/cypress_data";
import { SAMPLE_DATABASE } from "e2e/support/cypress_sample_database";
import {
ORDERS_DASHBOARD_ID,
ORDERS_QUESTION_ID,
} from "e2e/support/cypress_sample_instance_data";
-import { turnIntoModel } from "./helpers/e2e-models-helpers";
-
const { ORDERS_ID, REVIEWS, REVIEWS_ID, PRODUCTS } = SAMPLE_DATABASE;
describe("issue 19737", () => {
@@ -109,48 +107,6 @@ describe("issue 19737", () => {
});
});
-describe("issue 22519", { tags: "@skip" }, () => {
- const questionDetails = {
- query: {
- "source-table": REVIEWS_ID,
- },
- };
-
- beforeEach(() => {
- cy.intercept("PUT", "/api/field/*").as("updateField");
- cy.intercept("POST", "/api/dataset").as("dataset");
-
- H.restore();
- cy.signInAsAdmin();
-
- H.DataModel.visit({
- databaseId: SAMPLE_DB_ID,
- schemaName: SAMPLE_DB_SCHEMA_ID,
- tableId: REVIEWS_ID,
- fieldId: REVIEWS.REVIEWS,
- });
-
- // eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
- cy.findByText("Don't cast").click();
- // eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
- cy.findByText("UNIX seconds → Datetime").click();
- cy.wait("@updateField");
- });
-
- it("model query should not fail when data model is using casting (metabase#22519)", () => {
- H.createQuestion(questionDetails, { visitQuestion: true });
-
- // eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
- cy.findByText("xavier");
-
- turnIntoModel();
-
- cy.wait("@dataset");
- // eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
- cy.findByText("xavier");
- });
-});
-
describe("issue 23024", () => {
function addModelToDashboardAndVisit() {
H.createDashboard().then(({ body: { id } }) => {
diff --git a/e2e/test/scenarios/native-filters/native-filters-reproductions.cy.spec.js b/e2e/test/scenarios/native-filters/native-filters-reproductions.cy.spec.js
index 8089690fd13..4382f415c2d 100644
--- a/e2e/test/scenarios/native-filters/native-filters-reproductions.cy.spec.js
+++ b/e2e/test/scenarios/native-filters/native-filters-reproductions.cy.spec.js
@@ -201,72 +201,6 @@ describe("issue 12581", () => {
});
});
-describe("issue 13961", { tags: "@skip" }, () => {
- const categoryFilter = {
- id: "00315d5e-4a41-99da-1a41-e5254dacff9d",
- name: "category",
- "display-name": "Category",
- type: "dimension",
- default: "Doohickey",
- dimension: ["field", PRODUCTS.CATEGORY, null],
- "widget-type": "category",
- };
-
- const productIdFilter = {
- id: "4775bccc-e82a-4069-fc6b-2acc90aadb8b",
- name: "prodid",
- "display-name": "ProdId",
- type: "number",
- default: null,
- };
-
- const nativeQuery = {
- name: "13961",
- native: {
- query:
- "SELECT * FROM PRODUCTS WHERE 1=1 AND {{category}} [[AND ID={{prodid}}]]",
- "template-tags": {
- category: categoryFilter,
- prodid: productIdFilter,
- },
- },
- };
-
- beforeEach(() => {
- H.restore();
- cy.signInAsAdmin();
-
- H.createNativeQuestion(nativeQuery, { visitQuestion: true });
- });
-
- it("should clear default filter value in native questions (metabase#13961)", () => {
- cy.findAllByText("Small Marble Shoes"); // Product ID 2, Doohickey
-
- cy.location("search").should("eq", "?category=Doohickey");
-
- // Remove default filter (category)
- H.filterWidget().findByRole("button").click();
-
- cy.icon("play").first().should("be.visible").as("rerunQuestion").click();
- cy.wait("@cardQuery");
-
- cy.url().should("not.include", "?category=Doohickey");
-
- // Add value `1` to the ID filter
- cy.findByPlaceholderText(productIdFilter["display-name"]).type("1");
-
- cy.get("@rerunQuestion").click();
- cy.wait("@cardQuery");
-
- cy.log("Reported tested and failing on v0.34.3 through v0.37.3");
- cy.log("URL is correct at this point, but there are no results");
-
- cy.location("search").should("eq", `?${productIdFilter.name}=1`);
- // eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
- cy.findByText("Rustic Paper Wallet"); // Product ID 1, Gizmo
- });
-});
-
describe("issue 14302", () => {
const priceFilter = {
id: "39b51ccd-47a7-9df6-a1c5-371918352c79",
diff --git a/e2e/test/scenarios/native-filters/sql-filters.cy.spec.js b/e2e/test/scenarios/native-filters/sql-filters.cy.spec.js
index 2fe97cf1b96..3fcec096709 100644
--- a/e2e/test/scenarios/native-filters/sql-filters.cy.spec.js
+++ b/e2e/test/scenarios/native-filters/sql-filters.cy.spec.js
@@ -218,26 +218,6 @@ describe("scenarios > filters > sql filters > basic filter types", () => {
.findByPlaceholderText("Testingparamvisbility77")
.should("be.visible");
});
-
- // flaky test (#19454)
- it(
- "should show an info popover when hovering over fields in the field filter field picker",
- { tags: "@skip" },
- () => {
- SQLFilter.enterParameterizedQuery("SELECT * FROM products WHERE {{cat}}");
-
- SQLFilter.openTypePickerFromDefaultFilterType();
- SQLFilter.chooseType("Field Filter");
-
- H.popover().within(() => {
- cy.findByText("People").click();
- cy.findByText("City").trigger("mouseenter");
- });
-
- H.popover().contains("City");
- H.popover().contains("1,966 distinct values");
- },
- );
});
describe("scenarios > filters > sql filters > multiple values", () => {
diff --git a/e2e/test/scenarios/native/native-reproductions.cy.spec.js b/e2e/test/scenarios/native/native-reproductions.cy.spec.js
index 2458c63e9d7..d4923ee001d 100644
--- a/e2e/test/scenarios/native/native-reproductions.cy.spec.js
+++ b/e2e/test/scenarios/native/native-reproductions.cy.spec.js
@@ -294,114 +294,6 @@ describe("issue 20044", () => {
});
});
-describe("issue 20625", { tags: "@skip" }, () => {
- beforeEach(() => {
- H.restore();
- cy.signInAsAdmin();
- H.updateSetting("native-query-autocomplete-match-style", "prefix");
- cy.signInAsNormalUser();
- });
-
- // realpress messes with cypress 13
- it("should continue to request more prefix matches from the server when the limit was hit (metabase#20625)", () => {
- cy.intercept("GET", "/api/database/*/autocomplete_suggestions**", {
- statusCode: 200,
- body: [
- // This result has 50 items, which is the limit
- // as set by the backend.
- // This is needed to trigger the second autocomplete.
- ["ORDERS", "Table"],
- ["PEOPLE", "Table"],
- ["REVIEWS", "Table"],
- ["ACTIVE_SUBSCRIPTION", "ACCOUNTS :type/Boolean :type/Category"],
- ["ADDRESS", "PEOPLE :type/Text"],
- ["BIRTH_DATE", "PEOPLE :type/Date"],
- ["BUTTON_LABEL", "ANALYTIC_EVENTS :type/Text :type/Category"],
- ["CANCELED_AT", "ACCOUNTS :type/DateTime :type/CancelationTimestamp"],
- ["CATEGORY", "PRODUCTS :type/Text :type/Category"],
- ["CREATED_AT", "ACCOUNTS :type/DateTime :type/CreationTimestamp"],
- ["CREATED_AT", "ORDERS :type/DateTime :type/CreationTimestamp"],
- ["CREATED_AT", "PEOPLE :type/DateTime :type/CreationTimestamp"],
- ["CREATED_AT", "PRODUCTS :type/DateTime :type/CreationTimestamp"],
- ["CREATED_AT", "REVIEWS :type/DateTime :type/CreationTimestamp"],
- ["DATE_RECEIVED", "FEEDBACK :type/DateTime"],
- ["DATE_RECEIVED", "INVOICES :type/DateTime"],
- ["EAN", "PRODUCTS :type/Text"],
- ["EMAIL", "ACCOUNTS :type/Text :type/Email"],
- ["EMAIL", "FEEDBACK :type/Text :type/Email"],
- ["EMAIL", "PEOPLE :type/Text :type/Email"],
- ["EVENT", "ANALYTIC_EVENTS :type/Text :type/Category"],
- ["EXPECTED_INVOICE", "INVOICES :type/Boolean :type/Category"],
- ["FIRST_NAME", "ACCOUNTS :type/Text :type/Name"],
- ["LAST_NAME", "ACCOUNTS :type/Text :type/Name"],
- ["LATITUDE", "ACCOUNTS :type/Float :type/Latitude"],
- ["LATITUDE", "PEOPLE :type/Float :type/Latitude"],
- ["LEGACY_PLAN", "ACCOUNTS :type/Boolean :type/Category"],
- ["LONGITUDE", "ACCOUNTS :type/Float :type/Longitude"],
- ["LONGITUDE", "PEOPLE :type/Float :type/Longitude"],
- ["NAME", "PEOPLE :type/Text :type/Name"],
- ["PAGE_URL", "ANALYTIC_EVENTS :type/Text :type/URL"],
- ["PAYMENT", "INVOICES :type/Float"],
- ["PRICE", "PRODUCTS :type/Float"],
- ["RATING_MAPPED", "FEEDBACK :type/Text :type/Category"],
- ["REVIEWER", "REVIEWS :type/Text"],
- ["SEATS", "ACCOUNTS :type/Integer"],
- ["SOURCE", "ACCOUNTS :type/Text :type/Source"],
- ["SOURCE", "PEOPLE :type/Text :type/Source"],
- ["STATE", "PEOPLE :type/Text :type/State"],
- ["TIMESTAMP", "ANALYTIC_EVENTS :type/DateTime"],
- ["TITLE", "PRODUCTS :type/Text :type/Title"],
- ["TRIAL_CONVERTED", "ACCOUNTS :type/Boolean :type/Category"],
- ["TRIAL_ENDS_AT", "ACCOUNTS :type/DateTime"],
- ["USER_ID", "ORDERS :type/Integer :type/FK"],
- ["VENDOR", "PRODUCTS :type/Text :type/Company"],
- ["VENDOR_ID", "PRODUCTS :type/Integer :type/FK"],
- ["USER_NAME", "PRODUCTS :type/Text :type/Name"],
- ["TEST_COLUMN_1", "PRODUCTS :type/Text :type/Name"],
- ["TEST_COLUMN_2", "PRODUCTS :type/Text :type/Name"],
- ["TEST_COLUMN_3", "PRODUCTS :type/Text :type/Name"],
- ],
- }).as("autocomplete");
-
- H.startNewNativeQuestion();
- H.NativeEditor.type("e");
-
- // autocomplete_suggestions?prefix=s
- cy.wait("@autocomplete");
-
- H.NativeEditor.type("o");
-
- // autocomplete_suggestions?prefix=so
- cy.wait("@autocomplete");
- });
-
- it("should not continue to request more prefix matches from the server when the limit was not hit (metabase#20625)", () => {
- cy.intercept("GET", "/api/database/*/autocomplete_suggestions**", {
- statusCode: 200,
- body: [
- // This result has less than 50 items, which is under the limit
- // as set by the backend.
- // It will not be necessary to trigger the second autocomplete.
- ["ORDERS", "Table"],
- ["PEOPLE", "Table"],
- ["REVIEWS", "Table"],
- ["ACTIVE_SUBSCRIPTION", "ACCOUNTS :type/Boolean :type/Category"],
- ["ADDRESS", "PEOPLE :type/Text"],
- ],
- }).as("autocomplete");
-
- H.startNewNativeQuestion();
- H.NativeEditor.type("e");
-
- // autocomplete_suggestions?prefix=s
- cy.wait("@autocomplete");
-
- H.NativeEditor.type("o");
-
- cy.get("@autocomplete.all").should("have.length", 1);
- });
-});
-
describe("issue 21034", () => {
beforeEach(() => {
H.restore();
diff --git a/e2e/test/scenarios/native/native.cy.spec.js b/e2e/test/scenarios/native/native.cy.spec.js
index 8088ca0e6ba..85be523e861 100644
--- a/e2e/test/scenarios/native/native.cy.spec.js
+++ b/e2e/test/scenarios/native/native.cy.spec.js
@@ -1,9 +1,5 @@
const { H } = cy;
-import {
- SAMPLE_DB_ID,
- USER_GROUPS,
- WRITABLE_DB_ID,
-} from "e2e/support/cypress_data";
+import { SAMPLE_DB_ID } from "e2e/support/cypress_data";
import { SAMPLE_DATABASE } from "e2e/support/cypress_sample_database";
import { THIRD_COLLECTION_ID } from "e2e/support/cypress_sample_instance_data";
@@ -527,117 +523,6 @@ describe("scenarios > question > native", () => {
});
});
-// causes error in cypress 13
-describe("no native access", { tags: ["@external", "@skip"] }, () => {
- beforeEach(() => {
- H.restore("postgres-12");
- cy.signInAsAdmin();
- cy.intercept("/api/database?saved=true").as("database");
- cy.updatePermissionsGraph({
- [USER_GROUPS.ALL_USERS_GROUP]: {
- [WRITABLE_DB_ID]: {
- "view-data": "blocked",
- "create-queries": "no",
- },
- },
- [USER_GROUPS.NOSQL_GROUP]: {
- [SAMPLE_DB_ID]: {
- "view-data": "unrestricted",
- "create-queries": "query-builder-and-native",
- },
- [WRITABLE_DB_ID]: {
- "view-data": "unrestricted",
- "create-queries": "query-builder",
- },
- },
- });
-
- cy.updateCollectionGraph({
- [USER_GROUPS.NOSQL_GROUP]: { root: "write" },
- });
-
- H.createNativeQuestion(
- {
- name: "Secret Orders",
- native: {
- query: "SELECT * FROM ORDERS",
- },
- database: WRITABLE_DB_ID,
- },
- {
- wrapId: true,
- },
- );
-
- cy.signIn("nosql");
- });
-
- it("should not display the query when you do not have native access to the data source", () => {
- cy.get("@questionId").then((questionId) =>
- cy.visit(`/question/${questionId}`),
- );
-
- cy.findByTestId("native-query-top-bar").within(() => {
- cy.findByText("This question is written in SQL.").should("be.visible");
- cy.findByTestId("visibility-toggler").should("not.exist");
- });
-
- cy.log("#32387");
- cy.findByRole("button", { name: /New/ }).click();
- H.popover().findByText("SQL query").click();
-
- cy.wait("@database");
- cy.go("back");
-
- cy.findByTestId("native-query-top-bar").within(() => {
- cy.findByText("This question is written in SQL.").should("be.visible");
- cy.findByTestId("visibility-toggler").should("not.exist");
- });
- });
-
- it(
- "shows format query button only for sql queries",
- { tags: "@mongo" },
- () => {
- const MONGO_DB_NAME = "QA Mongo";
-
- cy.intercept("POST", "/api/card").as("createQuestion");
- cy.intercept("POST", "/api/dataset").as("dataset");
-
- H.restore("mongo-5");
- cy.signInAsNormalUser();
-
- H.startNewNativeQuestion();
- cy.findByTestId("gui-builder-data").click();
- cy.findByLabelText(MONGO_DB_NAME).click();
- cy.findByLabelText("Auto-format").should("not.exist");
-
- cy.findByTestId("native-query-top-bar").findByText(MONGO_DB_NAME).click();
-
- // Switch to SQL engine which is supported by the formatter
- H.popover().findByText("Sample Database").click();
-
- H.NativeEditor.focus().type("select * from orders", {
- parseSpecialCharSequences: false,
- });
-
- // It should load the formatter chunk only when used
- cy.intercept("GET", "**/sql-formatter**").as("sqlFormatter");
-
- cy.findByLabelText("Auto-format").click();
-
- cy.wait("@sqlFormatter");
-
- H.NativeEditor.get().should("be.visible").get(".ace_line").as("lines");
-
- cy.get("@lines").eq(0).should("have.text", "SELECT");
- cy.get("@lines").eq(1).should("have.text", " *");
- cy.get("@lines").eq(2).should("have.text", "FROM");
- cy.get("@lines").eq(3).should("have.text", " orders");
- },
- );
-});
-
describe("scenarios > native question > data reference sidebar", () => {
beforeEach(() => {
H.restore();
diff --git a/e2e/test/scenarios/onboarding/about.cy.spec.js b/e2e/test/scenarios/onboarding/about.cy.spec.js
deleted file mode 100644
index 1117e124c7b..00000000000
--- a/e2e/test/scenarios/onboarding/about.cy.spec.js
+++ /dev/null
@@ -1,24 +0,0 @@
-const { H } = cy;
-
-describe("scenarios > about Metabase", () => {
- beforeEach(() => {
- H.restore();
- cy.signInAsAdmin();
- cy.visit("/");
- cy.icon("gear").click();
- H.popover().findByText("About Metabase").click();
- });
-
- it(
- "should display correct Metabase version (metabase#15656)",
- { tags: "@skip" },
- () => {
- H.modal().within(() => {
- cy.findByText(/You're on version v[01](\.\d+){2,3}(-[\w\d]+)?/i);
- cy.findByText(/Built on \d{4}-\d{2}-\d{2}/);
- cy.findByText("Branch: ?").should("not.exist");
- cy.findByText("Hash: ?").should("not.exist");
- });
- },
- );
-});
diff --git a/e2e/test/scenarios/onboarding/reference/databases.cy.spec.js b/e2e/test/scenarios/onboarding/reference/databases.cy.spec.js
index 776e17ef05f..2a066507758 100644
--- a/e2e/test/scenarios/onboarding/reference/databases.cy.spec.js
+++ b/e2e/test/scenarios/onboarding/reference/databases.cy.spec.js
@@ -73,18 +73,6 @@ describe("scenarios > reference > databases", () => {
});
});
- it(
- "should sort data reference database list (metabase#15598)",
- { tags: "@skip" },
- () => {
- cy.visit("/browse");
- checkReferenceDatabasesOrder();
-
- cy.visit("/reference/databases/");
- checkReferenceDatabasesOrder();
- },
- );
-
it("should sort databases in new UI based question data selection popover", () => {
H.startNewQuestion();
H.miniPickerBrowseAll().click();
@@ -99,14 +87,6 @@ describe("scenarios > reference > databases", () => {
});
});
});
-
- it(
- "should sort databases in new native question data selection popover",
- { tags: "@skip" },
- () => {
- checkQuestionSourceDatabasesOrder("Native query");
- },
- );
});
describe("x-ray", () => {
@@ -155,25 +135,3 @@ describe("scenarios > reference > databases", () => {
});
});
});
-
-function checkReferenceDatabasesOrder() {
- cy.get("[class*=Card]").as("databaseCard").first().should("have.text", "a");
- // eslint-disable-next-line metabase/no-unsafe-element-filtering
- cy.get("@databaseCard").last().should("have.text", "Sample Database");
-}
-
-function checkQuestionSourceDatabasesOrder() {
- // Last item is "Saved Questions" for UI based questions so we have to check for the one before that (-2), and the last one for "Native" (-1)
- const lastDatabaseIndex = -1;
- const selector = "[data-element-id=list-item]-title";
-
- H.startNewQuestion();
- H.popover().within(() => {
- cy.findByText("Raw Data").click();
- cy.get(selector).as("databaseName").eq(1).should("have.text", "a");
- // eslint-disable-next-line metabase/no-unsafe-element-filtering
- cy.get("@databaseName")
- .eq(lastDatabaseIndex)
- .should("have.text", "Sample Database");
- });
-}
diff --git a/e2e/test/scenarios/permissions/permissions-reproductions.cy.spec.js b/e2e/test/scenarios/permissions/permissions-reproductions.cy.spec.js
index ecd957843fc..d4ab5f2ca0a 100644
--- a/e2e/test/scenarios/permissions/permissions-reproductions.cy.spec.js
+++ b/e2e/test/scenarios/permissions/permissions-reproductions.cy.spec.js
@@ -8,75 +8,11 @@ import {
} from "e2e/support/cypress_sample_instance_data";
const { ALL_USERS_GROUP, DATA_GROUP, COLLECTION_GROUP } = USER_GROUPS;
-const { ORDERS_ID, PRODUCTS_ID, PEOPLE_ID, REVIEWS_ID, PRODUCTS } =
- SAMPLE_DATABASE;
+const { PRODUCTS_ID, PEOPLE_ID, PRODUCTS } = SAMPLE_DATABASE;
const { nocollection } = USERS;
const PG_DB_ID = 2;
-// NOTE: This issue wasn't specifically related to PostgreSQL. We simply needed to add another DB to reproduce it.
-describe("issue 13347", { tags: ["@external", "@skip"] }, () => {
- beforeEach(() => {
- cy.intercept("POST", "/api/dataset").as("dataset");
-
- H.restore("postgres-12");
- cy.signInAsAdmin();
-
- cy.updatePermissionsGraph({
- [ALL_USERS_GROUP]: {
- 1: {
- "view-data": "unrestricted",
- "create-queries": "query-builder-and-native",
- },
- [PG_DB_ID]: {
- "view-data": "unrestricted",
- "create-queries": "no",
- },
- },
- });
-
- cy.updateCollectionGraph({
- [ALL_USERS_GROUP]: { root: "read" },
- });
-
- H.withDatabase(
- PG_DB_ID,
- ({ ORDERS_ID }) =>
- H.createQuestion({
- name: "Q1",
- query: { "source-table": ORDERS_ID },
- database: PG_DB_ID,
- }),
-
- H.createNativeQuestion({
- name: "Q2",
- native: { query: "SELECT * FROM ORDERS" },
- database: PG_DB_ID,
- }),
- );
- });
-
- ["QB", "Native"].forEach((test) => {
- it(`${test.toUpperCase()} version:\n should be able to select question (from "Saved Questions") which belongs to the database user doesn't have data-permissions for (metabase#13347)`, () => {
- cy.signIn("none");
-
- H.startNewQuestion();
- // eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
- cy.findByText("Saved Questions").click();
-
- if (test === "QB") {
- cy.findByText("Q1").click();
- } else {
- cy.findByText("Q2").click();
- }
-
- cy.wait("@dataset", { timeout: 5000 });
- // eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
- cy.contains("37.65");
- });
- });
-});
-
describe("postgres > user > query", { tags: "@external" }, () => {
beforeEach(() => {
H.restore("postgres-12");
@@ -152,46 +88,6 @@ describe("postgres > user > query", { tags: "@external" }, () => {
});
});
-describe("issue 17777", { tags: "@skip" }, () => {
- function hideTables(tables) {
- cy.request("PUT", "/api/table", {
- ids: tables,
- visibility_type: "hidden",
- });
- }
-
- beforeEach(() => {
- H.restore();
- cy.signInAsAdmin();
-
- hideTables([ORDERS_ID, PRODUCTS_ID, PEOPLE_ID, REVIEWS_ID]);
- });
-
- it("should still be able to set permissions on individual tables, even though they are hidden in data model (metabase#17777)", () => {
- cy.visit(`/admin/permissions/data/group/${ALL_USERS_GROUP}`);
-
- // eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
- cy.findByText("Permissions for the All Users group");
- cy.findByTextEnsureVisible("Sample Database").click();
-
- cy.location("pathname").should(
- "eq",
- `/admin/permissions/data/group/${ALL_USERS_GROUP}/database/${SAMPLE_DB_ID}`,
- );
-
- cy.findByTestId("permission-table").within(() => {
- cy.findByText("Orders");
- cy.findByText("Products");
- cy.findByText("Reviews");
- cy.findByText("People");
- });
-
- cy.findAllByText("No self-service").first().click();
-
- H.popover().contains("Unrestricted");
- });
-});
-
describe("issue 19603", () => {
beforeEach(() => {
H.restore();
diff --git a/e2e/test/scenarios/question-reproductions/reproductions-1.cy.spec.js b/e2e/test/scenarios/question-reproductions/reproductions-1.cy.spec.js
index f518cfc3523..d7c57dfe232 100644
--- a/e2e/test/scenarios/question-reproductions/reproductions-1.cy.spec.js
+++ b/e2e/test/scenarios/question-reproductions/reproductions-1.cy.spec.js
@@ -709,125 +709,3 @@ describe("issue 19742", () => {
});
});
});
-
-const QUESTION_1 = {
- name: "Q1",
- query: {
- "source-table": PRODUCTS_ID,
- aggregation: [["count"]],
- breakout: [["field", PRODUCTS.CATEGORY, { "base-type": "type/Text" }]],
- },
-};
-
-const QUESTION_2 = {
- name: "Q2",
- query: {
- "source-table": PRODUCTS_ID,
- aggregation: [
- ["sum", ["field", PRODUCTS.PRICE, { "base-type": "type/Float" }]],
- ],
- breakout: [["field", PRODUCTS.CATEGORY, { "base-type": "type/Text" }]],
- },
-};
-
-describe("issue 19893", () => {
- beforeEach(() => {
- H.restore();
- cy.signInAsAdmin();
- });
-
- it(
- "should display correct join source table when joining visited questions (metabase#19893)",
- { tags: "@skip" },
- () => {
- H.createQuestion(QUESTION_1, {
- wrapId: true,
- idAlias: "questionId1",
- visitQuestion: true,
- });
- H.createQuestion(QUESTION_2, {
- wrapId: true,
- idAlias: "questionId2",
- visitQuestion: true,
- });
-
- cy.then(function () {
- const { questionId1, questionId2 } = this;
-
- createQ1PlusQ2Question(questionId1, questionId2).then(
- ({ body: question }) => {
- cy.visit(`/question/${question.id}/notebook`);
- },
- );
- });
-
- assertQ1PlusQ2Joins();
- },
- );
-
- it(
- "should display correct join source table when joining non-visited questions (metabase#19893)",
- { tags: "@skip" },
- () => {
- H.createQuestion(QUESTION_1, { wrapId: true, idAlias: "questionId1" });
- H.createQuestion(QUESTION_2, { wrapId: true, idAlias: "questionId2" });
-
- cy.then(function () {
- const { questionId1, questionId2 } = this;
-
- createQ1PlusQ2Question(questionId1, questionId2).then(
- ({ body: question }) => {
- cy.visit(`/question/${question.id}/notebook`);
- },
- );
- });
-
- assertQ1PlusQ2Joins();
- },
- );
-});
-
-const createQ1PlusQ2Question = (questionId1, questionId2) => {
- return H.createQuestion({
- name: "Q1 + Q2",
- query: {
- "source-table": `card__${questionId1}`,
- joins: [
- {
- fields: "all",
- strategy: "left-join",
- alias: "Q2 - Category",
- condition: [
- "=",
- ["field", PRODUCTS.CATEGORY, { "base-type": "type/Text" }],
- [
- "field",
- PRODUCTS.CATEGORY,
- { "base-type": "type/Text", "join-alias": "Q2 - Category" },
- ],
- ],
- "source-table": `card__${questionId2}`,
- },
- ],
- },
- });
-};
-
-const assertQ1PlusQ2Joins = () => {
- H.getNotebookStep("join").within(() => {
- cy.findAllByTestId("notebook-cell-item").then((items) => {
- cy.wrap(items[0]).should("contain", QUESTION_1.name);
- cy.wrap(items[1]).should("contain", QUESTION_2.name);
- });
-
- cy.findByLabelText("Left column").within(() => {
- cy.findByText(QUESTION_1.name).should("exist");
- cy.findByText("Category").should("exist");
- });
-
- cy.findByLabelText("Right column").within(() => {
- cy.findByText(QUESTION_2.name).should("exist");
- cy.findByText("Q2 - Category → Category").should("exist");
- });
- });
-};
diff --git a/e2e/test/scenarios/question-reproductions/reproductions-3.cy.spec.js b/e2e/test/scenarios/question-reproductions/reproductions-3.cy.spec.js
index 7b75446d4bb..46db2611283 100644
--- a/e2e/test/scenarios/question-reproductions/reproductions-3.cy.spec.js
+++ b/e2e/test/scenarios/question-reproductions/reproductions-3.cy.spec.js
@@ -681,57 +681,6 @@ describe("issue 40064", () => {
});
});
-describe("issue 10493", { tags: "@skip" }, () => {
- beforeEach(() => {
- H.restore();
- cy.intercept("POST", "/api/dataset").as("dataset");
- cy.signInAsAdmin();
- });
-
- it("should not reset chart axes after adding a new query stage (metabase#10493)", () => {
- H.visitQuestionAdhoc({
- display: "bar",
- dataset_query: {
- type: "query",
- database: SAMPLE_DB_ID,
- query: {
- aggregation: [["count"]],
- breakout: [
- [
- "field",
- ORDERS.QUANTITY,
- { "base-type": "type/Integer", binning: { strategy: "default" } },
- ],
- ],
- "source-table": ORDERS_ID,
- },
- },
- });
-
- H.filter();
- H.modal().within(() => {
- cy.findByText("Summaries").click();
- cy.findByTestId("filter-column-Count").within(() => {
- cy.findByPlaceholderText("Min").type("0");
- cy.findByPlaceholderText("Max").type("30000");
- });
- cy.button("Apply filters").click();
- });
- cy.wait("@dataset");
-
- H.echartsContainer().within(() => {
- // y axis
- cy.findByText("Count").should("exist");
- cy.findByText("21,000").should("exist");
- cy.findByText("3,000").should("exist");
-
- // x axis
- cy.findByText("Quantity").should("exist");
- cy.findByText("25").should("exist");
- cy.findByText("75").should("exist");
- });
- });
-});
describe("issue 44071", () => {
const questionDetails = {
name: "Test",
diff --git a/e2e/test/scenarios/question-reproductions/reproductions-4.cy.spec.js b/e2e/test/scenarios/question-reproductions/reproductions-4.cy.spec.js
index 8f7b1c7fb5b..27476e35895 100644
--- a/e2e/test/scenarios/question-reproductions/reproductions-4.cy.spec.js
+++ b/e2e/test/scenarios/question-reproductions/reproductions-4.cy.spec.js
@@ -568,41 +568,6 @@ describe("issue 41464", () => {
});
});
-describe("issue 45359", { tags: "@skip" }, () => {
- beforeEach(() => {
- H.restore();
- cy.intercept("/app/fonts/Lato/lato-v16-latin-regular.woff2").as(
- "font-regular",
- );
- cy.intercept("/app/fonts/Lato/lato-v16-latin-700.woff2").as("font-bold");
- cy.signInAsAdmin();
- });
-
- it("loads app fonts correctly (metabase#45359)", () => {
- H.openOrdersTable({ mode: "notebook" });
-
- H.getNotebookStep("data")
- .findByText("Orders")
- .should("have.css", "font-family", "Lato, Arial, sans-serif");
-
- cy.get("@font-regular.all").should("have.length", 1);
- cy.get("@font-regular").should(({ response }) => {
- expect(response).to.include({ statusCode: 200 });
- });
-
- cy.get("@font-bold.all").should("have.length", 1);
- cy.get("@font-bold").should(({ response }) => {
- expect(response).to.include({ statusCode: 200 });
- });
-
- cy.document()
- .then((document) => document.fonts.ready)
- .then((fonts) => {
- cy.wrap(fonts).invoke("check", "16px Lato").should("be.true");
- });
- });
-});
-
describe("issue 45452", () => {
beforeEach(() => {
H.restore();
diff --git a/e2e/test/scenarios/question/column-compare.cy.spec.ts b/e2e/test/scenarios/question/column-compare.cy.spec.ts
deleted file mode 100644
index 0cc2117c8cf..00000000000
--- a/e2e/test/scenarios/question/column-compare.cy.spec.ts
+++ /dev/null
@@ -1,1993 +0,0 @@
-import _ from "underscore";
-
-const { H } = cy;
-import { SAMPLE_DB_ID } from "e2e/support/cypress_data";
-import { SAMPLE_DATABASE } from "e2e/support/cypress_sample_database";
-import type { FieldReference, StructuredQuery } from "metabase-types/api";
-
-const { PRODUCTS_ID, PRODUCTS, ORDERS, ORDERS_ID, PEOPLE } = SAMPLE_DATABASE;
-
-const FIELD_PRICE: FieldReference = [
- "field",
- PRODUCTS.PRICE,
- { "base-type": "type/Float" },
-];
-
-const BREAKOUT_BINNED_DATETIME: FieldReference = [
- "field",
- PRODUCTS.CREATED_AT,
- { "base-type": "type/DateTime", "temporal-unit": "month" },
-];
-
-const BREAKOUT_NON_BINNED_DATETIME: FieldReference = [
- "field",
- PRODUCTS.CREATED_AT,
- { "base-type": "type/DateTime" },
-];
-
-const BREAKOUT_NON_DATETIME: FieldReference = [
- "field",
- PRODUCTS.CATEGORY,
- { "base-type": "type/Text" },
-];
-
-const BREAKOUT_OTHER_DATETIME: FieldReference = [
- "field",
- PEOPLE.CREATED_AT,
- {
- "base-type": "type/DateTime",
- "temporal-unit": "month",
- "source-field": ORDERS.USER_ID,
- },
-];
-
-const QUERY_NO_AGGREGATION: StructuredQuery = {
- "source-table": PRODUCTS_ID,
-};
-
-const QUERY_SINGLE_AGGREGATION_NO_BREAKOUT: StructuredQuery = {
- "source-table": PRODUCTS_ID,
- aggregation: [["count"]],
-};
-
-const QUERY_MULTIPLE_AGGREGATIONS_NO_BREAKOUT: StructuredQuery = {
- "source-table": PRODUCTS_ID,
- aggregation: [["count"], ["sum", FIELD_PRICE]],
-};
-
-const QUERY_SINGLE_AGGREGATION_BINNED_DATETIME_BREAKOUT: StructuredQuery = {
- "source-table": PRODUCTS_ID,
- aggregation: [["count"]],
- breakout: [BREAKOUT_BINNED_DATETIME],
-};
-
-const QUERY_SINGLE_AGGREGATION_OTHER_DATETIME: StructuredQuery = {
- "source-table": ORDERS_ID,
- aggregation: [["count"]],
- breakout: [BREAKOUT_OTHER_DATETIME],
-};
-
-const QUERY_SINGLE_AGGREGATION_NON_BINNED_DATETIME_BREAKOUT: StructuredQuery = {
- "source-table": PRODUCTS_ID,
- aggregation: [["count"]],
- breakout: [BREAKOUT_NON_BINNED_DATETIME],
-};
-
-const QUERY_SINGLE_AGGREGATION_NON_DATETIME_BREAKOUT: StructuredQuery = {
- "source-table": PRODUCTS_ID,
- aggregation: [["count"]],
- breakout: [BREAKOUT_NON_DATETIME],
-};
-
-const QUERY_MULTIPLE_AGGREGATIONS_BINNED_DATETIME_BREAKOUT: StructuredQuery = {
- "source-table": PRODUCTS_ID,
- aggregation: [["count"], ["sum", FIELD_PRICE]],
- breakout: [BREAKOUT_BINNED_DATETIME],
-};
-
-const QUERY_MULTIPLE_AGGREGATIONS_NON_BINNED_DATETIME_BREAKOUT: StructuredQuery =
- {
- "source-table": PRODUCTS_ID,
- aggregation: [["count"], ["sum", FIELD_PRICE]],
- breakout: [BREAKOUT_NON_BINNED_DATETIME],
- };
-
-const QUERY_MULTIPLE_AGGREGATIONS_NON_DATETIME_BREAKOUT: StructuredQuery = {
- "source-table": PRODUCTS_ID,
- aggregation: [["count"], ["sum", FIELD_PRICE]],
- breakout: [BREAKOUT_NON_DATETIME],
-};
-
-const QUERY_MULTIPLE_BREAKOUTS: StructuredQuery = {
- "source-table": PRODUCTS_ID,
- aggregation: [["count"]],
- breakout: [BREAKOUT_NON_DATETIME, BREAKOUT_BINNED_DATETIME],
-};
-
-const QUERY_MULTIPLE_TEMPORAL_BREAKOUTS: StructuredQuery = {
- "source-table": PRODUCTS_ID,
- aggregation: [["count"]],
- breakout: [
- BREAKOUT_NON_DATETIME,
- BREAKOUT_BINNED_DATETIME,
- BREAKOUT_NON_BINNED_DATETIME,
- ],
-};
-
-const QUERY_TEMPORAL_EXPRESSION_BREAKOUT: StructuredQuery = {
- "source-table": PRODUCTS_ID,
- expressions: {
- "Created At plus one month": [
- "datetime-add",
- [
- "field",
- PRODUCTS.CREATED_AT,
- {
- "base-type": "type/DateTime",
- },
- ],
- 1,
- "month",
- ],
- },
- aggregation: [["count"]],
- breakout: [
- [
- "expression",
- "Created At plus one month",
- {
- "base-type": "type/DateTime",
- "temporal-unit": "month",
- },
- ],
- ],
-};
-
-const CUSTOM_EXPRESSIONS_USED = [
- "offset",
- "count",
- "-",
- "count",
- "offset",
- "count",
- "-",
- "/",
- "count",
- "offset",
- "count",
-];
-
-const CUSTOM_EXPRESSIONS_USED_MOVING_AVERAGE = [
- "/",
- "+",
- "offset",
- "count",
- "offset",
- "count",
- "-",
- "count",
- "/",
- "+",
- "offset",
- "count",
- "offset",
- "count",
- "/",
- "count",
- "/",
- "+",
- "offset",
- "count",
- "offset",
- "count",
-];
-
-// TODO: reenable test when we reenable the "Compare to the past" components.
-describe("scenarios > question", { tags: "@skip" }, () => {
- describe("column compare", () => {
- beforeEach(() => {
- H.restore();
- H.resetSnowplow();
- cy.signInAsAdmin();
- });
-
- afterEach(() => {
- H.expectNoBadSnowplowEvents();
- });
-
- describe("no aggregations", () => {
- it("does not show column compare shortcut", () => {
- H.createQuestion(
- { query: QUERY_NO_AGGREGATION },
- { visitQuestion: true, wrapId: true, idAlias: "questionId" },
- );
-
- cy.log("chill mode - summarize sidebar");
- cy.button(/Summarize/).click();
- H.rightSidebar().button("Count").icon("close").click();
- H.rightSidebar().button("Add aggregation").click();
- verifyNoColumnCompareShortcut();
-
- cy.log("chill mode - column drill");
- H.tableHeaderClick("Title");
- verifyNoColumnCompareShortcut();
-
- cy.log("chill mode - plus button");
- cy.button("Add column").click();
- verifyNoColumnCompareShortcut();
-
- cy.log("notebook editor");
- H.openNotebook();
- cy.button(/Summarize/).click();
- verifyNoColumnCompareShortcut();
- });
- });
-
- describe("no temporal columns", () => {
- beforeEach(() => {
- cy.request("PUT", `/api/field/${PRODUCTS.CREATED_AT}`, {
- base_type: "type/Text",
- });
- });
-
- it("no breakout", () => {
- H.createQuestion(
- { query: QUERY_NO_AGGREGATION },
- { visitQuestion: true, wrapId: true, idAlias: "questionId" },
- );
-
- cy.log("chill mode - summarize sidebar");
- cy.button(/Summarize/).click();
- H.rightSidebar().button("Count").icon("close").click();
- H.rightSidebar().button("Add aggregation").click();
- verifyNoColumnCompareShortcut();
-
- cy.log("chill mode - column drill");
- H.tableHeaderClick("Title");
- verifyNoColumnCompareShortcut();
-
- cy.log("chill mode - plus button");
- cy.button("Add column").click();
- verifyNoColumnCompareShortcut();
-
- cy.log("notebook editor");
- H.openNotebook();
- cy.button("Summarize").click();
- verifyNoColumnCompareShortcut();
- });
-
- it("one breakout", () => {
- H.createQuestion(
- { query: QUERY_SINGLE_AGGREGATION_NON_DATETIME_BREAKOUT },
- { visitQuestion: true, wrapId: true, idAlias: "questionId" },
- );
-
- cy.log("chill mode - summarize sidebar");
- cy.button(/Summarize/).click();
- H.rightSidebar().button("Count").icon("close").click();
- H.rightSidebar().button("Add aggregation").click();
- verifyNoColumnCompareShortcut();
-
- cy.log("chill mode - column drill");
- H.tableHeaderClick("Category");
- verifyNoColumnCompareShortcut();
-
- cy.log("chill mode - plus button");
- cy.button("Add column").click();
- verifyNoColumnCompareShortcut();
-
- cy.log("notebook editor");
- H.openNotebook();
- cy.button("Summarize").click();
- verifyNoColumnCompareShortcut();
- });
- });
-
- describe("offset", () => {
- it("should be possible to change the temporal bucket through a preset", () => {
- H.createQuestion(
- { query: QUERY_SINGLE_AGGREGATION_NO_BREAKOUT },
- { visitQuestion: true, wrapId: true, idAlias: "questionId" },
- );
-
- H.openNotebook();
- // eslint-disable-next-line metabase/no-unsafe-element-filtering
- H.getNotebookStep("summarize")
- .findAllByTestId("aggregate-step")
- .last()
- .icon("add")
- .click();
-
- H.popover().within(() => {
- cy.findByText("Basic functions").click();
- cy.findByText("Compare to the past").click();
-
- cy.findByText("Previous year").click();
- cy.findByText("Done").click();
- });
-
- verifyBreakoutExistsAndIsFirst({
- column: "Created At",
- bucket: "Year",
- });
-
- verifyAggregations([
- {
- name: "Count (previous year)",
- expression: "Offset(Count, -1)",
- },
- {
- name: "Count (% vs previous year)",
- expression: "Count / Offset(Count, -1) - 1",
- },
- ]);
- });
-
- it("should be possible to change the temporal bucket with a custom offset", () => {
- H.createQuestion(
- { query: QUERY_SINGLE_AGGREGATION_NO_BREAKOUT },
- { visitQuestion: true, wrapId: true, idAlias: "questionId" },
- );
-
- H.openNotebook();
- // eslint-disable-next-line metabase/no-unsafe-element-filtering
- H.getNotebookStep("summarize")
- .findAllByTestId("aggregate-step")
- .last()
- .icon("add")
- .click();
-
- H.popover().within(() => {
- cy.findByText("Basic functions").click();
- cy.findByText("Compare to the past").click();
-
- cy.findByText("Custom...").click();
-
- cy.findByLabelText("Offset").clear().type("2");
- cy.findByLabelText("Unit").click();
- });
-
- // eslint-disable-next-line metabase/no-unsafe-element-filtering
- H.popover().last().findByText("Weeks").click();
-
- H.popover().within(() => {
- cy.findByText("Done").click();
- });
-
- verifyBreakoutExistsAndIsFirst({
- column: "Created At",
- bucket: "Week",
- });
-
- verifyAggregations([
- {
- name: "Count (2 weeks ago)",
- expression: "Offset(Count, -2)",
- },
- {
- name: "Count (% vs 2 weeks ago)",
- expression: "Count / Offset(Count, -2) - 1",
- },
- ]);
- });
-
- describe("single aggregation", () => {
- it("no breakout", () => {
- H.createQuestion(
- { query: QUERY_SINGLE_AGGREGATION_NO_BREAKOUT },
- { visitQuestion: true, wrapId: true, idAlias: "questionId" },
- );
-
- const info = {
- itemName: "Compare to the past",
- step2Title: "Compare “Count” to the past",
- presets: ["Previous month", "Previous year"],
- offsetHelp: "ago",
- };
-
- verifySummarizeText(info);
- verifyColumnDrillText(info);
- verifyPlusButtonText(info);
- verifyNotebookText(info);
-
- toggleColumnPickerItems(["Value difference"]);
- H.popover().button("Done").click();
-
- cy.get("@questionId").then((questionId) => {
- H.expectUnstructuredSnowplowEvent({
- event: "column_compare_via_shortcut",
- custom_expressions_used: CUSTOM_EXPRESSIONS_USED,
- database_id: SAMPLE_DB_ID,
- question_id: questionId,
- });
- });
-
- verifyBreakoutExistsAndIsFirst({
- column: "Created At",
- bucket: "Month",
- });
-
- verifyAggregations([
- {
- name: "Count (previous month)",
- expression: "Offset(Count, -1)",
- },
- {
- name: "Count (vs previous month)",
- expression: "Count - Offset(Count, -1)",
- },
- {
- name: "Count (% vs previous month)",
- expression: "Count / Offset(Count, -1) - 1",
- },
- ]);
- });
-
- it("breakout on binned datetime column", () => {
- H.createQuestion(
- { query: QUERY_SINGLE_AGGREGATION_BINNED_DATETIME_BREAKOUT },
- { visitQuestion: true, wrapId: true, idAlias: "questionId" },
- );
-
- const info = {
- itemName: "Compare to the past",
- step2Title: "Compare “Count” to the past",
- presets: ["Previous month", "Previous year"],
- offsetHelp: "ago",
- };
-
- verifySummarizeText(info);
-
- H.tableHeaderClick("Created At: Month");
- verifyNoColumnCompareShortcut();
-
- verifyColumnDrillText(info);
- verifyPlusButtonText(info);
- verifyNotebookText(info);
-
- toggleColumnPickerItems(["Value difference"]);
- H.popover().button("Done").click();
-
- cy.get("@questionId").then((questionId) => {
- H.expectUnstructuredSnowplowEvent({
- event: "column_compare_via_shortcut",
- custom_expressions_used: CUSTOM_EXPRESSIONS_USED,
- database_id: SAMPLE_DB_ID,
- question_id: questionId,
- });
- });
-
- verifyAggregations([
- {
- name: "Count (previous month)",
- expression: "Offset(Count, -1)",
- },
- {
- name: "Count (vs previous month)",
- expression: "Count - Offset(Count, -1)",
- },
- {
- name: "Count (% vs previous month)",
- expression: "Count / Offset(Count, -1) - 1",
- },
- ]);
- verifyBreakoutExistsAndIsFirst({
- column: "Created At",
- bucket: "Month",
- });
-
- verifyColumns([
- "Count (previous month)",
- "Count (vs previous month)",
- "Count (% vs previous month)",
- ]);
- });
-
- it("breakout on non-binned datetime column", () => {
- H.createQuestion(
- { query: QUERY_SINGLE_AGGREGATION_NON_BINNED_DATETIME_BREAKOUT },
- { visitQuestion: true, wrapId: true, idAlias: "questionId" },
- );
-
- const info = {
- itemName: "Compare to the past",
- step2Title: "Compare “Count” to the past",
- presets: ["Previous month", "Previous year"],
- offsetHelp: "ago",
- };
-
- verifySummarizeText(info);
-
- H.tableHeaderClick("Created At: Day");
- verifyNoColumnCompareShortcut();
-
- verifyColumnDrillText(info);
- verifyPlusButtonText(info);
- verifyNotebookText(info);
-
- toggleColumnPickerItems(["Value difference"]);
- H.popover().button("Done").click();
-
- cy.get("@questionId").then((questionId) => {
- H.expectUnstructuredSnowplowEvent({
- event: "column_compare_via_shortcut",
- custom_expressions_used: CUSTOM_EXPRESSIONS_USED,
- database_id: SAMPLE_DB_ID,
- question_id: questionId,
- });
- });
-
- verifyAggregations([
- {
- name: "Count (previous period)",
- expression: "Offset(Count, -1)",
- },
- {
- name: "Count (vs previous period)",
- expression: "Count - Offset(Count, -1)",
- },
- {
- name: "Count (% vs previous period)",
- expression: "Count / Offset(Count, -1) - 1",
- },
- ]);
-
- verifyColumns([
- "Count (previous period)",
- "Count (vs previous period)",
- "Count (% vs previous period)",
- ]);
- });
-
- it("breakout on non-datetime column", () => {
- H.createQuestion(
- { query: QUERY_SINGLE_AGGREGATION_NON_DATETIME_BREAKOUT },
- { visitQuestion: true, wrapId: true, idAlias: "questionId" },
- );
-
- const info = {
- itemName: "Compare to the past",
- step2Title: "Compare “Count” to the past",
- presets: ["Previous month", "Previous year"],
- offsetHelp: "ago",
- };
-
- verifySummarizeText(info);
-
- H.tableHeaderClick("Category");
- verifyNoColumnCompareShortcut();
-
- verifyColumnDrillText(info);
- verifyPlusButtonText(info);
-
- H.openNotebook();
-
- cy.button("Summarize").click();
- verifyNoColumnCompareShortcut();
- cy.realPress("Escape");
-
- cy.button(/Visualization/).click();
- H.queryBuilderMain().findByText("42").should("be.visible");
-
- verifyNotebookText(info);
-
- toggleColumnPickerItems(["Value difference"]);
- H.popover().button("Done").click();
-
- cy.get("@questionId").then((questionId) => {
- H.expectUnstructuredSnowplowEvent({
- event: "column_compare_via_shortcut",
- custom_expressions_used: CUSTOM_EXPRESSIONS_USED,
- database_id: SAMPLE_DB_ID,
- question_id: questionId,
- });
- });
-
- verifyAggregations([
- {
- name: "Count (previous month)",
- expression: "Offset(Count, -1)",
- },
- {
- name: "Count (vs previous month)",
- expression: "Count - Offset(Count, -1)",
- },
- {
- name: "Count (% vs previous month)",
- expression: "Count / Offset(Count, -1) - 1",
- },
- ]);
-
- verifyBreakoutExistsAndIsFirst({
- column: "Created At",
- bucket: "Month",
- });
-
- verifyColumns([
- "Count (previous month)",
- "Count (vs previous month)",
- "Count (% vs previous month)",
- ]);
- });
-
- it("breakout on temporal column which is an expression", () => {
- H.createQuestion(
- { query: QUERY_TEMPORAL_EXPRESSION_BREAKOUT },
- { visitQuestion: true, wrapId: true, idAlias: "questionId" },
- );
-
- const info = {
- itemName: "Compare to the past",
- step2Title: "Compare “Count” to the past",
- presets: ["Previous month", "Previous year"],
- offsetHelp: "ago",
- };
-
- verifySummarizeText(info);
-
- H.tableHeaderClick("Created At plus one month: Month");
- verifyNoColumnCompareShortcut();
-
- verifyColumnDrillText(info);
- verifyPlusButtonText(info);
- verifyNotebookText(info);
-
- toggleColumnPickerItems(["Value difference"]);
- H.popover().button("Done").click();
-
- cy.get("@questionId").then((questionId) => {
- H.expectUnstructuredSnowplowEvent({
- event: "column_compare_via_shortcut",
- custom_expressions_used: CUSTOM_EXPRESSIONS_USED,
- database_id: SAMPLE_DB_ID,
- question_id: questionId,
- });
- });
-
- verifyAggregations([
- {
- name: "Count (previous month)",
- expression: "Offset(Count, -1)",
- },
- {
- name: "Count (vs previous month)",
- expression: "Count - Offset(Count, -1)",
- },
- {
- name: "Count (% vs previous month)",
- expression: "Count / Offset(Count, -1) - 1",
- },
- ]);
-
- verifyBreakoutExistsAndIsFirst({
- column: "Created At plus one month",
- bucket: "Month",
- });
-
- verifyColumns([
- "Count (previous month)",
- "Count (vs previous month)",
- "Count (% vs previous month)",
- ]);
- });
-
- it("multiple breakouts", () => {
- H.createQuestion(
- { query: QUERY_MULTIPLE_BREAKOUTS },
- { visitQuestion: true, wrapId: true, idAlias: "questionId" },
- );
-
- const info = {
- itemName: "Compare to the past",
- step2Title: "Compare “Count” to the past",
- presets: ["Previous month", "Previous year"],
- offsetHelp: "ago",
- };
-
- verifySummarizeText(info);
- verifyPlusButtonText(info);
- verifyNotebookText(info);
-
- toggleColumnPickerItems(["Value difference"]);
- H.popover().button("Done").click();
-
- cy.get("@questionId").then((questionId) => {
- H.expectUnstructuredSnowplowEvent({
- event: "column_compare_via_shortcut",
- custom_expressions_used: CUSTOM_EXPRESSIONS_USED,
- database_id: SAMPLE_DB_ID,
- question_id: questionId,
- });
- });
-
- verifyAggregations([
- {
- name: "Count (previous month)",
- expression: "Offset(Count, -1)",
- },
- {
- name: "Count (vs previous month)",
- expression: "Count - Offset(Count, -1)",
- },
- {
- name: "Count (% vs previous month)",
- expression: "Count / Offset(Count, -1) - 1",
- },
- ]);
-
- verifyBreakoutExistsAndIsFirst({
- column: "Created At",
- bucket: "Month",
- });
- breakout({ column: "Category" }).should("exist");
-
- verifyColumns([
- "Count (previous month)",
- "Count (vs previous month)",
- "Count (% vs previous month)",
- ]);
- });
-
- it("multiple temporal breakouts", () => {
- H.createQuestion(
- { query: QUERY_MULTIPLE_TEMPORAL_BREAKOUTS },
- { visitQuestion: true, wrapId: true, idAlias: "questionId" },
- );
-
- const info = {
- itemName: "Compare to the past",
- step2Title: "Compare “Count” to the past",
- presets: ["Previous month", "Previous year"],
- offsetHelp: "ago",
- };
-
- verifySummarizeText(info);
- verifyPlusButtonText(info);
- verifyNotebookText(info);
-
- toggleColumnPickerItems(["Value difference"]);
- H.popover().button("Done").click();
-
- cy.get("@questionId").then((questionId) => {
- H.expectUnstructuredSnowplowEvent({
- event: "column_compare_via_shortcut",
- custom_expressions_used: CUSTOM_EXPRESSIONS_USED,
- database_id: SAMPLE_DB_ID,
- question_id: questionId,
- });
- });
-
- verifyAggregations([
- {
- name: "Count (previous month)",
- expression: "Offset(Count, -1)",
- },
- {
- name: "Count (vs previous month)",
- expression: "Count - Offset(Count, -1)",
- },
- {
- name: "Count (% vs previous month)",
- expression: "Count / Offset(Count, -1) - 1",
- },
- ]);
-
- verifyBreakoutExistsAndIsFirst({
- column: "Created At",
- bucket: "Month",
- });
- breakout({ column: "Category" }).should("exist");
- breakout({ column: "Created At" }).should("exist");
-
- verifyColumns([
- "Count (previous month)",
- "Count (vs previous month)",
- "Count (% vs previous month)",
- ]);
- });
-
- it("one breakout on non-default datetime column", () => {
- H.createQuestion(
- { query: QUERY_SINGLE_AGGREGATION_OTHER_DATETIME },
- { visitQuestion: true, wrapId: true, idAlias: "questionId" },
- );
-
- const info = {
- itemName: "Compare to the past",
- step2Title: "Compare “Count” to the past",
- presets: ["Previous month", "Previous year"],
- offsetHelp: "ago",
- };
-
- verifySummarizeText(info);
-
- H.tableHeaderClick("Count");
- verifyNoColumnCompareShortcut();
-
- verifyColumnDrillText(info);
- verifyPlusButtonText(info);
- verifyNotebookText(info);
-
- toggleColumnPickerItems(["Value difference"]);
- H.popover().button("Done").click();
-
- cy.get("@questionId").then((questionId) => {
- H.expectUnstructuredSnowplowEvent({
- event: "column_compare_via_shortcut",
- custom_expressions_used: CUSTOM_EXPRESSIONS_USED,
- database_id: SAMPLE_DB_ID,
- question_id: questionId,
- });
- });
-
- verifyAggregations([
- {
- name: "Count (previous month)",
- expression: "Offset(Count, -1)",
- },
- {
- name: "Count (vs previous month)",
- expression: "Count - Offset(Count, -1)",
- },
- {
- name: "Count (% vs previous month)",
- expression: "Count / Offset(Count, -1) - 1",
- },
- ]);
-
- verifyBreakoutExistsAndIsFirst({
- column: "User → Created At",
- bucket: "Month",
- });
- breakout({ column: "Created At", bucket: "Month" }).should(
- "not.exist",
- );
-
- verifyColumns([
- "Count (previous month)",
- "Count (vs previous month)",
- "Count (% vs previous month)",
- ]);
- });
- });
-
- describe("multiple aggregations", () => {
- it("no breakout", () => {
- H.createQuestion(
- { query: QUERY_MULTIPLE_AGGREGATIONS_NO_BREAKOUT },
- { visitQuestion: true, wrapId: true, idAlias: "questionId" },
- );
-
- const info = {
- itemName: "Compare to the past",
- step1Title: "Compare one of these to the past",
- step2Title: "Compare “Count” to the past",
- presets: ["Previous month", "Previous year"],
- offsetHelp: "ago",
- };
-
- verifySummarizeText(info);
- verifyColumnDrillText(info);
- verifyPlusButtonText(info);
- verifyNotebookText(info);
-
- toggleColumnPickerItems(["Value difference"]);
- H.popover().button("Done").click();
-
- cy.get("@questionId").then((questionId) => {
- H.expectUnstructuredSnowplowEvent({
- event: "column_compare_via_shortcut",
- custom_expressions_used: CUSTOM_EXPRESSIONS_USED,
- database_id: SAMPLE_DB_ID,
- question_id: questionId,
- });
- });
-
- verifyBreakoutExistsAndIsFirst({
- column: "Created At",
- bucket: "Month",
- });
- verifyAggregations([
- {
- name: "Count (previous month)",
- expression: "Offset(Count, -1)",
- },
- {
- name: "Count (vs previous month)",
- expression: "Count - Offset(Count, -1)",
- },
- {
- name: "Count (% vs previous month)",
- expression: "Count / Offset(Count, -1) - 1",
- },
- ]);
- });
-
- it("breakout on binned datetime column", () => {
- H.createQuestion(
- { query: QUERY_MULTIPLE_AGGREGATIONS_BINNED_DATETIME_BREAKOUT },
- { visitQuestion: true, wrapId: true, idAlias: "questionId" },
- );
-
- const info = {
- itemName: "Compare to the past",
- step1Title: "Compare one of these to the past",
- step2Title: "Compare “Count” to the past",
- presets: ["Previous month", "Previous year"],
- offsetHelp: "ago",
- };
-
- verifySummarizeText(info);
-
- H.tableHeaderClick("Created At: Month");
- verifyNoColumnCompareShortcut();
-
- verifyColumnDrillText(_.omit(info, "step1Title"));
- verifyPlusButtonText(info);
- verifyNotebookText(info);
-
- toggleColumnPickerItems(["Value difference"]);
- H.popover().button("Done").click();
-
- cy.get("@questionId").then((questionId) => {
- H.expectUnstructuredSnowplowEvent({
- event: "column_compare_via_shortcut",
- custom_expressions_used: CUSTOM_EXPRESSIONS_USED,
- database_id: SAMPLE_DB_ID,
- question_id: questionId,
- });
- });
-
- verifyAggregations([
- {
- name: "Count (previous month)",
- expression: "Offset(Count, -1)",
- },
- {
- name: "Count (vs previous month)",
- expression: "Count - Offset(Count, -1)",
- },
- {
- name: "Count (% vs previous month)",
- expression: "Count / Offset(Count, -1) - 1",
- },
- ]);
-
- verifyColumns([
- "Count (previous month)",
- "Count (vs previous month)",
- "Count (% vs previous month)",
- ]);
- });
-
- it("breakout on non-binned datetime column", () => {
- H.createQuestion(
- { query: QUERY_MULTIPLE_AGGREGATIONS_NON_BINNED_DATETIME_BREAKOUT },
- { visitQuestion: true, wrapId: true, idAlias: "questionId" },
- );
-
- const info = {
- itemName: "Compare to the past",
- step1Title: "Compare one of these to the past",
- step2Title: "Compare “Count” to the past",
- presets: ["Previous month", "Previous year"],
- offsetHelp: "ago",
- };
-
- verifySummarizeText(info);
-
- H.tableHeaderClick("Created At: Day");
- verifyNoColumnCompareShortcut();
-
- verifyColumnDrillText(_.omit(info, "step1Title"));
- verifyPlusButtonText(info);
- verifyNotebookText(info);
-
- toggleColumnPickerItems(["Value difference"]);
- H.popover().button("Done").click();
-
- cy.get("@questionId").then((questionId) => {
- H.expectUnstructuredSnowplowEvent({
- event: "column_compare_via_shortcut",
- custom_expressions_used: CUSTOM_EXPRESSIONS_USED,
- database_id: SAMPLE_DB_ID,
- question_id: questionId,
- });
- });
-
- verifyAggregations([
- {
- name: "Count (previous period)",
- expression: "Offset(Count, -1)",
- },
- {
- name: "Count (vs previous period)",
- expression: "Count - Offset(Count, -1)",
- },
- {
- name: "Count (% vs previous period)",
- expression: "Count / Offset(Count, -1) - 1",
- },
- ]);
-
- verifyColumns([
- "Count (previous period)",
- "Count (vs previous period)",
- "Count (% vs previous period)",
- ]);
- });
-
- it("breakout on non-datetime column", () => {
- H.createQuestion(
- { query: QUERY_MULTIPLE_AGGREGATIONS_NON_DATETIME_BREAKOUT },
- { visitQuestion: true, wrapId: true, idAlias: "questionId" },
- );
-
- const info = {
- itemName: "Compare to the past",
- step2Title: "Compare “Count” to the past",
- step1Title: "Compare one of these to the past",
- presets: ["Previous month", "Previous year"],
- offsetHelp: "ago",
- };
-
- verifySummarizeText(info);
-
- H.tableHeaderClick("Category");
- verifyNoColumnCompareShortcut();
-
- verifyColumnDrillText(_.omit(info, "step1Title"));
- verifyPlusButtonText(info);
- verifyNotebookText(info);
-
- toggleColumnPickerItems(["Value difference"]);
- H.popover().button("Done").click();
-
- cy.get("@questionId").then((questionId) => {
- H.expectUnstructuredSnowplowEvent({
- event: "column_compare_via_shortcut",
- custom_expressions_used: CUSTOM_EXPRESSIONS_USED,
- database_id: SAMPLE_DB_ID,
- question_id: questionId,
- });
- });
-
- verifyAggregations([
- {
- name: "Count (previous month)",
- expression: "Offset(Count, -1)",
- },
- {
- name: "Count (vs previous month)",
- expression: "Count - Offset(Count, -1)",
- },
- {
- name: "Count (% vs previous month)",
- expression: "Count / Offset(Count, -1) - 1",
- },
- ]);
-
- verifyColumns([
- "Count (previous month)",
- "Count (vs previous month)",
- "Count (% vs previous month)",
- ]);
- });
- });
- });
-
- describe("moving average", () => {
- it("should be possible to change the temporal bucket with a custom offset", () => {
- H.createQuestion(
- { query: QUERY_SINGLE_AGGREGATION_NO_BREAKOUT },
- { visitQuestion: true, wrapId: true, idAlias: "questionId" },
- );
-
- H.openNotebook();
- // eslint-disable-next-line metabase/no-unsafe-element-filtering
- H.getNotebookStep("summarize")
- .findAllByTestId("aggregate-step")
- .last()
- .icon("add")
- .click();
-
- H.popover().within(() => {
- cy.findByText("Basic functions").click();
- cy.findByText("Compare to the past").click();
-
- cy.findByText("Moving average").click();
-
- cy.findByLabelText("Offset").clear().type("3");
- cy.findByLabelText("Unit").click();
- });
-
- // eslint-disable-next-line metabase/no-unsafe-element-filtering
- H.popover().last().findByText("Week").click();
-
- H.popover().within(() => {
- cy.findByText("Done").click();
- });
-
- verifyBreakoutExistsAndIsFirst({
- column: "Created At",
- bucket: "Week",
- });
-
- verifyAggregations([
- {
- name: "Count (3-week moving average)",
- expression:
- "(Offset(Count, -1) + Offset(Count, -2) + Offset(Count, -3)) / 3",
- },
- {
- name: "Count (% vs 3-week moving average)",
- expression:
- "Count / ((Offset(Count, -1) + Offset(Count, -2) + Offset(Count, -3)) / 3)",
- },
- ]);
- });
-
- describe("single aggregation", () => {
- it("no breakout", () => {
- H.createQuestion(
- { query: QUERY_SINGLE_AGGREGATION_NO_BREAKOUT },
- { visitQuestion: true, wrapId: true, idAlias: "questionId" },
- );
-
- const info = {
- type: "moving-average" as const,
- itemName: "Compare to the past",
- step2Title: "Compare “Count” to the past",
- offsetHelp: "moving average",
- };
-
- verifySummarizeText(info);
- verifyColumnDrillText(info);
- verifyPlusButtonText(info);
- verifyNotebookText(info);
-
- toggleColumnPickerItems(["Value difference"]);
- H.popover().button("Done").click();
-
- cy.get("@questionId").then((questionId) => {
- H.expectUnstructuredSnowplowEvent({
- event: "column_compare_via_shortcut",
- custom_expressions_used: CUSTOM_EXPRESSIONS_USED_MOVING_AVERAGE,
- database_id: SAMPLE_DB_ID,
- question_id: questionId,
- });
- });
-
- verifyBreakoutExistsAndIsFirst({
- column: "Created At",
- bucket: "Month",
- });
-
- verifyAggregations([
- {
- name: "Count (2-month moving average)",
- expression: "(Offset(Count, -1) + Offset(Count, -2)) / 2",
- },
- {
- name: "Count (vs 2-month moving average)",
- expression: "Count - (Offset(Count, -1) + Offset(Count, -2)) / 2",
- },
- {
- name: "Count (% vs 2-month moving average)",
- expression:
- "Count / ((Offset(Count, -1) + Offset(Count, -2)) / 2)",
- },
- ]);
-
- verifyColumns([
- "Count (2-month moving average)",
- "Count (vs 2-month moving average)",
- "Count (% vs 2-month moving average)",
- ]);
- });
-
- it("breakout on binned datetime column", () => {
- H.createQuestion(
- { query: QUERY_SINGLE_AGGREGATION_BINNED_DATETIME_BREAKOUT },
- { visitQuestion: true, wrapId: true, idAlias: "questionId" },
- );
-
- const info = {
- type: "moving-average" as const,
- itemName: "Compare to the past",
- step2Title: "Compare “Count” to the past",
- offsetHelp: "moving average",
- };
-
- verifySummarizeText(info);
-
- H.tableHeaderClick("Created At: Month");
- verifyNoColumnCompareShortcut();
-
- verifyColumnDrillText(info);
- verifyPlusButtonText(info);
- verifyNotebookText(info);
-
- toggleColumnPickerItems(["Value difference"]);
- H.popover().button("Done").click();
-
- cy.get("@questionId").then((questionId) => {
- H.expectUnstructuredSnowplowEvent({
- event: "column_compare_via_shortcut",
- custom_expressions_used: CUSTOM_EXPRESSIONS_USED_MOVING_AVERAGE,
- database_id: SAMPLE_DB_ID,
- question_id: questionId,
- });
- });
-
- verifyAggregations([
- {
- name: "Count (2-month moving average)",
- expression: "(Offset(Count, -1) + Offset(Count, -2)) / 2",
- },
- {
- name: "Count (vs 2-month moving average)",
- expression: "Count - (Offset(Count, -1) + Offset(Count, -2)) / 2",
- },
- {
- name: "Count (% vs 2-month moving average)",
- expression:
- "Count / ((Offset(Count, -1) + Offset(Count, -2)) / 2)",
- },
- ]);
-
- verifyBreakoutExistsAndIsFirst({
- column: "Created At",
- bucket: "Month",
- });
-
- verifyColumns([
- "Count (2-month moving average)",
- "Count (vs 2-month moving average)",
- "Count (% vs 2-month moving average)",
- ]);
- });
-
- it("breakout on non-binned datetime column", () => {
- H.createQuestion(
- { query: QUERY_SINGLE_AGGREGATION_NON_BINNED_DATETIME_BREAKOUT },
- { visitQuestion: true, wrapId: true, idAlias: "questionId" },
- );
-
- const info = {
- type: "moving-average" as const,
- itemName: "Compare to the past",
- step2Title: "Compare “Count” to the past",
- offsetHelp: "moving average",
- };
-
- verifySummarizeText(info);
-
- H.tableHeaderClick("Created At: Day");
- verifyNoColumnCompareShortcut();
-
- verifyColumnDrillText(info);
- verifyPlusButtonText(info);
- verifyNotebookText(info);
-
- toggleColumnPickerItems(["Value difference"]);
- H.popover().button("Done").click();
-
- cy.get("@questionId").then((questionId) => {
- H.expectUnstructuredSnowplowEvent({
- event: "column_compare_via_shortcut",
- custom_expressions_used: CUSTOM_EXPRESSIONS_USED_MOVING_AVERAGE,
- database_id: SAMPLE_DB_ID,
- question_id: questionId,
- });
- });
-
- verifyAggregations([
- {
- name: "Count (2-period moving average)",
- expression: "(Offset(Count, -1) + Offset(Count, -2)) / 2",
- },
- {
- name: "Count (vs 2-period moving average)",
- expression: "Count - (Offset(Count, -1) + Offset(Count, -2)) / 2",
- },
- {
- name: "Count (% vs 2-period moving average)",
- expression:
- "Count / ((Offset(Count, -1) + Offset(Count, -2)) / 2)",
- },
- ]);
-
- verifyBreakoutExistsAndIsFirst({
- column: "Created At",
- });
-
- verifyColumns([
- "Count (2-period moving average)",
- "Count (vs 2-period moving average)",
- "Count (% vs 2-period moving average)",
- ]);
- });
-
- it("breakout on non-datetime column", () => {
- H.createQuestion(
- { query: QUERY_SINGLE_AGGREGATION_NON_DATETIME_BREAKOUT },
- { visitQuestion: true, wrapId: true, idAlias: "questionId" },
- );
-
- const info = {
- type: "moving-average" as const,
- itemName: "Compare to the past",
- step2Title: "Compare “Count” to the past",
- offsetHelp: "moving average",
- };
-
- verifySummarizeText(info);
-
- H.tableHeaderClick("Category");
- verifyNoColumnCompareShortcut();
-
- verifyColumnDrillText(info);
- verifyPlusButtonText(info);
-
- H.openNotebook();
-
- cy.button(/Summarize/).click();
- verifyNoColumnCompareShortcut();
- cy.realPress("Escape");
-
- cy.button(/Visualization/).click();
- H.queryBuilderMain().findByText("42").should("be.visible");
-
- verifyNotebookText(info);
-
- toggleColumnPickerItems(["Value difference"]);
- H.popover().button("Done").click();
-
- cy.get("@questionId").then((questionId) => {
- H.expectUnstructuredSnowplowEvent({
- event: "column_compare_via_shortcut",
- custom_expressions_used: CUSTOM_EXPRESSIONS_USED_MOVING_AVERAGE,
- database_id: SAMPLE_DB_ID,
- question_id: questionId,
- });
- });
-
- verifyAggregations([
- {
- name: "Count (2-month moving average)",
- expression: "(Offset(Count, -1) + Offset(Count, -2)) / 2",
- },
- {
- name: "Count (vs 2-month moving average)",
- expression: "Count - (Offset(Count, -1) + Offset(Count, -2)) / 2",
- },
- {
- name: "Count (% vs 2-month moving average)",
- expression:
- "Count / ((Offset(Count, -1) + Offset(Count, -2)) / 2)",
- },
- ]);
-
- verifyBreakoutExistsAndIsFirst({
- column: "Created At",
- bucket: "Month",
- });
-
- verifyColumns([
- "Count (2-month moving average)",
- "Count (vs 2-month moving average)",
- "Count (% vs 2-month moving average)",
- ]);
- });
-
- it("multiple breakouts", () => {
- H.createQuestion(
- { query: QUERY_MULTIPLE_BREAKOUTS },
- { visitQuestion: true, wrapId: true, idAlias: "questionId" },
- );
-
- const info = {
- type: "moving-average" as const,
- itemName: "Compare to the past",
- step2Title: "Compare “Count” to the past",
- offsetHelp: "moving average",
- };
-
- verifySummarizeText(info);
- verifyPlusButtonText(info);
- verifyNotebookText(info);
-
- toggleColumnPickerItems(["Value difference"]);
- H.popover().button("Done").click();
-
- cy.get("@questionId").then((questionId) => {
- H.expectUnstructuredSnowplowEvent({
- event: "column_compare_via_shortcut",
- custom_expressions_used: CUSTOM_EXPRESSIONS_USED_MOVING_AVERAGE,
- database_id: SAMPLE_DB_ID,
- question_id: questionId,
- });
- });
-
- verifyAggregations([
- {
- name: "Count (2-month moving average)",
- expression: "(Offset(Count, -1) + Offset(Count, -2)) / 2",
- },
- {
- name: "Count (vs 2-month moving average)",
- expression: "Count - (Offset(Count, -1) + Offset(Count, -2)) / 2",
- },
- {
- name: "Count (% vs 2-month moving average)",
- expression:
- "Count / ((Offset(Count, -1) + Offset(Count, -2)) / 2)",
- },
- ]);
-
- verifyBreakoutExistsAndIsFirst({
- column: "Created At",
- bucket: "Month",
- });
- breakout({ column: "Category" }).should("exist");
-
- verifyColumns([
- "Count (2-month moving average)",
- "Count (vs 2-month moving average)",
- "Count (% vs 2-month moving average)",
- ]);
- });
-
- it("multiple temporal breakouts", () => {
- H.createQuestion(
- { query: QUERY_MULTIPLE_TEMPORAL_BREAKOUTS },
- { visitQuestion: true, wrapId: true, idAlias: "questionId" },
- );
-
- const info = {
- type: "moving-average" as const,
- itemName: "Compare to the past",
- step2Title: "Compare “Count” to the past",
- offsetHelp: "moving average",
- };
-
- verifySummarizeText(info);
- verifyPlusButtonText(info);
- verifyNotebookText(info);
-
- toggleColumnPickerItems(["Value difference"]);
- H.popover().button("Done").click();
-
- cy.get("@questionId").then((questionId) => {
- H.expectUnstructuredSnowplowEvent({
- event: "column_compare_via_shortcut",
- custom_expressions_used: CUSTOM_EXPRESSIONS_USED_MOVING_AVERAGE,
- database_id: SAMPLE_DB_ID,
- question_id: questionId,
- });
- });
-
- verifyAggregations([
- {
- name: "Count (2-month moving average)",
- expression: "(Offset(Count, -1) + Offset(Count, -2)) / 2",
- },
- {
- name: "Count (vs 2-month moving average)",
- expression: "Count - (Offset(Count, -1) + Offset(Count, -2)) / 2",
- },
- {
- name: "Count (% vs 2-month moving average)",
- expression:
- "Count / ((Offset(Count, -1) + Offset(Count, -2)) / 2)",
- },
- ]);
-
- verifyBreakoutExistsAndIsFirst({
- column: "Created At",
- bucket: "Month",
- });
- breakout({ column: "Category" }).should("exist");
-
- verifyColumns([
- "Count (2-month moving average)",
- "Count (vs 2-month moving average)",
- "Count (% vs 2-month moving average)",
- ]);
- });
-
- it("one breakout on non-default datetime column", () => {
- H.createQuestion(
- { query: QUERY_SINGLE_AGGREGATION_OTHER_DATETIME },
- { visitQuestion: true, wrapId: true, idAlias: "questionId" },
- );
-
- const info = {
- type: "moving-average" as const,
- itemName: "Compare to the past",
- step2Title: "Compare “Count” to the past",
- offsetHelp: "moving average",
- };
-
- verifySummarizeText(info);
-
- H.tableHeaderClick("Count");
- verifyNoColumnCompareShortcut();
-
- verifyColumnDrillText(info);
- verifyPlusButtonText(info);
- verifyNotebookText(info);
-
- toggleColumnPickerItems(["Value difference"]);
- H.popover().button("Done").click();
-
- cy.get("@questionId").then((questionId) => {
- H.expectUnstructuredSnowplowEvent({
- event: "column_compare_via_shortcut",
- custom_expressions_used: CUSTOM_EXPRESSIONS_USED_MOVING_AVERAGE,
- database_id: SAMPLE_DB_ID,
- question_id: questionId,
- });
- });
-
- verifyAggregations([
- {
- name: "Count (2-month moving average)",
- expression: "(Offset(Count, -1) + Offset(Count, -2)) / 2",
- },
- {
- name: "Count (vs 2-month moving average)",
- expression: "Count - (Offset(Count, -1) + Offset(Count, -2)) / 2",
- },
- {
- name: "Count (% vs 2-month moving average)",
- expression:
- "Count / ((Offset(Count, -1) + Offset(Count, -2)) / 2)",
- },
- ]);
-
- verifyBreakoutExistsAndIsFirst({
- column: "User → Created At",
- bucket: "Month",
- });
- breakout({ column: "Created At", bucket: "Month" }).should(
- "not.exist",
- );
-
- verifyColumns([
- "Count (2-month moving average)",
- "Count (vs 2-month moving average)",
- "Count (% vs 2-month moving average)",
- ]);
- });
- });
-
- describe("multiple aggregations", () => {
- it("no breakout", () => {
- H.createQuestion(
- { query: QUERY_MULTIPLE_AGGREGATIONS_NO_BREAKOUT },
- { visitQuestion: true, wrapId: true, idAlias: "questionId" },
- );
-
- const info = {
- type: "moving-average" as const,
- itemName: "Compare to the past",
- step1Title: "Compare one of these to the past",
- step2Title: "Compare “Count” to the past",
- offsetHelp: "moving average",
- };
-
- verifySummarizeText(info);
- verifyColumnDrillText(info);
- verifyPlusButtonText(info);
- verifyNotebookText(info);
-
- toggleColumnPickerItems(["Value difference"]);
- H.popover().button("Done").click();
-
- cy.get("@questionId").then((questionId) => {
- H.expectUnstructuredSnowplowEvent({
- event: "column_compare_via_shortcut",
- custom_expressions_used: CUSTOM_EXPRESSIONS_USED_MOVING_AVERAGE,
- database_id: SAMPLE_DB_ID,
- question_id: questionId,
- });
- });
-
- verifyBreakoutExistsAndIsFirst({
- column: "Created At",
- bucket: "Month",
- });
- verifyAggregations([
- {
- name: "Count (2-month moving average)",
- expression: "(Offset(Count, -1) + Offset(Count, -2)) / 2",
- },
- {
- name: "Count (vs 2-month moving average)",
- expression: "Count - (Offset(Count, -1) + Offset(Count, -2)) / 2",
- },
- {
- name: "Count (% vs 2-month moving average)",
- expression:
- "Count / ((Offset(Count, -1) + Offset(Count, -2)) / 2)",
- },
- ]);
-
- verifyColumns([
- "Count (2-month moving average)",
- "Count (vs 2-month moving average)",
- "Count (% vs 2-month moving average)",
- ]);
- });
-
- it("breakout on binned datetime column", () => {
- H.createQuestion(
- { query: QUERY_MULTIPLE_AGGREGATIONS_BINNED_DATETIME_BREAKOUT },
- { visitQuestion: true, wrapId: true, idAlias: "questionId" },
- );
-
- const info = {
- type: "moving-average" as const,
- itemName: "Compare to the past",
- step1Title: "Compare one of these to the past",
- step2Title: "Compare “Count” to the past",
- offsetHelp: "moving average",
- };
-
- verifySummarizeText(info);
-
- H.tableHeaderClick("Created At: Month");
- verifyNoColumnCompareShortcut();
-
- verifyColumnDrillText(_.omit(info, "step1Title"));
- verifyPlusButtonText(info);
- verifyNotebookText(info);
-
- toggleColumnPickerItems(["Value difference"]);
- H.popover().button("Done").click();
-
- cy.get("@questionId").then((questionId) => {
- H.expectUnstructuredSnowplowEvent({
- event: "column_compare_via_shortcut",
- custom_expressions_used: CUSTOM_EXPRESSIONS_USED_MOVING_AVERAGE,
- database_id: SAMPLE_DB_ID,
- question_id: questionId,
- });
- });
-
- verifyAggregations([
- {
- name: "Count (2-month moving average)",
- expression: "(Offset(Count, -1) + Offset(Count, -2)) / 2",
- },
- {
- name: "Count (vs 2-month moving average)",
- expression: "Count - (Offset(Count, -1) + Offset(Count, -2)) / 2",
- },
- {
- name: "Count (% vs 2-month moving average)",
- expression:
- "Count / ((Offset(Count, -1) + Offset(Count, -2)) / 2)",
- },
- ]);
-
- verifyColumns([
- "Count (2-month moving average)",
- "Count (vs 2-month moving average)",
- "Count (% vs 2-month moving average)",
- ]);
- });
-
- it("breakout on non-binned datetime column", () => {
- H.createQuestion(
- { query: QUERY_MULTIPLE_AGGREGATIONS_NON_BINNED_DATETIME_BREAKOUT },
- { visitQuestion: true, wrapId: true, idAlias: "questionId" },
- );
-
- const info = {
- type: "moving-average" as const,
- itemName: "Compare to the past",
- step1Title: "Compare one of these to the past",
- step2Title: "Compare “Count” to the past",
- offsetHelp: "moving average",
- };
-
- verifySummarizeText(info);
-
- H.tableHeaderClick("Created At: Day");
- verifyNoColumnCompareShortcut();
-
- verifyColumnDrillText(_.omit(info, "step1Title"));
- verifyPlusButtonText(info);
- verifyNotebookText(info);
-
- toggleColumnPickerItems(["Value difference"]);
- H.popover().button("Done").click();
-
- cy.get("@questionId").then((questionId) => {
- H.expectUnstructuredSnowplowEvent({
- event: "column_compare_via_shortcut",
- custom_expressions_used: CUSTOM_EXPRESSIONS_USED_MOVING_AVERAGE,
- database_id: SAMPLE_DB_ID,
- question_id: questionId,
- });
- });
-
- verifyAggregations([
- {
- name: "Count (2-period moving average)",
- expression: "(Offset(Count, -1) + Offset(Count, -2)) / 2",
- },
- {
- name: "Count (vs 2-period moving average)",
- expression: "Count - (Offset(Count, -1) + Offset(Count, -2)) / 2",
- },
- {
- name: "Count (% vs 2-period moving average)",
- expression:
- "Count / ((Offset(Count, -1) + Offset(Count, -2)) / 2)",
- },
- ]);
-
- verifyColumns([
- "Count (2-period moving average)",
- "Count (vs 2-period moving average)",
- "Count (% vs 2-period moving average)",
- ]);
- });
-
- it("breakout on non-datetime column", () => {
- H.createQuestion(
- { query: QUERY_MULTIPLE_AGGREGATIONS_NON_DATETIME_BREAKOUT },
- { visitQuestion: true, wrapId: true, idAlias: "questionId" },
- );
-
- const info = {
- type: "moving-average" as const,
- itemName: "Compare to the past",
- step2Title: "Compare “Count” to the past",
- step1Title: "Compare one of these to the past",
- presets: ["Previous month", "Previous year"],
- offsetHelp: "moving average",
- };
-
- verifySummarizeText(info);
-
- H.tableHeaderClick("Category");
- verifyNoColumnCompareShortcut();
-
- verifyColumnDrillText(_.omit(info, "step1Title"));
- verifyPlusButtonText(info);
- verifyNotebookText(info);
-
- toggleColumnPickerItems(["Value difference"]);
- H.popover().button("Done").click();
-
- cy.get("@questionId").then((questionId) => {
- H.expectUnstructuredSnowplowEvent({
- event: "column_compare_via_shortcut",
- custom_expressions_used: CUSTOM_EXPRESSIONS_USED_MOVING_AVERAGE,
- database_id: SAMPLE_DB_ID,
- question_id: questionId,
- });
- });
-
- verifyAggregations([
- {
- name: "Count (2-month moving average)",
- expression: "(Offset(Count, -1) + Offset(Count, -2)) / 2",
- },
- {
- name: "Count (vs 2-month moving average)",
- expression: "Count - (Offset(Count, -1) + Offset(Count, -2)) / 2",
- },
- {
- name: "Count (% vs 2-month moving average)",
- expression:
- "Count / ((Offset(Count, -1) + Offset(Count, -2)) / 2)",
- },
- ]);
-
- verifyColumns([
- "Count (2-month moving average)",
- "Count (vs 2-month moving average)",
- "Count (% vs 2-month moving average)",
- ]);
- });
- });
- });
- });
-});
-
-function toggleColumnPickerItems(names: string[]) {
- cy.findByTestId("column-picker").parent().click();
-
- for (const name of names) {
- cy.findAllByTestId("column-picker-item").contains(name).click();
- }
-
- cy.findByTestId("column-picker").parent().click();
-}
-
-function verifyNoColumnCompareShortcut() {
- H.popover()
- .findByText(/compare/)
- .should("not.exist");
-}
-
-type CheckTextOpts = {
- itemName: string;
- type?: "moving-average" | "offset";
- step1Title?: string;
- step2Title: string;
- offsetHelp: string;
- presets?: string[];
- includePeriodText?: string;
-};
-
-function verifyPresets(presets: string[] = []) {
- for (const preset of presets) {
- cy.findByText(preset).should("be.visible");
- }
-}
-
-function selectCustomOffset() {
- // This is broken up because the dashboard sometimes rerenders while clicking
- // Cypress recommends this as a workaround for flakyness.
- cy.findByText("Custom...").as("btn").should("be.visible");
- cy.get("@btn").click();
-}
-
-function verifySummarizeText(options: CheckTextOpts) {
- cy.button(/Summarize/).click();
- H.rightSidebar().button("Add aggregation").click();
-
- H.popover().within(() => {
- cy.findByText(options.itemName).should("be.visible").click();
-
- if (options.step1Title) {
- cy.findByText(options.step1Title).should("be.visible");
- cy.findByText("Sum of Price").should("be.visible");
- cy.findByText("Count").click();
- }
-
- if (options.type === "moving-average") {
- cy.findByText("Moving average").click();
- if (options.includePeriodText) {
- cy.findByText(options.includePeriodText).should("be.visible");
- }
- } else {
- verifyPresets(options.presets);
- selectCustomOffset();
- }
-
- cy.findByText(options.step2Title).should("be.visible");
- cy.findByText(options.offsetHelp).should("be.visible");
- });
-}
-
-function verifyColumnDrillText(options: Omit<CheckTextOpts, "step1Title">) {
- H.tableHeaderClick("Count");
-
- H.popover().within(() => {
- cy.findByText(options.itemName).should("be.visible").click();
- cy.findByText(options.step2Title).should("be.visible");
-
- if (options.type === "moving-average") {
- cy.findByText("Moving average").click();
- if (options.includePeriodText) {
- cy.findByText(options.includePeriodText).should("be.visible");
- }
- } else {
- verifyPresets(options.presets);
- selectCustomOffset();
- }
-
- cy.findByText(options.offsetHelp).should("be.visible");
- });
-}
-
-function verifyPlusButtonText(options: CheckTextOpts) {
- cy.button("Add column").click();
-
- H.popover().within(() => {
- cy.findByText(options.itemName).should("be.visible").click();
-
- if (options.step1Title) {
- cy.findByText(options.step1Title).should("be.visible");
- cy.findByText("Sum of Price").should("be.visible");
- cy.findByText("Count").click();
- }
-
- if (options.type === "moving-average") {
- cy.findByText("Moving average").click();
- if (options.includePeriodText) {
- cy.findByText(options.includePeriodText).should("be.visible");
- }
- } else {
- verifyPresets(options.presets);
- selectCustomOffset();
- }
-
- cy.findByText(options.step2Title).should("be.visible");
- cy.findByText(options.offsetHelp).should("be.visible");
- });
-}
-
-function verifyNotebookText(options: CheckTextOpts) {
- H.openNotebook();
- // eslint-disable-next-line metabase/no-unsafe-element-filtering
- H.getNotebookStep("summarize")
- .findAllByTestId("aggregate-step")
- .last()
- .icon("add")
- .click();
-
- H.popover().within(() => {
- cy.findByText("Basic functions").click();
- cy.findByText(options.itemName).should("be.visible").click();
-
- if (options.step1Title) {
- cy.findByText(options.step1Title).should("be.visible");
- cy.findByText("Sum of Price").should("be.visible");
- cy.findByText("Count").should("be.visible").click();
- }
-
- if (options.type === "moving-average") {
- cy.findByText("Moving average").click();
- if (options.includePeriodText) {
- cy.findByText(options.includePeriodText).should("be.visible");
- }
- } else {
- verifyPresets(options.presets);
- selectCustomOffset();
- }
-
- cy.findByText(options.step2Title).should("exist");
- cy.findByText(options.offsetHelp).should("exist");
- });
-}
-
-type AggregationResult = {
- name: string;
- expression: string;
-};
-
-function verifyAggregations(results: AggregationResult[]) {
- for (const result of results) {
- cy.findByTestId("aggregate-step")
- .findByText(result.name)
- .should("be.visible")
- .click();
-
- cy.get(".ace_content").should("have.text", result.expression);
-
- cy.realPress("Escape");
- }
-}
-
-function verifyColumns(names: string[]) {
- H.visualize();
-
- for (const name of names) {
- cy.findAllByTestId("header-cell").contains(name).should("be.visible");
- }
-}
-
-function breakout({ column, bucket }: { column: string; bucket?: string }) {
- const name = bucket ? `${column}: ${bucket}` : column;
- return cy.findByTestId("breakout-step").findByText(name);
-}
-
-function verifyBreakoutExistsAndIsFirst(options: {
- column: string;
- bucket?: string;
-}) {
- breakout(options)
- .should("exist")
- .parent()
- .parent()
- .should("match", ":first-child");
-}
diff --git a/e2e/test/scenarios/question/notebook-native-preview-sidebar.cy.spec.ts b/e2e/test/scenarios/question/notebook-native-preview-sidebar.cy.spec.ts
index 246d5845760..d8582691940 100644
--- a/e2e/test/scenarios/question/notebook-native-preview-sidebar.cy.spec.ts
+++ b/e2e/test/scenarios/question/notebook-native-preview-sidebar.cy.spec.ts
@@ -246,7 +246,6 @@ describe(
{ tags: "@mongo" },
() => {
const MONGO_DB_NAME = "QA Mongo";
- const MONGO_DB_ID = 2;
beforeEach(() => {
H.restore("mongo-5");
@@ -315,64 +314,6 @@ describe(
cy.findByTestId("selected-table").should("have.text", "Products");
cy.get("[data-testid=cell-data]").should("contain", "Small Marble Shoes");
});
-
- it(
- "should work for a nested GUI question (metabase#40557)",
- { tags: "@skip" },
- () => {
- H.withDatabase(
- MONGO_DB_ID,
- ({ PRODUCTS_ID }: { PRODUCTS_ID: number }) => {
- H.createQuestion({
- name: "Mongo Source",
- query: {
- "source-table": PRODUCTS_ID,
- limit: 1,
- },
- database: MONGO_DB_ID,
- }).then(({ body: { id: sourceId } }) => {
- H.createQuestion(
- {
- name: "Mongo Nested",
- query: {
- "source-table": `card__${sourceId}`,
- },
- database: MONGO_DB_ID,
- },
- { visitQuestion: true },
- );
- });
- },
- );
-
- cy.get("[data-testid=cell-data]").should(
- "contain",
- "Small Marble Shoes",
- );
- H.openNotebook();
- openSidebar("native");
-
- cy.findByTestId("native-query-preview-sidebar").within(() => {
- cy.findByText("Native query for this question").should("exist");
- H.NativeEditor.get()
- .should("be.visible")
- .and("contain", "$project")
- .and("contain", "$limit")
- .and("not.contain", "BsonString")
- .and("not.contain", "BsonInt32");
-
- cy.button("Convert this question to a native query").click();
- });
-
- cy.log("Database and table should be pre-selected (metabase#40557)");
- cy.findByTestId("selected-database").should("have.text", MONGO_DB_NAME);
- cy.findByTestId("selected-table").should("have.text", "Products");
- cy.get("[data-testid=cell-data]").should(
- "contain",
- "Small Marble Shoes",
- );
- },
- );
},
);
diff --git a/e2e/test/scenarios/question/notebook.cy.spec.js b/e2e/test/scenarios/question/notebook.cy.spec.js
index b5a7429dc44..512c76d3c96 100644
--- a/e2e/test/scenarios/question/notebook.cy.spec.js
+++ b/e2e/test/scenarios/question/notebook.cy.spec.js
@@ -700,80 +700,6 @@ describe("scenarios > question > notebook", { tags: "@slow" }, () => {
});
});
- it(
- "should be possible to sort by metric (metabase#8283,metabase#42392)",
- { tags: "@skip" },
- () => {
- H.createQuestion(
- {
- name: "Revenue",
- description: "Sum of orders subtotal",
- type: "metric",
- query: {
- "source-table": ORDERS_ID,
- aggregation: [["sum", ["field", ORDERS.SUBTOTAL, null]]],
- },
- },
- {
- wrapId: true,
- idAlias: "metricId",
- },
- );
-
- cy.get("@metricId").then((metricId) => {
- const questionDetails = {
- query: {
- "source-table": `card__${metricId}`,
- aggregation: ["metric", metricId],
- },
- };
-
- H.createQuestion(questionDetails, { visitQuestion: true });
-
- H.openNotebook();
-
- cy.findByText("Pick a column to group by").click();
- cy.findByText("Created At").click();
- cy.findByText("Sort").click();
-
- // Sorts ascending by default
- // Revenue appears twice, but it's the only integer column to order by
- H.popover().icon("int").click();
-
- // Let's make sure it's possible to sort descending as well
- cy.icon("arrow_up").click();
-
- cy.icon("arrow_down").parent().contains("Revenue");
-
- H.visualize();
- // Visualization will render line chart by default. Switch to the table.
- cy.icon("table2").click();
-
- cy.findAllByRole("grid").as("table");
- cy.get("@table")
- .first()
- .as("tableHeader")
- .within(() => {
- cy.get("[data-testid=cell-data]")
- .eq(1)
- .invoke("text")
- .should("eq", "Revenue");
- });
-
- // eslint-disable-next-line metabase/no-unsafe-element-filtering
- cy.get("@table")
- .last()
- .as("tableBody")
- .within(() => {
- cy.get("[data-testid=cell-data]")
- .eq(1)
- .invoke("text")
- .should("eq", "50,072.98");
- });
- });
- },
- );
-
it("should open only one bucketing popover at a time (metabase#45036)", () => {
H.visitQuestionAdhoc(
{
diff --git a/e2e/test/scenarios/question/offset.cy.spec.ts b/e2e/test/scenarios/question/offset.cy.spec.ts
index 8526056cd00..5bce67f87d2 100644
--- a/e2e/test/scenarios/question/offset.cy.spec.ts
+++ b/e2e/test/scenarios/question/offset.cy.spec.ts
@@ -48,8 +48,6 @@ describe("scenarios > question > offset", () => {
});
describe("custom columns", () => {
- // This test contradicts the next 2 skipped ones.
- // Remove it once we enable offset() in custom columns.
it("does not suggest or allow using offset()", () => {
const expression = "Offset([Total], -1)";
const prefixLength = 3;
@@ -79,127 +77,6 @@ describe("scenarios > question > offset", () => {
);
});
});
-
- // Skipped because we want to disable offset() in custom columns for now
- it("suggests and allows using offset()", { tags: "@skip" }, () => {
- const expression = "Offset([Total], -1)";
- const prefixLength = 3;
- const prefix = expression.substring(0, prefixLength);
- const query: StructuredQuery = {
- "source-table": ORDERS_ID,
- fields: [ORDERS_ID_FIELD_REF, ORDERS_TOTAL_FIELD_REF],
- limit: 5,
- };
-
- H.createQuestion({ query }, { visitQuestion: true });
- H.openNotebook();
- cy.button("Custom column").click();
- H.enterCustomColumnDetails({ formula: prefix });
-
- cy.log("suggests offset() in custom column expressions");
- cy.findByTestId("expression-suggestions-list-item")
- .should("exist")
- .and("have.text", "Offset");
-
- H.enterCustomColumnDetails({ formula: expression });
- cy.realPress("Tab");
-
- H.popover().within(() => {
- cy.findByText("OFFSET in a custom expression requires a sort order");
- cy.button("Done").should("be.disabled");
- cy.button("Cancel").click();
- });
-
- cy.button("Sort").click();
- H.popover().findByText("ID").click();
- H.getNotebookStep("expression").icon("add").click();
- H.enterCustomColumnDetails({ formula: expression });
- cy.realPress("Tab");
-
- H.popover().within(() => {
- cy.button("Done").should("be.disabled");
-
- cy.findByPlaceholderText("Something nice and descriptive")
- .type("My expression")
- .blur();
-
- cy.button("Done").should("be.enabled").click();
- });
-
- cy.log("preview availability");
- H.getNotebookStep("data").icon("play").should("be.visible");
- H.getNotebookStep("expression").icon("play").should("not.be.visible");
- H.getNotebookStep("sort").icon("play").should("be.visible");
- H.getNotebookStep("limit").icon("play").should("be.visible");
-
- H.visualize();
- verifyTableContent([
- ["1", "39.72", ""],
- ["2", "117.03", "39.72"],
- ["3", "49.21", "117.03"],
- ]);
- });
-
- // Skipped because we want to disable offset() in custom columns for now
- it(
- "does not allow to use offset-based column in other clauses (metabase#42764)",
- { tags: "@skip" },
- () => {
- const offsettedColumnName = "xyz";
- const expression = `Offset([${offsettedColumnName}], -1)`;
- const prefixLength = "Offset([x".length;
- const prefix = expression.substring(0, prefixLength);
- const query: StructuredQuery = {
- "source-table": ORDERS_ID,
- expressions: {
- [offsettedColumnName]: [
- "offset",
- createOffsetOptions(offsettedColumnName),
- ORDERS_TOTAL_FIELD_REF,
- -1,
- ],
- },
- "order-by": [["asc", ORDERS_ID_FIELD_REF]],
- limit: 5,
- };
-
- H.createQuestion({ query }, { visitQuestion: true });
-
- cy.log("custom column drills");
- const rowIndex = 1;
- const columnIndex = 9;
- const columnsCount = 10;
- const cellIndex = rowIndex * columnsCount + columnIndex;
- // eslint-disable-next-line metabase/no-unsafe-element-filtering
- cy.findAllByRole("gridcell").eq(cellIndex).click();
- cy.get(H.POPOVER_ELEMENT).should("not.exist");
-
- H.openNotebook();
-
- cy.log("custom column expressions");
- H.getNotebookStep("expression").icon("add").click();
- verifyInvalidColumnName(offsettedColumnName, prefix, expression);
- H.popover().button("Cancel").click();
-
- cy.log("custom filter expressions");
- cy.icon("filter").click();
- H.popover().findByText("Custom Expression").click();
- verifyInvalidColumnName(offsettedColumnName, prefix, expression);
- H.popover().button("Cancel").click();
- cy.realPress("Escape");
-
- cy.log("custom aggregation expressions");
- cy.icon("sum").click();
- H.popover().findByText("Custom Expression").click();
- verifyInvalidColumnName(offsettedColumnName, prefix, expression);
- H.popover().button("Cancel").click();
- cy.realPress("Escape");
-
- cy.log("sort clause");
- H.getNotebookStep("sort").icon("add").click();
- H.popover().should("not.contain", offsettedColumnName);
- },
- );
});
describe("filters", () => {
@@ -530,22 +407,6 @@ function verifyNoQuestionError() {
});
}
-function verifyInvalidColumnName(
- columnName: string,
- prefix: string,
- expression: string,
-) {
- H.enterCustomColumnDetails({ formula: prefix });
- cy.findByTestId("expression-suggestions-list-item").should("not.exist");
-
- H.enterCustomColumnDetails({ formula: expression });
- cy.realPress("Tab");
- H.popover().within(() => {
- cy.findByText(`Unknown Field: ${columnName}`).should("be.visible");
- cy.button("Done").should("be.disabled");
- });
-}
-
function createOffsetOptions(name = "offset") {
return {
"lib/uuid": uuid(),
diff --git a/e2e/test/scenarios/question/saved.cy.spec.js b/e2e/test/scenarios/question/saved.cy.spec.js
index 8772a8eab19..f9fcf3a574f 100644
--- a/e2e/test/scenarios/question/saved.cy.spec.js
+++ b/e2e/test/scenarios/question/saved.cy.spec.js
@@ -652,35 +652,5 @@ describe(
H.modal().findByText(secondWebhookName).should("be.visible");
});
-
- // There is no api to test individual hooks for new Question Alerts
- it("should allow you to test a webhook", { tags: "@skip" }, () => {
- cy.intercept("POST", "/api/pulse/test").as("testAlert");
- H.visitQuestion(ORDERS_COUNT_QUESTION_ID);
- cy.findByLabelText("Move, trash, and more…").click();
- H.popover().findByText("Create an alert").click();
-
- H.modal().within(() => {
- H.getAlertChannel(firstWebhookName).scrollIntoView();
-
- H.getAlertChannel(firstWebhookName)
- .findByRole("checkbox")
- .click({ force: true });
-
- H.getAlertChannel(firstWebhookName).button("Send a test").click();
- });
-
- cy.wait("@testAlert");
-
- cy.request(
- `${H.WEBHOOK_TEST_HOST}/api/session/${H.WEBHOOK_TEST_SESSION_ID}/requests`,
- ).then(({ body }) => {
- expect(body).to.have.length(1);
-
- cy.wrap(atob(body[0].content_base64))
- .should("have.string", "alert_creator_name")
- .and("have.string", "Bobby Tables");
- });
- });
},
);
diff --git a/e2e/test/scenarios/question/settings.cy.spec.js b/e2e/test/scenarios/question/settings.cy.spec.js
index 03c95c5403b..14c70307bb3 100644
--- a/e2e/test/scenarios/question/settings.cy.spec.js
+++ b/e2e/test/scenarios/question/settings.cy.spec.js
@@ -429,128 +429,6 @@ describe("scenarios > question > settings", () => {
cy.findByLabelText("close icon").should("not.exist");
});
});
-
- it(
- "should allow hiding and showing aggregated columns with a post-aggregation custom column (metabase#22563)",
- { tags: "@skip" },
- () => {
- // products joined to orders with breakouts on 3 product columns followed by a custom column
- H.createQuestion(
- {
- name: "repro 22563",
- query: {
- "source-query": {
- "source-table": ORDERS_ID,
- joins: [
- {
- alias: "Products",
- condition: [
- "=",
- ["field", ORDERS.PRODUCT_ID, null],
- [
- "field",
- PRODUCTS.ID,
- {
- "join-alias": "Products",
- },
- ],
- ],
- "source-table": PRODUCTS_ID,
- },
- ],
- aggregation: [["count"]],
- breakout: [
- [
- "field",
- PRODUCTS.CATEGORY,
- {
- "base-type": "type/Text",
- "join-alias": "Products",
- },
- ],
- [
- "field",
- PRODUCTS.TITLE,
- {
- "base-type": "type/Text",
- "join-alias": "Products",
- },
- ],
- [
- "field",
- PRODUCTS.VENDOR,
- {
- "base-type": "type/Text",
- "join-alias": "Products",
- },
- ],
- ],
- },
- expressions: {
- two: ["+", 1, 1],
- },
- },
- },
- { visitQuestion: true },
- );
-
- const columnNames = [
- "Products → Category",
- "Products → Title",
- "Products → Vendor",
- "Count",
- "two",
- ];
-
- H.tableInteractive().within(() => {
- columnNames.forEach((text) =>
- cy.findByText(text).should("be.visible"),
- );
- });
-
- H.openVizSettingsSidebar();
-
- cy.findByTestId("chartsettings-sidebar").within(() => {
- columnNames.forEach((text) =>
- cy.findByText(text).should("be.visible"),
- );
- cy.findByText("More Columns").should("not.exist");
-
- cy.icon("eye_outline").first().click();
-
- cy.findByText("More columns").should("be.visible");
-
- // disable the first column
- cy.findByTestId("disabled-columns")
- .findByText("Products → Category")
- .should("be.visible");
- cy.findByTestId("visible-columns")
- .findByText("Products → Category")
- .should("not.exist");
- });
-
- H.tableInteractive().within(() => {
- // the query should not have changed
- cy.icon("play").should("not.exist");
- cy.findByText("Products → Category").should("not.exist");
- });
-
- cy.findByTestId("chartsettings-sidebar").within(() => {
- cy.icon("add").click();
- // re-enable the first column
- cy.findByText("More columns").should("not.exist");
- cy.findByTestId("visible-columns")
- .findByText("Products → Category")
- .should("be.visible");
- });
-
- H.tableInteractive().within(() => {
- // the query should not have changed
- cy.icon("play").should("not.exist");
- cy.findByText("Products → Category").should("be.visible");
- });
- },
- );
});
describe("resetting state", () => {
diff --git a/e2e/test/scenarios/question/summarization.cy.spec.js b/e2e/test/scenarios/question/summarization.cy.spec.js
index 6872bfa47f3..755c78be5c7 100644
--- a/e2e/test/scenarios/question/summarization.cy.spec.js
+++ b/e2e/test/scenarios/question/summarization.cy.spec.js
@@ -253,25 +253,6 @@ describe("scenarios > question > summarize sidebar", () => {
cy.findAllByTestId("header-cell").should("have.length", 2);
cy.get("[data-testid=cell-data]").should("contain", 744); // `Count` for year 2025
});
-
- // flaky test (#19454)
- it(
- "should show an info popover when hovering over summarize dimension options",
- { tags: "@skip" },
- () => {
- H.openReviewsTable();
-
- H.summarize();
- // eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
- cy.findByText("Group by")
- .parent()
- .findByText("Title")
- .trigger("mouseenter");
-
- H.popover().contains("Title");
- H.popover().contains("199 distinct values");
- },
- );
});
function removeMetricFromSidebar(metricName) {
diff --git a/e2e/test/scenarios/search/search.cy.spec.js b/e2e/test/scenarios/search/search.cy.spec.js
index 8a5e9eb9e92..5a80626d440 100644
--- a/e2e/test/scenarios/search/search.cy.spec.js
+++ b/e2e/test/scenarios/search/search.cy.spec.js
@@ -5,7 +5,7 @@ import {
ORDERS_QUESTION_ID,
} from "e2e/support/cypress_sample_instance_data";
-const { ORDERS_ID, PEOPLE_ID, REVIEWS_ID } = SAMPLE_DATABASE;
+const { ORDERS_ID, PEOPLE_ID } = SAMPLE_DATABASE;
const visitEmbeddingWithSearch = (url = "/") => {
H.visitFullAppEmbeddingUrl({
@@ -249,27 +249,6 @@ describe("scenarios > search", () => {
});
});
-describe("issue 16785", { tags: "@skip" }, () => {
- beforeEach(() => {
- H.restore();
- cy.signInAsAdmin();
-
- cy.request("PUT", "/api/table", {
- ids: [REVIEWS_ID],
- visibility_type: "hidden",
- });
- });
-
- it("should not display hidden tables (metabase#16785)", () => {
- cy.visit("/");
- cy.findByPlaceholderText("Search…").type("Reviews");
-
- cy.findByTestId("search-results-list").within(() => {
- cy.findByText("Reviews").should("not.exist");
- });
- });
-});
-
describe("issue 28788", () => {
const LONG_STRING = "01234567890ABCDEFGHIJKLMNOPQRSTUVXYZ0123456789";
diff --git a/e2e/test/scenarios/sharing/subscriptions.cy.spec.js b/e2e/test/scenarios/sharing/subscriptions.cy.spec.js
index 20c1344ce53..675010e2470 100644
--- a/e2e/test/scenarios/sharing/subscriptions.cy.spec.js
+++ b/e2e/test/scenarios/sharing/subscriptions.cy.spec.js
@@ -167,20 +167,6 @@ describe("scenarios > dashboard > subscriptions", () => {
H.popover().isRenderedWithinViewport();
});
-
- it(
- "should not send attachments by default if not explicitly selected (metabase#28673)",
- { tags: "@skip" },
- () => {
- openDashboardSubscriptions();
- assignRecipient();
-
- cy.findByLabelText("Attach results").should("not.be.checked");
- H.sendEmailAndAssert(
- ({ attachments }) => expect(attachments).to.be.empty,
- );
- },
- );
});
describe("with existing subscriptions", () => {
diff --git a/e2e/test/scenarios/visualizations-charts/bar_chart.cy.spec.js b/e2e/test/scenarios/visualizations-charts/bar_chart.cy.spec.js
index 840c472c8d0..699a3f2efde 100644
--- a/e2e/test/scenarios/visualizations-charts/bar_chart.cy.spec.js
+++ b/e2e/test/scenarios/visualizations-charts/bar_chart.cy.spec.js
@@ -824,217 +824,6 @@ describe("scenarios > visualizations > bar chart", () => {
H.echartsTriggerBlur();
});
- it(
- "should allow grouping series into a single 'Other' series",
- { tags: "@skip" },
- () => {
- const AK_SERIES_COLOR = "#509EE3";
-
- const USER_STATE_FIELD_REF = [
- "field",
- PEOPLE.STATE,
- { "source-field": ORDERS.USER_ID },
- ];
- const ORDER_CREATED_AT_FIELD_REF = [
- "field",
- ORDERS.CREATED_AT,
- { "temporal-unit": "month" },
- ];
-
- function setMaxCategories(value, { viaBreakoutSettings = false } = {}) {
- if (viaBreakoutSettings) {
- H.leftSidebar().findByTestId("settings-STATE").click();
- } else {
- H.leftSidebar().findByLabelText("Other series settings").click();
- }
- H.popover()
- .findByTestId("graph-max-categories-input")
- .type(`{selectAll}${value}`)
- .blur();
- cy.wait(500); // wait for viz to re-render
- }
-
- function setOtherCategoryAggregationFn(fnName) {
- H.leftSidebar().findByLabelText("Other series settings").click();
- H.popover()
- .findByTestId("graph-other-category-aggregation-fn-picker")
- .click();
- // eslint-disable-next-line metabase/no-unsafe-element-filtering
- H.popover().last().findByText(fnName).click();
- }
-
- H.visitQuestionAdhoc({
- display: "bar",
- dataset_query: {
- type: "query",
- database: SAMPLE_DB_ID,
- query: {
- "source-table": ORDERS_ID,
- aggregation: [["count"]],
- breakout: [USER_STATE_FIELD_REF, ORDER_CREATED_AT_FIELD_REF],
- filter: [
- "and",
- [
- "between",
- ORDER_CREATED_AT_FIELD_REF,
- "2025-09-01T00:00Z",
- "2026-02-01T00:00Z",
- ],
- [
- "=",
- USER_STATE_FIELD_REF,
- "AK",
- "AL",
- "AR",
- "AZ",
- "CA",
- "CO",
- "CT",
- "DE",
- "FL",
- "GA",
- "IA",
- "ID",
- "IL",
- "KY",
- ],
- ],
- },
- },
- });
-
- // Enable 'Other' series
- H.openVizSettingsSidebar();
- H.leftSidebar().findByTestId("settings-STATE").click();
- H.popover().findByLabelText("Enforce maximum number of series").click();
-
- // Test 'Other' series renders
- H.otherSeriesChartPaths().should("have.length", 6);
-
- // Test drill-through is disabled for 'Other' series
- H.otherSeriesChartPaths().first().click();
- cy.findByTestId("click-actions-view").should("not.exist");
-
- // Test drill-through is enabled for regular series
- H.chartPathWithFillColor(AK_SERIES_COLOR).first().click();
- cy.findByTestId("click-actions-view").should("exist");
-
- // Test legend and series visibility toggling
- H.queryBuilderMain()
- .findAllByTestId("legend-item")
- .should("have.length", 9)
- .last()
- .as("other-series-legend-item");
- cy.get("@other-series-legend-item")
- .findByLabelText("Hide series")
- .click();
- H.otherSeriesChartPaths().should("have.length", 0);
- cy.get("@other-series-legend-item")
- .findByLabelText("Show series")
- .click();
- H.otherSeriesChartPaths().should("have.length", 6);
-
- // Test tooltips
- H.chartPathWithFillColor(AK_SERIES_COLOR).first().realHover();
- H.assertEChartsTooltip({ rows: [{ name: "Other", value: "9" }] });
- H.otherSeriesChartPaths().first().realHover();
- H.assertEChartsTooltip({
- header: "September 2025",
- rows: [
- { name: "IA", value: "3" },
- { name: "KY", value: "2" },
- { name: "FL", value: "1" },
- { name: "GA", value: "1" },
- { name: "ID", value: "1" },
- { name: "IL", value: "1" },
- { name: "Total", value: "9" },
- ],
- });
-
- // Test "graph.max_categories" change
- setMaxCategories(4);
- H.queryBuilderMain().click(); // close popover
- H.chartPathWithFillColor(AK_SERIES_COLOR).first().realHover();
- H.echartsTooltip().find("tr").should("have.length", 5);
- H.queryBuilderMain()
- .findAllByTestId("legend-item")
- .should("have.length", 5);
-
- // Test can move series in/out of "Other" series
- H.getDraggableElements().eq(3).as("AZ");
- H.moveDnDKitElementByAlias("@AZ", { vertical: 150 }); // Move AZ into "Other"
- H.getDraggableElements().eq(6).as("CT");
- H.moveDnDKitElementByAlias("@CT", { vertical: -150 }); // Move CT out of "Other"
-
- H.queryBuilderMain()
- .findAllByTestId("legend-item")
- .should("have.length", 5);
- H.queryBuilderMain()
- .findAllByTestId("legend-item")
- .contains("AZ")
- .should("not.exist");
- H.queryBuilderMain()
- .findAllByTestId("legend-item")
- .contains("CT")
- .should("exist");
-
- // Test "graph.max_categories" removes "Other" altogether
- setMaxCategories(0);
- H.chartPathWithFillColor(AK_SERIES_COLOR).first().realHover();
- H.echartsTooltip().find("tr").should("have.length", 14);
- H.queryBuilderMain()
- .findAllByTestId("legend-item")
- .should("have.length", 14);
- H.otherSeriesChartPaths().should("not.exist");
- setMaxCategories(8, { viaBreakoutSettings: true });
-
- // Test "graph.other_category_aggregation_fn" for native queries
- H.openNotebook();
- H.queryBuilderHeader().findByLabelText("View SQL").click();
- cy.findByTestId("native-query-preview-sidebar")
- .button("Convert this question to SQL")
- .click();
- cy.wait("@dataset");
- H.queryBuilderMain().findByTestId("visibility-toggler").click();
-
- H.openVizSettingsSidebar();
- setOtherCategoryAggregationFn("Average");
-
- H.chartPathWithFillColor(AK_SERIES_COLOR).first().realHover();
- H.assertEChartsTooltip({ rows: [{ name: "Other", value: "1.5" }] });
-
- H.otherSeriesChartPaths().first().realHover();
- H.assertEChartsTooltip({
- header: "September 2025",
- rows: [
- { name: "IA", value: "3" },
- { name: "KY", value: "2" },
- { name: "FL", value: "1" },
- { name: "GA", value: "1" },
- { name: "ID", value: "1" },
- { name: "IL", value: "1" },
- { name: "Average", value: "1.5" },
- ],
- });
-
- setOtherCategoryAggregationFn("Min");
-
- H.chartPathWithFillColor(AK_SERIES_COLOR).first().realHover();
- H.assertEChartsTooltip({ rows: [{ name: "Other", value: "1" }] });
-
- H.otherSeriesChartPaths().first().realHover();
- H.assertEChartsTooltip({ rows: [{ name: "Min", value: "1" }] });
-
- setOtherCategoryAggregationFn("Max");
-
- H.chartPathWithFillColor(AK_SERIES_COLOR).first().realHover();
- H.assertEChartsTooltip({ rows: [{ name: "Other", value: "3" }] });
-
- H.otherSeriesChartPaths().first().realHover();
- H.assertEChartsTooltip({ rows: [{ name: "Max", value: "3" }] });
- },
- );
-
it("should format goal tooltip value as a percent when the Stacking option is 'Stack - 100%'", () => {
H.visitQuestionAdhoc({
...breakoutBarChart,
diff --git a/e2e/test/scenarios/visualizations-charts/line-bar-tooltips.cy.spec.js b/e2e/test/scenarios/visualizations-charts/line-bar-tooltips.cy.spec.js
index 5bc487c20bf..18b06c8ef70 100644
--- a/e2e/test/scenarios/visualizations-charts/line-bar-tooltips.cy.spec.js
+++ b/e2e/test/scenarios/visualizations-charts/line-bar-tooltips.cy.spec.js
@@ -611,103 +611,6 @@ describe("scenarios > visualizations > line/bar chart > tooltips", () => {
});
});
- // TODO: Fix series have different colors in visualizer because of different
- // column names in original dashcard and visualizer ("avg" becomes "COLUMN_2" and the color has is different)
- it(
- "should show updated column titles in tooltips after editing them via Visualization Options",
- { tags: "@skip" },
- () => {
- // Checking the second datum since the first circle of one series is covered with a circle from the other series
- const circleIndex = 1;
-
- const originalSeriesColors = ["#A989C5", "#88BF4D"];
- const addedSeriesColors = ["#509EE3", "#98D9D9"];
- const originalAvgSeriesName = "Q1: Average of Total";
- const originalCumSumSeriesName = "Q1: Cumulative sum of Quantity";
- const updatedOriginalAvgSeriesName = "Q1 Custom 1";
- const updatedOriginalCumSumSeriesName = "Q1 Custom 2";
- const addedAvgSeriesName = "Q2: Average of Discount";
- const addedSumSeriesName = "Q2: Sum of Discount";
- const updatedAddedAvgSeriesName = "Q2 Custom 1";
- const updatedAddedSumSeriesName = "Q2 Custom 2";
-
- [...originalSeriesColors, ...addedSeriesColors].forEach((color) => {
- showTooltipForCircleInSeries(color, circleIndex);
- H.assertEChartsTooltip({
- header: "2026",
- rows: [
- {
- color: originalSeriesColors[0],
- name: originalAvgSeriesName,
- value: "56.86",
- },
- {
- color: originalSeriesColors[1],
- name: originalCumSumSeriesName,
- value: "17,587",
- },
- {
- color: addedSeriesColors[0],
- name: addedAvgSeriesName,
- value: "5.41",
- },
- {
- color: addedSeriesColors[1],
- name: addedSumSeriesName,
- value: "1,953.08",
- },
- ],
- });
- });
-
- H.editDashboard();
- H.showDashcardVisualizerModalSettings(0, {
- isVisualizerCard: false,
- });
-
- updateColumnTitle(originalAvgSeriesName, updatedOriginalAvgSeriesName);
- updateColumnTitle(
- originalCumSumSeriesName,
- updatedOriginalCumSumSeriesName,
- );
-
- updateColumnTitle(addedAvgSeriesName, updatedAddedAvgSeriesName);
- updateColumnTitle(addedSumSeriesName, updatedAddedSumSeriesName);
-
- H.saveDashcardVisualizerModalSettings();
- H.saveDashboard();
-
- [...originalSeriesColors, ...addedSeriesColors].forEach((color) => {
- showTooltipForCircleInSeries(color, circleIndex);
- H.assertEChartsTooltip({
- header: "2026",
- rows: [
- {
- color: originalSeriesColors[0],
- name: updatedOriginalAvgSeriesName,
- value: "56.86",
- },
- {
- color: originalSeriesColors[1],
- name: updatedOriginalCumSumSeriesName,
- value: "17,587",
- },
- {
- color: addedSeriesColors[0],
- name: updatedAddedAvgSeriesName,
- value: "5.41",
- },
- {
- color: addedSeriesColors[1],
- name: updatedAddedSumSeriesName,
- value: "1,953.08",
- },
- ],
- });
- });
- },
- );
-
it("should show percent change in tooltip for timeseries axis", () => {
testAvgTotalChange(showTooltipForCircleInSeries, "Q1: Average of Total");
testCumSumChange(false, "Q1: Cumulative sum of Quantity");
diff --git a/e2e/test/scenarios/visualizations-charts/visualizations-charts-reproductions.cy.spec.js b/e2e/test/scenarios/visualizations-charts/visualizations-charts-reproductions.cy.spec.js
index c75a5d85241..c5a9b55d65f 100644
--- a/e2e/test/scenarios/visualizations-charts/visualizations-charts-reproductions.cy.spec.js
+++ b/e2e/test/scenarios/visualizations-charts/visualizations-charts-reproductions.cy.spec.js
@@ -635,53 +635,6 @@ describe("issue 21665", () => {
});
});
-describe("issue 22527", { tags: "@skip" }, () => {
- const questionDetails = {
- native: {
- query:
- "select 1 x, 1 y, 20 size\nunion all select 2 x, 10 y, 10 size\nunion all select 3 x, -9 y, 6 size\nunion all select 4 x, 100 y, 30 size\nunion all select 5 x, -20 y, 70 size",
- },
- display: "scatter",
- visualization_settings: {
- "graph.dimensions": ["X"],
- "graph.metrics": ["Y"],
- },
- };
-
- function assertion() {
- cy.get("circle").should("have.length", 5).last().realHover();
-
- H.popover().within(() => {
- H.testPairedTooltipValues("X", "5");
- H.testPairedTooltipValues("Y", "-20");
- H.testPairedTooltipValues("SIZE", "70");
- });
- }
-
- beforeEach(() => {
- H.restore();
- cy.signInAsAdmin();
-
- H.createNativeQuestion(questionDetails, { visitQuestion: true });
- });
-
- it("should render negative values in a scatter visualziation (metabase#22527)", () => {
- assertion();
-
- H.openVizSettingsSidebar();
- cy.findByTestId("sidebar-left").within(() => {
- cy.findByTextEnsureVisible("Data").click();
- });
-
- // eslint-disable-next-line metabase/no-unscoped-text-selectors -- deprecated usage
- cy.findByText("Bubble size").parent().contains("Select a field").click();
-
- H.popover().contains(/size/i).click();
-
- assertion();
- });
-});
-
describe("issue 25156", () => {
const questionDetails = {
name: "25156",