Skip to content

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

Deflake model entity-qualified-id drill-through e2e test (#76373)

github-automation-metabasea0d9a2614ecd
diff --git a/e2e/test/scenarios/models/reproductions-2.cy.spec.ts b/e2e/test/scenarios/models/reproductions-2.cy.spec.ts
index 14541f01aa7..20597ac14e4 100644
--- a/e2e/test/scenarios/models/reproductions-2.cy.spec.ts
+++ b/e2e/test/scenarios/models/reproductions-2.cy.spec.ts
@@ -776,11 +776,20 @@ describe("issue 38747", () => {
H.popover().findByText("Entity Key").click();
H.datasetEditBar().button("Save").click();
+ cy.intercept("POST", "/api/card").as("createModel");
+ cy.intercept("POST", "/api/dataset").as("modelQuery");
H.modal().button("Save").click();
- cy.findByRole("gridcell", { name: "Nolan-Wolff" }).click({
- waitForAnimations: false,
- });
+ // Wait for the model to be created and its query to resolve before
+ // interacting with the table, otherwise the click can race the table
+ // rendering/animating in after the redirect to the model view.
+ cy.wait("@createModel");
+ cy.wait("@modelQuery");
+ H.tableInteractive().should("be.visible");
+
+ cy.findByRole("gridcell", { name: "Nolan-Wolff" })
+ .should("be.visible")
+ .click({ waitForAnimations: false });
// Assert that we're at an adhoc question with aproprate filters
cy.location("pathname").should("equal", "/question");