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

Fix 18061 flake by obtaining `uuid` from the xhr response (#18713)

parent e0765149
No related branches found
No related tags found
No related merge requests found
......@@ -63,6 +63,19 @@ describe("issue 18061", () => {
({ body: dashboardCard }) => {
const { dashboard_id, card_id } = dashboardCard;
// Enable sharing
cy.request("POST", `/api/dashboard/${dashboard_id}/public_link`).then(
({ body: { uuid } }) => {
cy.wrap(`/public/dashboard/${uuid}`).as("publicLink");
},
);
cy.wrap(`/question/${card_id}`).as(`questionUrl`);
cy.wrap(`/dashboard/${dashboard_id}`).as(`dashboardUrl`);
cy.intercept("POST", `/api/card/${card_id}/query`).as("cardQuery");
cy.intercept("GET", `/api/card/${card_id}`).as("getCard");
const mapFilterToCard = {
parameter_mappings: [
{
......@@ -74,18 +87,6 @@ describe("issue 18061", () => {
};
cy.editDashboardCard(dashboardCard, mapFilterToCard);
cy.wrap(`/question/${card_id}`).as(`questionUrl`);
cy.wrap(`/dashboard/${dashboard_id}`).as(`dashboardUrl`);
cy.intercept("POST", `/api/card/${card_id}/query`).as("cardQuery");
cy.intercept("GET", `/api/card/${card_id}`).as("getCard");
// Enable sharing
cy.request("POST", `/api/dashboard/${dashboard_id}/public_link`);
cy.request("PUT", "/api/setting/enable-public-sharing", {
value: true,
});
},
);
});
......@@ -137,19 +138,7 @@ describe("issue 18061", () => {
context("scenario 3: publicly shared dashboard with a filter", () => {
it("should handle data sets that contain only null values for longitude/latitude (metabase#18061-3)", () => {
visitAlias("@dashboardUrl");
cy.wait("@cardQuery");
cy.icon("share").click();
cy.findByText("Sharing and embedding").click();
cy.findByText("Public link")
.parent()
.find("input")
.invoke("val")
.then($value => {
cy.visit($value);
});
visitAlias("@publicLink");
cy.get(".PinMap");
......
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