Skip to content
Snippets Groups Projects
Unverified Commit 7aa32fdc authored by Roman Abdulmanov's avatar Roman Abdulmanov Committed by GitHub
Browse files

Fix for the flaky X-Ray test (#31849)

parent 5bb14a42
No related branches found
No related tags found
No related merge requests found
......@@ -5,6 +5,7 @@ import {
summarize,
visualize,
startNewQuestion,
main,
} from "e2e/support/helpers";
import { SAMPLE_DB_ID } from "e2e/support/cypress_data";
......@@ -19,7 +20,7 @@ describe("scenarios > x-rays", () => {
cy.signInAsAdmin();
});
const XRAY_DATASETS = 11; // enough to load most questions
const XRAY_DATASETS = 5; // enough to load most questions
it("should not display x-rays if the feature is disabled in admin settings (metabase#26571)", () => {
cy.request("PUT", "api/setting/enable-xrays", { value: false });
......@@ -92,10 +93,7 @@ describe("scenarios > x-rays", () => {
});
["X-ray", "Compare to the rest"].forEach(action => {
// Temporarily skipping this due to degraded performance causing the test to fail, blocking all merges to master.
// We're actively investigating whether Github's runners or our code is responsible. See discussion at:
// https://metaboat.slack.com/archives/C5XHN8GLW/p1685964332028149
it.skip(`"${action.toUpperCase()}" should work on a nested question made from base native question (metabase#15655)`, () => {
it(`"${action.toUpperCase()}" should work on a nested question made from base native question (metabase#15655)`, () => {
cy.intercept("GET", "/api/automagic-dashboards/**").as("xray");
cy.createNativeQuestion({
......@@ -122,17 +120,19 @@ describe("scenarios > x-rays", () => {
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
cy.findByText(action).click();
for (let c = 0; c < XRAY_DATASETS; ++c) {
cy.wait("@postDataset");
}
cy.wait("@xray").then(xhr => {
for (let c = 0; c < XRAY_DATASETS; ++c) {
cy.wait("@postDataset");
}
expect(xhr.response.body.cause).not.to.exist;
expect(xhr.response.statusCode).not.to.eq(500);
});
cy.findByTextEnsureVisible("A look at the number of 15655");
main().within(() => {
cy.findByText("A look at the number of 15655").should("exist");
});
cy.findByRole("heading", { name: /^A look at the number of/ });
cy.get(".DashCard");
});
......
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