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

Fix flaky E2E segments test (#44487)

parent 105a72a0
No related branches found
No related tags found
No related merge requests found
...@@ -23,7 +23,7 @@ import { ...@@ -23,7 +23,7 @@ import {
summarize, summarize,
modal, modal,
filter, filter,
filterField, saveQuestion,
visitQuestion, visitQuestion,
} from "e2e/support/helpers"; } from "e2e/support/helpers";
import { createSegment } from "e2e/support/helpers/e2e-table-metadata-helpers"; import { createSegment } from "e2e/support/helpers/e2e-table-metadata-helpers";
...@@ -749,50 +749,36 @@ describe("scenarios > admin > datamodel > segments", () => { ...@@ -749,50 +749,36 @@ describe("scenarios > admin > datamodel > segments", () => {
cy.findByText("Preview"); cy.findByText("Preview");
}); });
it("should show no questions based on a new segment", () => { it("should see a newly asked question in its questions list", () => {
cy.intercept("GET", "/api/table/*/query_metadata*").as("metadata");
// Ask question
cy.visit("/reference/segments/1/questions"); cy.visit("/reference/segments/1/questions");
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage cy.wait(["@metadata", "@metadata", "@metadata"]);
cy.findByText(`Questions about ${SEGMENT_NAME}`);
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
cy.findByText(
"Questions about this segment will appear here as they're added",
);
});
it( cy.get("main").should("contain", `Questions about ${SEGMENT_NAME}`);
"should see a newly asked question in its questions list", cy.findByRole("status")
{ tags: "@flaky" }, .as("emptyStateMessage")
() => { .should(
// Ask question "have.text",
cy.visit("/reference/segments/1/questions");
cy.button("Ask a question").click();
cy.findAllByText("37.65");
filter();
filterField("Product ID", {
value: "14",
});
cy.findByTestId("apply-filters").click();
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
cy.findByText("Product ID is 14");
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
cy.findByText("Save").click();
cy.findAllByText("Save").last().click();
// Check list
cy.visit("/reference/segments/1/questions");
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
cy.findByText(
"Questions about this segment will appear here as they're added", "Questions about this segment will appear here as they're added",
).should("not.exist");
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
cy.findByText(
`Orders, Filtered by ${SEGMENT_NAME} and Product ID is 14`,
); );
},
); cy.button("Ask a question").click();
cy.findByTestId("filter-pill").should("have.text", "Orders < 100");
cy.findAllByTestId("cell-data").should("contain", "37.65");
summarize();
cy.findAllByTestId("sidebar-right").button("Done").click();
cy.findByTestId("scalar-value").should("have.text", "13,005");
saveQuestion("Foo");
// Check list
cy.visit("/reference/segments/1/questions");
cy.wait(["@metadata", "@metadata", "@metadata"]);
cy.get("@emptyStateMessage").should("not.exist");
cy.findByRole("heading", { name: "Foo" }).should("be.visible");
});
it("should update that segment", () => { it("should update that segment", () => {
cy.visit("/admin"); cy.visit("/admin");
......
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