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

Fix public link E2E flakes (#35616)

* Fix flake for repro 20393

* Fix flake for repro 22524

[ci skip]
parent 2900a03f
No related branches found
No related tags found
No related merge requests found
...@@ -2,6 +2,8 @@ import { restore, popover, visitDashboard } from "e2e/support/helpers"; ...@@ -2,6 +2,8 @@ import { restore, popover, visitDashboard } from "e2e/support/helpers";
describe("issue 20393", () => { describe("issue 20393", () => {
beforeEach(() => { beforeEach(() => {
cy.intercept("POST", "/api/dashboard/*/public_link").as("publicLink");
restore(); restore();
cy.signInAsAdmin(); cy.signInAsAdmin();
}); });
...@@ -28,14 +30,12 @@ describe("issue 20393", () => { ...@@ -28,14 +30,12 @@ describe("issue 20393", () => {
cy.findByRole("switch").click(); cy.findByRole("switch").click();
// navigate to the public dashboard link // navigate to the public dashboard link
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage cy.wait("@publicLink").then(({ response: { body } }) => {
cy.findByText("Public link") const { uuid } = body;
.parent()
.within(() => { cy.signOut();
cy.get("input").then(input => { cy.visit(`/public/dashboard/${uuid}`);
cy.visit(input.val()); });
});
});
// verify that the card is visible on the page // verify that the card is visible on the page
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage // eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
......
...@@ -31,6 +31,9 @@ describe("issue 22524", () => { ...@@ -31,6 +31,9 @@ describe("issue 22524", () => {
it("update dashboard cards when changing parameters on publicly shared dashboards (metabase#22524)", () => { it("update dashboard cards when changing parameters on publicly shared dashboards (metabase#22524)", () => {
cy.createNativeQuestionAndDashboard({ questionDetails }).then( cy.createNativeQuestionAndDashboard({ questionDetails }).then(
({ body: { dashboard_id } }) => { ({ body: { dashboard_id } }) => {
cy.intercept("POST", `/api/dashboard/${dashboard_id}/public_link`).as(
"publicLink",
);
visitDashboard(dashboard_id); visitDashboard(dashboard_id);
}, },
); );
...@@ -48,14 +51,12 @@ describe("issue 22524", () => { ...@@ -48,14 +51,12 @@ describe("issue 22524", () => {
cy.icon("share").click(); cy.icon("share").click();
cy.findByRole("switch").click(); cy.findByRole("switch").click();
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage cy.wait("@publicLink").then(({ response: { body } }) => {
cy.findByText("Public link") const { uuid } = body;
.parent()
.within(() => { cy.signOut();
cy.get("input").then(input => { cy.visit(`/public/dashboard/${uuid}`);
cy.visit(input.val()); });
});
});
// Set parameter value // Set parameter value
cy.findByPlaceholderText("Text").clear().type("Rye{enter}"); cy.findByPlaceholderText("Text").clear().type("Rye{enter}");
......
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