Skip to content

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

GDGT-2559 fix flaky E2E tests (#82336)

Will Fry23f164921b59
diff --git a/e2e/support/helpers/e2e-data-studio-helpers.ts b/e2e/support/helpers/e2e-data-studio-helpers.ts
index 29b83a8f581..06ee45ce369 100644
--- a/e2e/support/helpers/e2e-data-studio-helpers.ts
+++ b/e2e/support/helpers/e2e-data-studio-helpers.ts
@@ -1,3 +1,5 @@
+import type { MatcherOptions } from "@testing-library/cypress";
+
import type {
MeasureId,
SegmentId,
@@ -26,7 +28,10 @@ export const DataStudio = {
DataStudio.nav().should("be.visible");
},
Transforms: {
- header: () => cy.findByTestId("transforms-header"),
+ // The transform page shows a loader until the transform, databases and the
+ // lazy editor chunk have loaded, which can take longer than the default 4s
+ header: (options: MatcherOptions = {}) =>
+ cy.findByTestId("transforms-header", { timeout: 10_000, ...options }),
sectionHeader: () => cy.findByTestId("transforms-section-header"),
transformsTab: () =>
DataStudio.Transforms.sectionHeader().findByText("Transforms"),
diff --git a/e2e/test/scenarios/data-studio/transforms/transforms-incremental.cy.spec.ts b/e2e/test/scenarios/data-studio/transforms/transforms-incremental.cy.spec.ts
index cebc882d8da..c996b5a366e 100644
--- a/e2e/test/scenarios/data-studio/transforms/transforms-incremental.cy.spec.ts
+++ b/e2e/test/scenarios/data-studio/transforms/transforms-incremental.cy.spec.ts
@@ -171,7 +171,9 @@ describe("scenarios > admin > transforms incremental", () => {
.click();
H.popover().findByText(DB_NAME).click();
- getPythonDataPicker().findByText("Select a table…").click();
+ getPythonDataPicker()
+ .findByRole("button", { name: "Select a table…" })
+ .click();
H.entityPickerModal().findByText(SOURCE_TABLE).click();
H.PythonEditor.clear().paste(
diff --git a/e2e/test/scenarios/data-studio/transforms/transforms.cy.spec.ts b/e2e/test/scenarios/data-studio/transforms/transforms.cy.spec.ts
index 52821c8d695..3f154b09fcd 100644
--- a/e2e/test/scenarios/data-studio/transforms/transforms.cy.spec.ts
+++ b/e2e/test/scenarios/data-studio/transforms/transforms.cy.spec.ts
@@ -199,7 +199,9 @@ describe("scenarios > admin > transforms", { tags: ["@external"] }, () => {
.find(".cm-panels")
.should("be.visible");
- getPythonDataPicker().findByText("Select a table…").click();
+ getPythonDataPicker()
+ .findByRole("button", { name: "Select a table…" })
+ .click();
cy.log(
"the editor search panel must not paint over the modal (metabase#73290)",
@@ -2138,7 +2140,7 @@ LIMIT
);
cy.findByTestId("python-data-picker")
- .findByText("Select a table…")
+ .findByRole("button", { name: "Select a table…" })
.click();
H.entityPickerModal().within(() => {
@@ -2249,7 +2251,7 @@ LIMIT
);
cy.findByTestId("python-data-picker")
- .findByText("Select a table…")
+ .findByRole("button", { name: "Select a table…" })
.click();
H.entityPickerModal().within(() => {