diff --git a/e2e/test/scenarios/custom-column/cc-typing-suggestion.cy.spec.js b/e2e/test/scenarios/custom-column/cc-typing-suggestion.cy.spec.js index e23937551c15eefae28343ca206a8ca2020d00ca..ef6c455e5500d99d1f5151947a38c271472a76be 100644 --- a/e2e/test/scenarios/custom-column/cc-typing-suggestion.cy.spec.js +++ b/e2e/test/scenarios/custom-column/cc-typing-suggestion.cy.spec.js @@ -50,13 +50,17 @@ describe("scenarios > question > custom column > typing suggestion", () => { cy.contains("length([Title])"); }); - it("should correctly insert function suggestion with the opening parenthesis", () => { - addCustomColumn(); - enterCustomColumnDetails({ formula: "LOW{enter}" }); - - // eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage - cy.contains("lower("); - }); + it( + "should correctly insert function suggestion with the opening parenthesis", + { tags: "@flaky" }, + () => { + addCustomColumn(); + enterCustomColumnDetails({ formula: "LOW{enter}" }); + + // eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage + cy.contains("lower("); + }, + ); it("should show expression function helper if a proper function is typed", () => { addCustomColumn(); diff --git a/e2e/test/scenarios/embedding/interactive-embedding.cy.spec.js b/e2e/test/scenarios/embedding/interactive-embedding.cy.spec.js index 5804119f1d6cc107938f6e4cfcd8bea293433d5e..bb15ad2bb9711a18e9d79503e7bd2d1266aa028a 100644 --- a/e2e/test/scenarios/embedding/interactive-embedding.cy.spec.js +++ b/e2e/test/scenarios/embedding/interactive-embedding.cy.spec.js @@ -470,68 +470,72 @@ describeEE("scenarios > embedding > full app", () => { ); }); - it("should send `frame` message with dashboard height when the dashboard is resized (metabase#37437)", () => { - const TAB_1 = { id: 1, name: "Tab 1" }; - const TAB_2 = { id: 2, name: "Tab 2" }; - createDashboardWithTabs({ - tabs: [TAB_1, TAB_2], - name: "Dashboard", - dashcards: [ - createMockTextDashboardCard({ - dashboard_tab_id: TAB_1.id, - size_x: 10, - size_y: 20, - text: "I am a text card", - }), - ], - }).then(dashboard => { - visitFullAppEmbeddingUrl({ - url: `/dashboard/${dashboard.id}`, - onBeforeLoad(window) { - cy.spy(window.parent, "postMessage").as("postMessage"); - }, + it( + "should send `frame` message with dashboard height when the dashboard is resized (metabase#37437)", + { tags: "@flaky" }, + () => { + const TAB_1 = { id: 1, name: "Tab 1" }; + const TAB_2 = { id: 2, name: "Tab 2" }; + createDashboardWithTabs({ + tabs: [TAB_1, TAB_2], + name: "Dashboard", + dashcards: [ + createMockTextDashboardCard({ + dashboard_tab_id: TAB_1.id, + size_x: 10, + size_y: 20, + text: "I am a text card", + }), + ], + }).then(dashboard => { + visitFullAppEmbeddingUrl({ + url: `/dashboard/${dashboard.id}`, + onBeforeLoad(window) { + cy.spy(window.parent, "postMessage").as("postMessage"); + }, + }); }); - }); - // TODO: Find a way to assert that this is the last call. - cy.get("@postMessage").should("have.been.calledWith", { - metabase: { - type: "frame", - frame: { - mode: "fit", - height: Cypress.sinon.match(value => value > 1000), + // TODO: Find a way to assert that this is the last call. + cy.get("@postMessage").should("have.been.calledWith", { + metabase: { + type: "frame", + frame: { + mode: "fit", + height: Cypress.sinon.match(value => value > 1000), + }, }, - }, - }); + }); - cy.get("@postMessage").invoke("resetHistory"); - cy.findByRole("tab", { name: TAB_2.name }).click(); - cy.get("@postMessage").should("have.been.calledWith", { - metabase: { - type: "frame", - frame: { - mode: "fit", - height: Cypress.sinon.match(value => value < 400), + cy.get("@postMessage").invoke("resetHistory"); + cy.findByRole("tab", { name: TAB_2.name }).click(); + cy.get("@postMessage").should("have.been.calledWith", { + metabase: { + type: "frame", + frame: { + mode: "fit", + height: Cypress.sinon.match(value => value < 400), + }, }, - }, - }); + }); - cy.get("@postMessage").invoke("resetHistory"); - cy.findByTestId("app-bar").findByText("Our analytics").click(); + cy.get("@postMessage").invoke("resetHistory"); + cy.findByTestId("app-bar").findByText("Our analytics").click(); - cy.findByRole("heading", { name: "Metabase analytics" }).should( - "be.visible", - ); - cy.get("@postMessage").should("have.been.calledWith", { - metabase: { - type: "frame", - frame: { - mode: "fit", - height: 800, + cy.findByRole("heading", { name: "Metabase analytics" }).should( + "be.visible", + ); + cy.get("@postMessage").should("have.been.calledWith", { + metabase: { + type: "frame", + frame: { + mode: "fit", + height: 800, + }, }, - }, - }); - }); + }); + }, + ); it("should allow downloading question results when logged in via Google SSO (metabase#39848)", () => { const CSRF_TOKEN = "abcdefgh"; 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 cbecd09b00c89ac589be0de66a737d30dcc3364a..2ffe4dd028627ba97e7dc780d55d8a25e139ae3e 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 @@ -963,26 +963,30 @@ describe("issue 29786", { tags: "@external" }, () => { cy.signInAsAdmin(); }); - it("should allow using field filters with null schema (metabase#29786)", () => { - openNativeEditor({ databaseName: "QA MySQL8" }); - SQLFilter.enterParameterizedQuery(SQL_QUERY); - - cy.findAllByTestId("variable-type-select").first().click(); - SQLFilter.chooseType("Field Filter"); - FieldFilter.mapTo({ table: "Products", field: "Category" }); - cy.findAllByTestId("variable-type-select").last().click(); - SQLFilter.chooseType("Field Filter"); - FieldFilter.mapTo({ table: "Products", field: "Vendor" }); - - filterWidget().first().click(); - FieldFilter.addWidgetStringFilter("Widget"); - filterWidget().last().click(); - FieldFilter.addWidgetStringFilter("Von-Gulgowski"); - - SQLFilter.runQuery(); - // eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage - cy.findByText("1087115303928").should("be.visible"); - }); + it( + "should allow using field filters with null schema (metabase#29786)", + { tags: "@flaky" }, + () => { + openNativeEditor({ databaseName: "QA MySQL8" }); + SQLFilter.enterParameterizedQuery(SQL_QUERY); + + cy.findAllByTestId("variable-type-select").first().click(); + SQLFilter.chooseType("Field Filter"); + FieldFilter.mapTo({ table: "Products", field: "Category" }); + cy.findAllByTestId("variable-type-select").last().click(); + SQLFilter.chooseType("Field Filter"); + FieldFilter.mapTo({ table: "Products", field: "Vendor" }); + + filterWidget().first().click(); + FieldFilter.addWidgetStringFilter("Widget"); + filterWidget().last().click(); + FieldFilter.addWidgetStringFilter("Von-Gulgowski"); + + SQLFilter.runQuery(); + // eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage + cy.findByText("1087115303928").should("be.visible"); + }, + ); }); describe("issue 31606", { tags: "@external" }, () => { 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 7e52829cdfe32fae6fadfd5fdf872945b5a393ac..627b001080dc81621e4f68e026eb7d93f612f9c9 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 @@ -230,9 +230,13 @@ describe("scenarios > visualizations > line/bar chart > tooltips", () => { testTooltipPairs(updatedTooltipText); }); - it("should show percent change in tooltip for timeseries axis", () => { - testSumTotalChange(); - }); + it( + "should show percent change in tooltip for timeseries axis", + { tags: "@flaky" }, + () => { + testSumTotalChange(); + }, + ); }); describe("> single series question on dashboard with added series", () => { @@ -284,10 +288,14 @@ describe("scenarios > visualizations > line/bar chart > tooltips", () => { testTooltipPairs(updatedAddedSeriesTooltipText); }); - it("should show percent change in tooltip for timeseries axis", () => { - testSumTotalChange(); - testAvgTotalChange(); - }); + it( + "should show percent change in tooltip for timeseries axis", + { tags: "@flaky" }, + () => { + testSumTotalChange(); + testAvgTotalChange(); + }, + ); }); describe("> multi series question on dashboard", () => { @@ -326,10 +334,14 @@ describe("scenarios > visualizations > line/bar chart > tooltips", () => { testTooltipPairs(updatedTooltipText); }); - it("should show percent change in tooltip for timeseries axis", () => { - testAvgTotalChange(); - testCumSumChange(); - }); + it( + "should show percent change in tooltip for timeseries axis", + { tags: "@flaky" }, + () => { + testAvgTotalChange(); + testCumSumChange(); + }, + ); }); describe("> multi series question on dashboard with added question", () => { @@ -411,12 +423,16 @@ describe("scenarios > visualizations > line/bar chart > tooltips", () => { }); }); - it("should show percent change in tooltip for timeseries axis", () => { - testAvgTotalChange(); - testCumSumChange(false); - testAvgDiscountChange(); - testSumDiscountChange(); - }); + it( + "should show percent change in tooltip for timeseries axis", + { tags: "@flaky" }, + () => { + testAvgTotalChange(); + testCumSumChange(false); + testAvgDiscountChange(); + testSumDiscountChange(); + }, + ); }); describe("> bar chart question on dashboard", () => { @@ -508,70 +524,82 @@ describe("scenarios > visualizations > line/bar chart > tooltips", () => { testTooltipPairs(updatedAddedSeriesTooltipText); }); - it("should show percent change in tooltip for timeseries axis", () => { - testSumTotalChange(showTooltipForBarInSeries); - testAvgTotalChange(showTooltipForBarInSeries); - }); + it( + "should show percent change in tooltip for timeseries axis", + { tags: "@flaky" }, + () => { + testSumTotalChange(showTooltipForBarInSeries); + testAvgTotalChange(showTooltipForBarInSeries); + }, + ); }); describe("> single series question grouped by month on dashboard", () => { - it("should show percent change in tooltip for timeseries axis", () => { - setup({ - question: SUM_OF_TOTAL_MONTH, - }).then(dashboardId => { - visitDashboard(dashboardId); - }); - - showTooltipForCircleInSeries("#88BF4D"); - testTooltipPairs([ - ["Created At", "April 2022"], - ["Sum of Total", "52.76"], - ]); - testTooltipExcludesText("Compared to preivous month"); + it( + "should show percent change in tooltip for timeseries axis", + { tags: "@flaky" }, + () => { + setup({ + question: SUM_OF_TOTAL_MONTH, + }).then(dashboardId => { + visitDashboard(dashboardId); + }); - showTooltipForCircleInSeries("#88BF4D"); - testTooltipPairs([ - ["Created At", "May 2022"], - ["Sum of Total", "1,265.72"], - ["Compared to previous month", "+2,299.19%"], - ]); - }); + showTooltipForCircleInSeries("#88BF4D"); + testTooltipPairs([ + ["Created At", "April 2022"], + ["Sum of Total", "52.76"], + ]); + testTooltipExcludesText("Compared to preivous month"); - it("should not show percent change when previous month is missing from result data", () => { - setup({ - question: SUM_OF_TOTAL_MONTH_EXCLUDE_MAY_AUG, - }).then(dashboardId => { - visitDashboard(dashboardId); - }); + showTooltipForCircleInSeries("#88BF4D"); + testTooltipPairs([ + ["Created At", "May 2022"], + ["Sum of Total", "1,265.72"], + ["Compared to previous month", "+2,299.19%"], + ]); + }, + ); + + it( + "should not show percent change when previous month is missing from result data", + { tags: "@flaky" }, + () => { + setup({ + question: SUM_OF_TOTAL_MONTH_EXCLUDE_MAY_AUG, + }).then(dashboardId => { + visitDashboard(dashboardId); + }); - showTooltipForCircleInSeries("#88BF4D"); - testTooltipPairs([ - ["Created At", "April 2022"], - ["Sum of Total", "52.76"], - ]); - testTooltipExcludesText("Compared to preivous month"); + showTooltipForCircleInSeries("#88BF4D"); + testTooltipPairs([ + ["Created At", "April 2022"], + ["Sum of Total", "52.76"], + ]); + testTooltipExcludesText("Compared to preivous month"); - showTooltipForCircleInSeries("#88BF4D"); - testTooltipPairs([ - ["Created At", "June 2022"], - ["Sum of Total", "2,072.94"], - ]); - testTooltipExcludesText("Compared to preivous month"); + showTooltipForCircleInSeries("#88BF4D"); + testTooltipPairs([ + ["Created At", "June 2022"], + ["Sum of Total", "2,072.94"], + ]); + testTooltipExcludesText("Compared to preivous month"); - showTooltipForCircleInSeries("#88BF4D"); - testTooltipPairs([ - ["Created At", "July 2022"], - ["Sum of Total", "3,734.69"], - ["Compared to previous month", "+80.16%"], - ]); + showTooltipForCircleInSeries("#88BF4D"); + testTooltipPairs([ + ["Created At", "July 2022"], + ["Sum of Total", "3,734.69"], + ["Compared to previous month", "+80.16%"], + ]); - showTooltipForCircleInSeries("#88BF4D"); - testTooltipPairs([ - ["Created At", "September 2022"], - ["Sum of Total", "5,372.08"], - ]); - testTooltipExcludesText("Compared to preivous month"); - }); + showTooltipForCircleInSeries("#88BF4D"); + testTooltipPairs([ + ["Created At", "September 2022"], + ["Sum of Total", "5,372.08"], + ]); + testTooltipExcludesText("Compared to preivous month"); + }, + ); it("should not show if x-axis is not timeseries", () => { setup({ @@ -596,106 +624,112 @@ describe("scenarios > visualizations > line/bar chart > tooltips", () => { }); }); - describe("> percent change across daylight savings time change", () => { - const SUM_OF_TOTAL_APRIL = { - name: "Q1", - query: { - "source-table": ORDERS_ID, - aggregation: [["sum", ["field", ORDERS.TOTAL, null]]], - breakout: [["field", ORDERS.CREATED_AT, { "temporal-unit": "month" }]], - filter: [ - "between", - ["field", 39, { "base-type": "type/DateTime" }], - "2024-01-01", - "2024-05-30", - ], - }, - display: "line", - }; - - const APRIL_CHANGES = [null, "-10.89%", "+11.1%", "-2.89%"]; - - const SUM_OF_TOTAL_DST_WEEK = { - name: "Q1", - query: { - "source-table": ORDERS_ID, - aggregation: [["sum", ["field", ORDERS.TOTAL, null]]], - breakout: [["field", ORDERS.CREATED_AT, { "temporal-unit": "week" }]], - filter: [ - "between", - ["field", 39, { "base-type": "type/DateTime" }], - "2024-03-01", - "2024-03-31", - ], - }, - display: "line", - }; - - const DST_WEEK_CHANGES = [null, "+191.48%", "+4.76%", "-2.36%"]; - - const SUM_OF_TOTAL_DST_DAY = { - name: "Q1", - query: { - "source-table": ORDERS_ID, - aggregation: [["sum", ["field", ORDERS.TOTAL, null]]], - breakout: [["field", ORDERS.CREATED_AT, { "temporal-unit": "day" }]], - filter: [ - "between", - ["field", 39, { "base-type": "type/DateTime" }], - "2024-03-09", - "2024-03-12", - ], - }, - display: "line", - }; - - const DST_DAY_CHANGES = [null, "+27.5%", "-26.16%"]; - - it("should not omit percent change on April", () => { - setup({ question: SUM_OF_TOTAL_APRIL }).then(dashboardId => { - visitDashboard(dashboardId); - }); - - APRIL_CHANGES.forEach(change => { - showTooltipForCircleInSeries("#88BF4D"); - if (change === null) { - testTooltipExcludesText("Compared to preivous"); - return; - } - testPairedTooltipValues("Compared to previous month", change); - }); - }); - - it("should not omit percent change the week after DST begins", () => { - setup({ question: SUM_OF_TOTAL_DST_WEEK }).then(dashboardId => { - visitDashboard(dashboardId); - }); - - DST_WEEK_CHANGES.forEach(change => { - showTooltipForCircleInSeries("#88BF4D"); - if (change === null) { - testTooltipExcludesText("Compared to preivous"); - return; - } - testPairedTooltipValues("Compared to previous week", change); + describe( + "> percent change across daylight savings time change", + { tags: "@flaky" }, + () => { + const SUM_OF_TOTAL_APRIL = { + name: "Q1", + query: { + "source-table": ORDERS_ID, + aggregation: [["sum", ["field", ORDERS.TOTAL, null]]], + breakout: [ + ["field", ORDERS.CREATED_AT, { "temporal-unit": "month" }], + ], + filter: [ + "between", + ["field", 39, { "base-type": "type/DateTime" }], + "2024-01-01", + "2024-05-30", + ], + }, + display: "line", + }; + + const APRIL_CHANGES = [null, "-10.89%", "+11.1%", "-2.89%"]; + + const SUM_OF_TOTAL_DST_WEEK = { + name: "Q1", + query: { + "source-table": ORDERS_ID, + aggregation: [["sum", ["field", ORDERS.TOTAL, null]]], + breakout: [["field", ORDERS.CREATED_AT, { "temporal-unit": "week" }]], + filter: [ + "between", + ["field", 39, { "base-type": "type/DateTime" }], + "2024-03-01", + "2024-03-31", + ], + }, + display: "line", + }; + + const DST_WEEK_CHANGES = [null, "+191.48%", "+4.76%", "-2.36%"]; + + const SUM_OF_TOTAL_DST_DAY = { + name: "Q1", + query: { + "source-table": ORDERS_ID, + aggregation: [["sum", ["field", ORDERS.TOTAL, null]]], + breakout: [["field", ORDERS.CREATED_AT, { "temporal-unit": "day" }]], + filter: [ + "between", + ["field", 39, { "base-type": "type/DateTime" }], + "2024-03-09", + "2024-03-12", + ], + }, + display: "line", + }; + + const DST_DAY_CHANGES = [null, "+27.5%", "-26.16%"]; + + it("should not omit percent change on April", () => { + setup({ question: SUM_OF_TOTAL_APRIL }).then(dashboardId => { + visitDashboard(dashboardId); + }); + + APRIL_CHANGES.forEach(change => { + showTooltipForCircleInSeries("#88BF4D"); + if (change === null) { + testTooltipExcludesText("Compared to preivous"); + return; + } + testPairedTooltipValues("Compared to previous month", change); + }); }); - }); - it("should not omit percent change the day after DST begins", () => { - setup({ question: SUM_OF_TOTAL_DST_DAY }).then(dashboardId => { - visitDashboard(dashboardId); + it("should not omit percent change the week after DST begins", () => { + setup({ question: SUM_OF_TOTAL_DST_WEEK }).then(dashboardId => { + visitDashboard(dashboardId); + }); + + DST_WEEK_CHANGES.forEach(change => { + showTooltipForCircleInSeries("#88BF4D"); + if (change === null) { + testTooltipExcludesText("Compared to preivous"); + return; + } + testPairedTooltipValues("Compared to previous week", change); + }); }); - DST_DAY_CHANGES.forEach(change => { - showTooltipForCircleInSeries("#88BF4D"); - if (change === null) { - testTooltipExcludesText("Compared to preivous"); - return; - } - testPairedTooltipValues("Compared to previous day", change); + it("should not omit percent change the day after DST begins", () => { + setup({ question: SUM_OF_TOTAL_DST_DAY }).then(dashboardId => { + visitDashboard(dashboardId); + }); + + DST_DAY_CHANGES.forEach(change => { + showTooltipForCircleInSeries("#88BF4D"); + if (change === null) { + testTooltipExcludesText("Compared to preivous"); + return; + } + testPairedTooltipValues("Compared to previous day", change); + }); }); - }); - }); + }, + ); }); function setup({ question, addedSeriesQuestion }) {