diff --git a/e2e/test/scenarios/question/column-compare.cy.spec.ts b/e2e/test/scenarios/question/column-compare.cy.spec.ts index 09a75c336c65c2db2caa0e07dd8ad1ee037d5c38..d206fb786c824868fda85bd5c82f7026c70bfdc7 100644 --- a/e2e/test/scenarios/question/column-compare.cy.spec.ts +++ b/e2e/test/scenarios/question/column-compare.cy.spec.ts @@ -400,7 +400,7 @@ describeWithSnowplow("scenarios > question > column compare TODO", () => { ]); }); - it("breakout on non-datetime column", () => { + it("breakout on non-datetime column", { tags: "@flaky" }, () => { createQuestion( { query: QUERY_SINGLE_AGGREGATION_NON_DATETIME_BREAKOUT }, { visitQuestion: true, wrapId: true, idAlias: "questionId" }, diff --git a/e2e/test/scenarios/question/saved.cy.spec.js b/e2e/test/scenarios/question/saved.cy.spec.js index 94d78f70fee9f1dcb901ea6300de61a5589f9809..ca2f73a903519ccf89b10b8d26f7f6a1ac3fa385 100644 --- a/e2e/test/scenarios/question/saved.cy.spec.js +++ b/e2e/test/scenarios/question/saved.cy.spec.js @@ -245,40 +245,44 @@ describe("scenarios > question > saved", () => { }); }); - it("'read-only' user should be able to resize column width (metabase#9772)", () => { - cy.signIn("readonly"); - visitQuestion(ORDERS_QUESTION_ID); - - // eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage - cy.findByText("Tax") - .closest(".test-TableInteractive-headerCellData") - .as("headerCell") - .then($cell => { - const originalWidth = $cell[0].getBoundingClientRect().width; - - // Retries the assertion a few times to ensure it waits for DOM changes - // More context: https://github.com/metabase/metabase/pull/21823#discussion_r855302036 - function assertColumnResized(attempt = 0) { - cy.get("@headerCell").then($newCell => { - const newWidth = $newCell[0].getBoundingClientRect().width; - if (newWidth === originalWidth && attempt < 3) { - cy.wait(100); - assertColumnResized(++attempt); - } else { - expect(newWidth).to.be.gt(originalWidth); - } - }); - } - - cy.wrap($cell) - .find(".react-draggable") - .trigger("mousedown", 0, 0, { force: true }) - .trigger("mousemove", 100, 0, { force: true }) - .trigger("mouseup", 100, 0, { force: true }); - - assertColumnResized(); - }); - }); + it( + "'read-only' user should be able to resize column width (metabase#9772)", + { tags: "@flaky" }, + () => { + cy.signIn("readonly"); + visitQuestion(ORDERS_QUESTION_ID); + + // eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage + cy.findByText("Tax") + .closest(".test-TableInteractive-headerCellData") + .as("headerCell") + .then($cell => { + const originalWidth = $cell[0].getBoundingClientRect().width; + + // Retries the assertion a few times to ensure it waits for DOM changes + // More context: https://github.com/metabase/metabase/pull/21823#discussion_r855302036 + function assertColumnResized(attempt = 0) { + cy.get("@headerCell").then($newCell => { + const newWidth = $newCell[0].getBoundingClientRect().width; + if (newWidth === originalWidth && attempt < 3) { + cy.wait(100); + assertColumnResized(++attempt); + } else { + expect(newWidth).to.be.gt(originalWidth); + } + }); + } + + cy.wrap($cell) + .find(".react-draggable") + .trigger("mousedown", 0, 0, { force: true }) + .trigger("mousemove", 100, 0, { force: true }) + .trigger("mouseup", 100, 0, { force: true }); + + assertColumnResized(); + }); + }, + ); it("should always be possible to view the full title text of the saved question", () => { visitQuestion(ORDERS_QUESTION_ID);