Skip to content

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

Flake Jail 🚓 (#62533)

Ryan Laurie8b6e21c991a5
diff --git a/e2e/test/scenarios/embedding/sdk-iframe-embedding/view-and-curate-content.cy.spec.ts b/e2e/test/scenarios/embedding/sdk-iframe-embedding/view-and-curate-content.cy.spec.ts
index 6a3c0183244..cd8559acbee 100644
--- a/e2e/test/scenarios/embedding/sdk-iframe-embedding/view-and-curate-content.cy.spec.ts
+++ b/e2e/test/scenarios/embedding/sdk-iframe-embedding/view-and-curate-content.cy.spec.ts
@@ -8,195 +8,200 @@ const setupEmbed = (elementHtml: string) => {
`);
};
-describe("scenarios > embedding > sdk iframe embedding > view and curate content", () => {
- beforeEach(() => {
- cy.signInAsAdmin();
- H.prepareSdkIframeEmbedTest({ withTokenFeatures: true });
- });
-
- describe("<metabase-browser> (read-only mode)", () => {
- it("should show a collection browser with collection items", () => {
- setupEmbed('<metabase-browser initial-collection="root" />');
-
- H.getSimpleEmbedIframeContent()
- .should("contain", "Name")
- .findAllByText("Orders")
- .first()
- .should("be.visible");
+describe(
+ "scenarios > embedding > sdk iframe embedding > view and curate content",
+ { tags: "@flaky" },
+ () => {
+ beforeEach(() => {
+ cy.signInAsAdmin();
+ H.prepareSdkIframeEmbedTest({ withTokenFeatures: true });
});
- it("should navigate to question when clicking on a question item", () => {
- setupEmbed('<metabase-browser initial-collection="root" />');
+ describe("<metabase-browser> (read-only mode)", () => {
+ it("should show a collection browser with collection items", () => {
+ setupEmbed('<metabase-browser initial-collection="root" />');
- H.getSimpleEmbedIframeContent()
- .findByText("Orders")
- .should("be.visible")
- .click();
+ H.getSimpleEmbedIframeContent()
+ .should("contain", "Name")
+ .findAllByText("Orders")
+ .first()
+ .should("be.visible");
+ });
- cy.log("should show question view");
- H.getSimpleEmbedIframeContent()
- .findByTestId("query-visualization-root")
- .should("be.visible");
- });
+ it("should navigate to question when clicking on a question item", () => {
+ setupEmbed('<metabase-browser initial-collection="root" />');
+
+ H.getSimpleEmbedIframeContent()
+ .findByText("Orders")
+ .should("be.visible")
+ .click();
- it("should show New Exploration button and open data picker when clicked", () => {
- setupEmbed('<metabase-browser initial-collection="root" />');
+ cy.log("should show question view");
+ H.getSimpleEmbedIframeContent()
+ .findByTestId("query-visualization-root")
+ .should("be.visible");
+ });
- H.getSimpleEmbedIframeContent()
- .findByText("New Exploration")
- .should("be.visible")
- .click();
+ it("should show New Exploration button and open data picker when clicked", () => {
+ setupEmbed('<metabase-browser initial-collection="root" />');
- H.getSimpleEmbedIframeContent()
- .findByText("Pick your starting data")
- .should("be.visible");
- });
+ H.getSimpleEmbedIframeContent()
+ .findByText("New Exploration")
+ .should("be.visible")
+ .click();
- it("should pass through collection-visible-columns parameter", () => {
- setupEmbed(`
+ H.getSimpleEmbedIframeContent()
+ .findByText("Pick your starting data")
+ .should("be.visible");
+ });
+
+ it("should pass through collection-visible-columns parameter", () => {
+ setupEmbed(`
<metabase-browser
initial-collection="root"
collection-visible-columns='["type", "name"]'
/>
`);
- H.getSimpleEmbedIframeContent().should("contain", "Name");
- H.getSimpleEmbedIframeContent().should("contain", "Type");
- H.getSimpleEmbedIframeContent().should("not.contain", "Last edited by");
- H.getSimpleEmbedIframeContent().should("not.contain", "Last edited at");
- });
+ H.getSimpleEmbedIframeContent().should("contain", "Name");
+ H.getSimpleEmbedIframeContent().should("contain", "Type");
+ H.getSimpleEmbedIframeContent().should("not.contain", "Last edited by");
+ H.getSimpleEmbedIframeContent().should("not.contain", "Last edited at");
+ });
- it("should pass through collection-page-size parameter", () => {
- setupEmbed(`
+ it("should pass through collection-page-size parameter", () => {
+ setupEmbed(`
<metabase-browser
initial-collection="root"
collection-page-size="5"
/>
`);
- cy.log("should show exactly 5 collection entries");
- H.getSimpleEmbedIframeContent()
- .findAllByTestId("collection-entry-type")
- .should("have.length", 5);
- });
+ cy.log("should show exactly 5 collection entries");
+ H.getSimpleEmbedIframeContent()
+ .findAllByTestId("collection-entry-type")
+ .should("have.length", 5);
+ });
- it("should hide New Exploration button when with-new-question is false", () => {
- setupEmbed(`
+ it("should hide New Exploration button when with-new-question is false", () => {
+ setupEmbed(`
<metabase-browser
initial-collection="root"
with-new-question="false"
/>
`);
- H.getSimpleEmbedIframeContent()
- .findByText("New Exploration")
- .should("not.exist");
- });
- });
-
- describe("<metabase-browser> (read-write mode)", () => {
- it("should show New Dashboard button and open modal when clicked", () => {
- setupEmbed(
- '<metabase-browser initial-collection="root" read-only="false" />',
- );
-
- H.getSimpleEmbedIframeContent()
- .findByText("New Dashboard")
- .should("be.visible")
- .click();
-
- cy.log("should show create dashboard modal");
- H.getSimpleEmbedIframeContent()
- .findByText("New dashboard")
- .should("be.visible");
+ H.getSimpleEmbedIframeContent()
+ .findByText("New Exploration")
+ .should("not.exist");
+ });
});
- it("should update breadcrumbs when creating dashboard in different collection", () => {
- setupEmbed(
- '<metabase-browser initial-collection="root" read-only="false" />',
- );
+ describe("<metabase-browser> (read-write mode)", () => {
+ it("should show New Dashboard button and open modal when clicked", () => {
+ setupEmbed(
+ '<metabase-browser initial-collection="root" read-only="false" />',
+ );
+
+ H.getSimpleEmbedIframeContent()
+ .findByText("New Dashboard")
+ .should("be.visible")
+ .click();
+
+ cy.log("should show create dashboard modal");
+ H.getSimpleEmbedIframeContent()
+ .findByText("New dashboard")
+ .should("be.visible");
+ });
- cy.log("verify initial breadcrumb");
- H.getSimpleEmbedIframeContent()
- .findByText("Our analytics")
- .should("be.visible");
+ it("should update breadcrumbs when creating dashboard in different collection", () => {
+ setupEmbed(
+ '<metabase-browser initial-collection="root" read-only="false" />',
+ );
- H.getSimpleEmbedIframeContent().findByText("New Dashboard").click();
+ cy.log("verify initial breadcrumb");
+ H.getSimpleEmbedIframeContent()
+ .findByText("Our analytics")
+ .should("be.visible");
- H.getSimpleEmbedIframeContent().within(() => {
- cy.log("change collection to save dashboard in");
- cy.findByRole("dialog").within(() => {
- cy.findByText("Which collection should this go in?").should(
- "be.visible",
- );
+ H.getSimpleEmbedIframeContent().findByText("New Dashboard").click();
- cy.findByText("Our analytics").click();
- });
+ H.getSimpleEmbedIframeContent().within(() => {
+ cy.log("change collection to save dashboard in");
+ cy.findByRole("dialog").within(() => {
+ cy.findByText("Which collection should this go in?").should(
+ "be.visible",
+ );
- cy.findByText("First collection", { timeout: 20_000 }).click();
- cy.findByText("Select").click();
+ cy.findByText("Our analytics").click();
+ });
- cy.log("create the dashboard");
- cy.findByRole("dialog").within(() => {
- cy.findByPlaceholderText("What is the name of your dashboard?").type(
- "Test Dashboard",
- );
- cy.findByText("Create").click();
+ cy.findByText("First collection", { timeout: 20_000 }).click();
+ cy.findByText("Select").click();
+
+ cy.log("create the dashboard");
+ cy.findByRole("dialog").within(() => {
+ cy.findByPlaceholderText(
+ "What is the name of your dashboard?",
+ ).type("Test Dashboard");
+ cy.findByText("Create").click();
+ });
});
- });
- cy.log(
- "verify breadcrumbs are updated to reflect the selected collection",
- );
- H.getSimpleEmbedIframeContent()
- .findByTestId("sdk-breadcrumbs")
- .findByText("First collection")
- .should("be.visible");
- });
+ cy.log(
+ "verify breadcrumbs are updated to reflect the selected collection",
+ );
+ H.getSimpleEmbedIframeContent()
+ .findByTestId("sdk-breadcrumbs")
+ .findByText("First collection")
+ .should("be.visible");
+ });
- it("should show New Exploration button and open data picker when clicked", () => {
- setupEmbed(
- '<metabase-browser initial-collection="root" read-only="false" />',
- );
+ it("should show New Exploration button and open data picker when clicked", () => {
+ setupEmbed(
+ '<metabase-browser initial-collection="root" read-only="false" />',
+ );
- H.getSimpleEmbedIframeContent()
- .findByText("New Exploration")
- .should("be.visible")
- .click();
+ H.getSimpleEmbedIframeContent()
+ .findByText("New Exploration")
+ .should("be.visible")
+ .click();
- cy.log("should show data picker");
- H.getSimpleEmbedIframeContent()
- .findByText("Pick your starting data")
- .should("be.visible");
- });
+ cy.log("should show data picker");
+ H.getSimpleEmbedIframeContent()
+ .findByText("Pick your starting data")
+ .should("be.visible");
+ });
- it("should show Save button and save modal without entity picker when creating a new question", () => {
- setupEmbed(
- '<metabase-browser initial-collection="root" read-only="false" />',
- );
+ it("should show Save button and save modal without entity picker when creating a new question", () => {
+ setupEmbed(
+ '<metabase-browser initial-collection="root" read-only="false" />',
+ );
- H.getSimpleEmbedIframeContent().findByText("New Exploration").click();
+ H.getSimpleEmbedIframeContent().findByText("New Exploration").click();
- cy.log("select data model");
- H.getSimpleEmbedIframeContent().findByText("Orders").click();
+ cy.log("select data model");
+ H.getSimpleEmbedIframeContent().findByText("Orders").click();
- cy.log("should show Save button");
- H.getSimpleEmbedIframeContent()
- .findByText("Save")
- .should("be.visible")
- .click();
+ cy.log("should show Save button");
+ H.getSimpleEmbedIframeContent()
+ .findByText("Save")
+ .should("be.visible")
+ .click();
- cy.log("should show save modal without entity picker");
- H.getSimpleEmbedIframeContent().within(() => {
- cy.findByRole("dialog").within(() => {
- cy.findByText("Save new question").should("be.visible");
- cy.findByText("Where do you want to save this?").should("not.exist");
+ cy.log("should show save modal without entity picker");
+ H.getSimpleEmbedIframeContent().within(() => {
+ cy.findByRole("dialog").within(() => {
+ cy.findByText("Save new question").should("be.visible");
+ cy.findByText("Where do you want to save this?").should(
+ "not.exist",
+ );
+ });
});
});
- });
- it("should hide New Dashboard button when with-new-dashboard is false", () => {
- setupEmbed(`
+ it("should hide New Dashboard button when with-new-dashboard is false", () => {
+ setupEmbed(`
<metabase-browser
initial-collection="root"
read-only="false"
@@ -204,77 +209,77 @@ describe("scenarios > embedding > sdk iframe embedding > view and curate content
/>
`);
- H.getSimpleEmbedIframeContent()
- .findByText("New Dashboard")
- .should("not.exist");
- });
+ H.getSimpleEmbedIframeContent()
+ .findByText("New Dashboard")
+ .should("not.exist");
+ });
- it("should create a dashboard in a new collection", () => {
- setupEmbed(
- '<metabase-browser initial-collection="root" read-only="false" />',
- );
+ it("should create a dashboard in a new collection", () => {
+ setupEmbed(
+ '<metabase-browser initial-collection="root" read-only="false" />',
+ );
- H.getSimpleEmbedIframeContent()
- .findByText("New Dashboard")
- .should("be.visible")
- .click();
+ H.getSimpleEmbedIframeContent()
+ .findByText("New Dashboard")
+ .should("be.visible")
+ .click();
- H.getSimpleEmbedIframeContent().within(() => {
- cy.findByRole("dialog").within(() => {
- cy.findByPlaceholderText("What is the name of your dashboard?").type(
- "Foo Bar Dashboard",
- );
+ H.getSimpleEmbedIframeContent().within(() => {
+ cy.findByRole("dialog").within(() => {
+ cy.findByPlaceholderText(
+ "What is the name of your dashboard?",
+ ).type("Foo Bar Dashboard");
- cy.log("open the collection picker");
- cy.findByText("Our analytics").click();
- });
+ cy.log("open the collection picker");
+ cy.findByText("Our analytics").click();
+ });
- cy.findByText("Collections").click();
- cy.findByText("New collection").click();
+ cy.findByText("Collections").click();
+ cy.findByText("New collection").click();
- cy.findAllByRole("dialog")
- .eq(2)
- .within(() => {
- cy.findByPlaceholderText("My new collection").type(
- "Foo Collection",
- );
- cy.findByText("Create").click();
- });
+ cy.findAllByRole("dialog")
+ .eq(2)
+ .within(() => {
+ cy.findByPlaceholderText("My new collection").type(
+ "Foo Collection",
+ );
+ cy.findByText("Create").click();
+ });
- cy.findByText("Select").click();
+ cy.findByText("Select").click();
- cy.log("create new dashboard");
- cy.findByRole("dialog").within(() => {
- cy.findByText("Create").click();
+ cy.log("create new dashboard");
+ cy.findByRole("dialog").within(() => {
+ cy.findByText("Create").click();
+ });
});
- });
- cy.log("dashboard is created and shows empty state");
- H.getSimpleEmbedIframeContent()
- .findByText("This dashboard is empty")
- .should("be.visible");
-
- cy.log("breadcrumbs show the new collection");
- H.getSimpleEmbedIframeContent()
- .findByTestId("sdk-breadcrumbs")
- .findByText("Foo Collection")
- .should("be.visible");
-
- cy.log("breadcrumbs show the new dashboard");
- H.getSimpleEmbedIframeContent()
- .findByTestId("sdk-breadcrumbs")
- .findByText("Foo Bar Dashboard")
- .should("be.visible");
-
- cy.log("dashboard title is visible in header");
- H.getSimpleEmbedIframeContent()
- .findByTestId("dashboard-header")
- .findByText("Foo Bar Dashboard")
- .should("be.visible");
- });
+ cy.log("dashboard is created and shows empty state");
+ H.getSimpleEmbedIframeContent()
+ .findByText("This dashboard is empty")
+ .should("be.visible");
+
+ cy.log("breadcrumbs show the new collection");
+ H.getSimpleEmbedIframeContent()
+ .findByTestId("sdk-breadcrumbs")
+ .findByText("Foo Collection")
+ .should("be.visible");
+
+ cy.log("breadcrumbs show the new dashboard");
+ H.getSimpleEmbedIframeContent()
+ .findByTestId("sdk-breadcrumbs")
+ .findByText("Foo Bar Dashboard")
+ .should("be.visible");
+
+ cy.log("dashboard title is visible in header");
+ H.getSimpleEmbedIframeContent()
+ .findByTestId("dashboard-header")
+ .findByText("Foo Bar Dashboard")
+ .should("be.visible");
+ });
- it("should hide New Exploration button when with-new-question is false", () => {
- setupEmbed(`
+ it("should hide New Exploration button when with-new-question is false", () => {
+ setupEmbed(`
<metabase-browser
initial-collection="root"
read-only="false"
@@ -282,13 +287,13 @@ describe("scenarios > embedding > sdk iframe embedding > view and curate content
/>
`);
- H.getSimpleEmbedIframeContent()
- .findByText("New Exploration")
- .should("not.exist");
- });
+ H.getSimpleEmbedIframeContent()
+ .findByText("New Exploration")
+ .should("not.exist");
+ });
- it("should pass through data-picker-entity-types parameter", () => {
- setupEmbed(`
+ it("should pass through data-picker-entity-types parameter", () => {
+ setupEmbed(`
<metabase-browser
initial-collection="root"
read-only="false"
@@ -296,37 +301,38 @@ describe("scenarios > embedding > sdk iframe embedding > view and curate content
/>
`);
- H.getSimpleEmbedIframeContent().findByText("New Exploration").click();
+ H.getSimpleEmbedIframeContent().findByText("New Exploration").click();
- cy.log("should show data picker with limited entity types");
- H.getSimpleEmbedIframeContent()
- .findByText("Pick your starting data")
- .should("be.visible");
+ cy.log("should show data picker with limited entity types");
+ H.getSimpleEmbedIframeContent()
+ .findByText("Pick your starting data")
+ .should("be.visible");
- cy.log("should show Orders table but not Orders model");
- H.getSimpleEmbedIframeContent().should("contain", "Orders");
- H.getSimpleEmbedIframeContent().should("not.contain", "Orders model");
+ cy.log("should show Orders table but not Orders model");
+ H.getSimpleEmbedIframeContent().should("contain", "Orders");
+ H.getSimpleEmbedIframeContent().should("not.contain", "Orders model");
+ });
});
- });
- describe("breadcrumb navigation", () => {
- it("should show breadcrumbs when navigating between content", () => {
- setupEmbed('<metabase-browser initial-collection="root" />');
+ describe("breadcrumb navigation", () => {
+ it("should show breadcrumbs when navigating between content", () => {
+ setupEmbed('<metabase-browser initial-collection="root" />');
- cy.log("should show initial breadcrumb");
- H.getSimpleEmbedIframeContent()
- .findByText("Our analytics")
- .should("be.visible");
+ cy.log("should show initial breadcrumb");
+ H.getSimpleEmbedIframeContent()
+ .findByText("Our analytics")
+ .should("be.visible");
- H.getSimpleEmbedIframeContent().findAllByText("Orders").first().click();
+ H.getSimpleEmbedIframeContent().findAllByText("Orders").first().click();
- cy.log("should show breadcrumb for the question");
- H.getSimpleEmbedIframeContent().should("contain", "Orders");
+ cy.log("should show breadcrumb for the question");
+ H.getSimpleEmbedIframeContent().should("contain", "Orders");
- H.getSimpleEmbedIframeContent().findByText("Our analytics").click();
+ H.getSimpleEmbedIframeContent().findByText("Our analytics").click();
- cy.log("should be back at collection browser");
- H.getSimpleEmbedIframeContent().should("contain", "Name");
+ cy.log("should be back at collection browser");
+ H.getSimpleEmbedIframeContent().should("contain", "Name");
+ });
});
- });
-});
+ },
+);
diff --git a/e2e/test/scenarios/models/reproductions.cy.spec.ts b/e2e/test/scenarios/models/reproductions.cy.spec.ts
index bb812f1e9dd..fe53973e85c 100644
--- a/e2e/test/scenarios/models/reproductions.cy.spec.ts
+++ b/e2e/test/scenarios/models/reproductions.cy.spec.ts
@@ -56,52 +56,56 @@ describe("issue 29943", () => {
cy.intercept("POST", "/api/dataset").as("dataset");
});
- it("selects the right column when clicking a column header (metabase#29943)", () => {
- H.createQuestion(
- {
- type: "model",
- query: {
- "source-table": ORDERS_ID,
- expressions: {
- Custom: ["+", 1, 1],
+ it(
+ "selects the right column when clicking a column header (metabase#29943)",
+ { tags: "@flaky" },
+ () => {
+ H.createQuestion(
+ {
+ type: "model",
+ query: {
+ "source-table": ORDERS_ID,
+ expressions: {
+ Custom: ["+", 1, 1],
+ },
+ fields: [
+ ["field", ORDERS.ID, { "base-type": "type/BigInteger" }],
+ ["field", ORDERS.TOTAL, { "base-type": "type/Float" }],
+ ["expression", "Custom", { "base-type": "type/Integer" }],
+ ],
+ limit: 5, // optimization
},
- fields: [
- ["field", ORDERS.ID, { "base-type": "type/BigInteger" }],
- ["field", ORDERS.TOTAL, { "base-type": "type/Float" }],
- ["expression", "Custom", { "base-type": "type/Integer" }],
- ],
- limit: 5, // optimization
},
- },
- { visitQuestion: true },
- );
+ { visitQuestion: true },
+ );
- H.openQuestionActions();
- H.popover().findByText("Edit metadata").click();
- H.waitForLoaderToBeRemoved();
+ H.openQuestionActions();
+ H.popover().findByText("Edit metadata").click();
+ H.waitForLoaderToBeRemoved();
- reorderTotalAndCustomColumns();
- cy.button("Save changes").click();
- cy.wait("@dataset");
+ reorderTotalAndCustomColumns();
+ cy.button("Save changes").click();
+ cy.wait("@dataset");
- H.openQuestionActions();
- H.popover().findByText("Edit metadata").click();
- H.waitForLoaderToBeRemoved();
+ H.openQuestionActions();
+ H.popover().findByText("Edit metadata").click();
+ H.waitForLoaderToBeRemoved();
- assertColumnSelected(0, "ID");
+ assertColumnSelected(0, "ID");
- getHeaderCell(1, "Custom");
- H.tableHeaderClick("Custom");
- assertColumnSelected(1, "Custom");
+ getHeaderCell(1, "Custom");
+ H.tableHeaderClick("Custom");
+ assertColumnSelected(1, "Custom");
- getHeaderCell(2, "Total");
- H.tableHeaderClick("Total");
- assertColumnSelected(2, "Total");
+ getHeaderCell(2, "Total");
+ H.tableHeaderClick("Total");
+ assertColumnSelected(2, "Total");
- getHeaderCell(0, "ID");
- H.tableHeaderClick("ID");
- assertColumnSelected(0, "ID");
- });
+ getHeaderCell(0, "ID");
+ H.tableHeaderClick("ID");
+ assertColumnSelected(0, "ID");
+ },
+ );
});
describe("issue 35711", () => {