Skip to content
Snippets Groups Projects
Unverified Commit 71b74907 authored by Nemanja Glumac's avatar Nemanja Glumac Committed by GitHub
Browse files

[E2E] Fix public dashboard flake (#32343)

* Fix `public-dashboard` E2E flake

Closes #32334.
parent e8f666f5
Branches
Tags
No related merge requests found
......@@ -102,14 +102,23 @@ describe("scenarios > public > dashboard", () => {
.findByRole("switch")
.check();
cy.wait("@publicLink");
cy.findByRole("heading", { name: "Public link" })
.parent()
.findByDisplayValue(/^http/)
.then($input => {
expect($input.val()).to.match(PUBLIC_DASHBOARD_REGEX);
});
cy.wait("@publicLink").then(({ response }) => {
expect(response.body.uuid).not.to.be.null;
cy.findByRole("heading", { name: "Public link" })
// This click doesn't have any meaning in the context of the correctness of this test!
// It's simply here to prevent test flakiness, which happens because the Modal overlay
// is animating (disappearing) and we need to wait for it to stop the transition.
// Cypress will retry clicking this text until the DOM element is "actionable", or in
// our case - until there's no element on top of it blocking it. That's also when we
// expect this input field to be populated with the actual value.
.click()
.parent()
.findByDisplayValue(/^http/)
.then($input => {
expect($input.val()).to.match(PUBLIC_DASHBOARD_REGEX);
});
});
});
Object.entries(USERS).map(([userType, setUser]) =>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment