Skip to content
Snippets Groups Projects
Unverified Commit b53a898e authored by Uladzimir Havenchyk's avatar Uladzimir Havenchyk Committed by GitHub
Browse files

ci: move flaky specs to jail (#46715)

parent bcd1a90c
No related branches found
No related tags found
No related merge requests found
......@@ -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" },
......
......@@ -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);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment