The easy-to-use open source Business Intelligence and Embedded Analytics tool that lets everyone work with data :bar_chart:
TypeScript analyticsbibusiness-intelligencebusinessintelligenceclojuredashboarddatadata-analysisdata-visualizationdatabasemetabasemysqlpostgrespostgresqlreportingslacksql-editorvisualization
Fix some transform flaky tests (#63517)
Alexander Polyankina85675ef2af0
diff --git a/e2e/test/scenarios/admin/transforms.cy.spec.ts b/e2e/test/scenarios/admin/transforms.cy.spec.tsindex 95bc8ebef19..c8ae2d6a6a3 100644--- a/e2e/test/scenarios/admin/transforms.cy.spec.ts+++ b/e2e/test/scenarios/admin/transforms.cy.spec.ts@@ -421,22 +421,20 @@ H.describeWithSnowplowEE("scenarios > admin > transforms", () => {createMbqlTransform({ visitTransform: true });getTagsInput().click();- H.popover().within(() => {- cy.findByRole("option", { name: "hourly" }).click();- cy.wait("@updateTransform");- assertOptionSelected("hourly");- assertOptionNotSelected("daily");+ H.popover().findByRole("option", { name: "hourly" }).click();+ cy.wait("@updateTransform");+ assertOptionSelected("hourly");+ assertOptionNotSelected("daily");- cy.findByRole("option", { name: "daily" }).click();- cy.wait("@updateTransform");- assertOptionSelected("hourly");- assertOptionSelected("daily");+ H.popover().findByRole("option", { name: "daily" }).click();+ cy.wait("@updateTransform");+ assertOptionSelected("hourly");+ assertOptionSelected("daily");- cy.findByRole("option", { name: "hourly" }).click();- cy.wait("@updateTransform");- assertOptionNotSelected("hourly");- assertOptionSelected("daily");- });+ H.popover().findByRole("option", { name: "hourly" }).click();+ cy.wait("@updateTransform");+ assertOptionNotSelected("hourly");+ assertOptionSelected("daily");});it("should be able to create tags inline", () => {@@ -1368,26 +1366,24 @@ describe("scenarios > admin > transforms > jobs", () => {});describe("tags", () => {- it("should be able to add and remove tags", { tags: "@flaky" }, () => {+ it("should be able to add and remove tags", () => {H.createTransformJob({ name: "New job" }, { visitTransformJob: true });getTagsInput().click();- H.popover().within(() => {- cy.findByRole("option", { name: "hourly" }).click();- cy.wait("@updateJob");- assertOptionSelected("hourly");- assertOptionNotSelected("daily");+ H.popover().findByRole("option", { name: "hourly" }).click();+ cy.wait("@updateJob");+ assertOptionSelected("hourly");+ assertOptionNotSelected("daily");- cy.findByRole("option", { name: "daily" }).click();- cy.wait("@updateJob");- assertOptionSelected("hourly");- assertOptionSelected("daily");+ H.popover().findByRole("option", { name: "daily" }).click();+ cy.wait("@updateJob");+ assertOptionSelected("hourly");+ assertOptionSelected("daily");- cy.findByRole("option", { name: "hourly" }).click();- cy.wait("@updateJob");- assertOptionNotSelected("hourly");- assertOptionSelected("daily");- });+ H.popover().findByRole("option", { name: "hourly" }).click();+ cy.wait("@updateJob");+ assertOptionNotSelected("hourly");+ assertOptionSelected("daily");});});@@ -1469,7 +1465,7 @@ describe("scenarios > admin > transforms > jobs", () => {});describe("filtering", () => {- it("should be able to filter jobs ", { tags: "@flaky" }, () => {+ it("should be able to filter jobs ", () => {cy.log("run hourly job so know that was recently run");visitJobListPage();@@ -1489,26 +1485,10 @@ describe("scenarios > admin > transforms > jobs", () => {cy.log("last run at - add a filter");getLastRunAtFilterWidget().click();- H.popover().findByText("Today").click();-- getLastRunAtFilterWidget().should("contain", "Today");- getContentTable().within(() => {- cy.findByText("Hourly job").should("be.visible");- cy.findByText("Daily job").should("not.exist");- cy.findByText("Weekly job").should("not.exist");- cy.findByText("Monthly job").should("not.exist");- });+ H.popover().findByText("Previous month").click();- cy.log("last run at filter - update a filter");- getLastRunAtFilterWidget().click();- H.popover().findByText("Week").click();- getLastRunAtFilterWidget().should("contain", "This week");- getContentTable().within(() => {- cy.findByText("Hourly job").should("be.visible");- cy.findByText("Daily job").should("not.exist");- cy.findByText("Weekly job").should("not.exist");- cy.findByText("Monthly job").should("not.exist");- });+ getLastRunAtFilterWidget().should("contain", "Previous month");+ getContentTable().should("not.exist");cy.log("last run at filter - remove filter");getLastRunAtFilterWidget().button("Remove filter").click();@@ -1532,33 +1512,17 @@ describe("scenarios > admin > transforms > jobs", () => {cy.log("next run - add a filter");getNextRunFilterWidget().click();H.popover().within(() => {- cy.findByText("Relative date range…").click();- cy.findByText("Current").click();- cy.findByText("Week").click();- });-- getNextRunFilterWidget().should("contain", "This week");- getContentTable().within(() => {- cy.findByText("Hourly job").should("be.visible");- cy.findByText("Daily job").should("be.visible");- cy.findByText("Weekly job").should("not.exist");- cy.findByText("Monthly job").should("not.exist");- });-- cy.log("next run filter - update a filter");- getNextRunFilterWidget().click();- H.popover().within(() => {- cy.findByText("Next").click();- cy.findByDisplayValue(30).clear().type("2");+ cy.findByText("Fixed date range…").click();+ cy.findByLabelText("Start date").clear().type("12/10/2024");+ cy.findByLabelText("End date").clear().type("01/05/2025");cy.button("Apply").click();});- getNextRunFilterWidget().should("contain", "Next 2 weeks");- getContentTable().within(() => {- cy.findByText("Hourly job").should("not.exist");- cy.findByText("Daily job").should("not.exist");- cy.findByText("Weekly job").should("be.visible");- cy.findByText("Monthly job").should("not.exist");- });++ getNextRunFilterWidget().should(+ "contain",+ "December 10, 2024 - January 5, 2025",+ );+ getContentTable().should("not.exist");cy.log("next run filter - remove filter");getNextRunFilterWidget().button("Remove filter").click();@@ -2084,6 +2048,10 @@ function getTagsInput() {return cy.findByPlaceholderText("Add tags");}+function getTagsInputContainer() {+ return getTagsInput().parent();+}+function getContentTable() {return cy.findByTestId("admin-content-table");}@@ -2277,17 +2245,9 @@ function assertTableDoesNotExistError({}function assertOptionSelected(name: string) {- cy.findByRole("option", { name }).should(- "have.attr",- "aria-selected",- "true",- );+ getTagsInputContainer().findByText(name).should("be.visible");}function assertOptionNotSelected(name: string) {- cy.findByRole("option", { name }).should(- "not.have.attr",- "aria-selected",- "true",- );+ getTagsInputContainer().findByText(name).should("not.exist");}