Skip to content
Snippets Groups Projects
Unverified Commit 7634fad6 authored by Nicolò Pretto's avatar Nicolò Pretto Committed by GitHub
Browse files

remove `@flaky` tag for a test that is not failing anymore (#37859)

parent f774267f
Branches
Tags
No related merge requests found
......@@ -137,111 +137,107 @@ describe("scenarios > embedding > smoke tests", { tags: "@OSS" }, () => {
dashboard: ORDERS_DASHBOARD_ID,
};
["question", "dashboard"].forEach(object => {
it(
`should be able to publish/embed and then unpublish a ${object} without filters`,
{ tags: "@flaky" },
() => {
const embeddableObject = object === "question" ? "card" : "dashboard";
const objectName =
object === "question" ? "Orders" : "Orders in a dashboard";
cy.intercept("PUT", `/api/${embeddableObject}/${ids[object]}`).as(
"embedObject",
);
cy.intercept("GET", `/api/${embeddableObject}/embeddable`).as(
"currentlyEmbeddedObject",
);
it(`should be able to publish/embed and then unpublish a ${object} without filters`, () => {
const embeddableObject = object === "question" ? "card" : "dashboard";
const objectName =
object === "question" ? "Orders" : "Orders in a dashboard";
visitAndEnableSharing(object);
cy.intercept("PUT", `/api/${embeddableObject}/${ids[object]}`).as(
"embedObject",
);
cy.intercept("GET", `/api/${embeddableObject}/embeddable`).as(
"currentlyEmbeddedObject",
);
modal().within(() => {
cy.findByRole("tab", { name: "Appearance" }).click();
visitAndEnableSharing(object);
cy.findByText("Background");
cy.findByText("Dashboard title");
cy.findByText("Border");
cy.findByText(
(_, element) =>
element.textContent ===
"You can change the font with a paid plan.",
);
cy.findByText("Download data").should("not.exist");
modal().within(() => {
cy.findByRole("tab", { name: "Appearance" }).click();
cy.findByRole("tab", { name: "Parameters" }).click();
cy.findByText("Background");
cy.findByText("Dashboard title");
cy.findByText("Border");
cy.findByText(
(_, element) =>
element.textContent ===
"You can change the font with a paid plan.",
);
cy.findByText("Download data").should("not.exist");
cy.findByText(
`This ${object} doesn't have any parameters to configure yet.`,
);
cy.findByRole("tab", { name: "Parameters" }).click();
cy.findByText(
`You will need to publish this ${object} before you can embed it in another application.`,
);
cy.findByText(
`This ${object} doesn't have any parameters to configure yet.`,
);
cy.button("Publish changes").click();
cy.findByText(
`You will need to publish this ${object} before you can embed it in another application.`,
);
cy.wait("@embedObject");
});
cy.button("Publish changes").click();
visitIframe();
cy.wait("@embedObject");
});
cy.findByTestId("embed-frame").within(() => {
cy.findByRole("heading", { name: objectName });
cy.get(".cellData").contains("37.65");
});
visitIframe();
cy.findByRole("contentinfo").within(() => {
cy.findByRole("link")
.should("have.text", "Powered by Metabase")
.and("have.attr", "href")
.and("eq", "https://metabase.com/");
});
cy.findByTestId("embed-frame").within(() => {
cy.findByRole("heading", { name: objectName });
cy.get(".cellData").contains("37.65");
});
cy.log(
`Make sure the ${object} shows up in the standalone embeds page`,
);
cy.signInAsAdmin();
cy.visit(standalonePath);
cy.wait("@currentlyEmbeddedObject");
cy.findByRole("contentinfo").within(() => {
cy.findByRole("link")
.should("have.text", "Powered by Metabase")
.and("have.attr", "href")
.and("eq", "https://metabase.com/");
});
const sectionTestId = {
dashboard: "-embedded-dashboards-setting",
question: "-embedded-questions-setting",
}[object];
cy.log(
`Make sure the ${object} shows up in the standalone embeds page`,
);
cy.signInAsAdmin();
cy.visit(standalonePath);
cy.wait("@currentlyEmbeddedObject");
cy.findByTestId(sectionTestId)
.find("tbody tr")
.should("have.length", 1)
.and("contain", objectName);
const sectionTestId = {
dashboard: "-embedded-dashboards-setting",
question: "-embedded-questions-setting",
}[object];
cy.log(`Unpublish ${object}`);
visitAndEnableSharing(object);
cy.findByTestId(sectionTestId)
.find("tbody tr")
.should("have.length", 1)
.and("contain", objectName);
modal().within(() => {
cy.findByText(
`This ${object} is published and ready to be embedded.`,
);
cy.button("Unpublish").click();
cy.log(`Unpublish ${object}`);
visitAndEnableSharing(object);
cy.wait("@embedObject");
modal().within(() => {
cy.findByText(
`This ${object} is published and ready to be embedded.`,
);
cy.button("Unpublish").click();
cy.findByRole("tab", { name: "Parameters" }).click();
});
cy.wait("@embedObject");
visitIframe();
cy.findByRole("tab", { name: "Parameters" }).click();
});
cy.findByTestId("embed-frame").findByText(
"Embedding is not enabled for this object.",
);
visitIframe();
cy.signInAsAdmin();
cy.visit(standalonePath);
cy.wait("@currentlyEmbeddedObject");
cy.findByTestId("embed-frame").findByText(
"Embedding is not enabled for this object.",
);
mainPage()
.findAllByText(/No (questions|dashboards) have been embedded yet./)
.should("have.length", 2);
},
);
cy.signInAsAdmin();
cy.visit(standalonePath);
cy.wait("@currentlyEmbeddedObject");
mainPage()
.findAllByText(/No (questions|dashboards) have been embedded yet./)
.should("have.length", 2);
});
});
it("should regenerate embedding token and invalidate previous embed url", () => {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment