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

[E2E] Fix flakes in repro for 22227 (#23416)

* Fix flakes in repro for 22227

* Remove redundant intercepts

* Use `cy.button` selector

* Remove ALL redundant intercepts
parent fe73a2f3
No related branches found
No related tags found
No related merge requests found
......@@ -79,8 +79,6 @@ describe("scenarios > question > relative-datetime", () => {
cy.findByTextEnsureVisible("Created At").click();
cy.intercept("POST", "/api/dataset").as("dataset");
popover().within(() => {
cy.findByText("Filter by this column").click();
cy.icon("chevronleft").should("not.exist");
......@@ -150,7 +148,6 @@ describe("scenarios > question > relative-datetime", () => {
it("current filters should work (metabase#21977)", () => {
openOrdersTable();
cy.intercept("POST", "/api/dataset").as("dataset");
cy.findByTextEnsureVisible("Created At").click();
popover().within(() => {
cy.findByText("Filter by this column").click();
......@@ -215,23 +212,21 @@ describe("scenarios > question > relative-datetime", () => {
it("should allow changing values with starting from (metabase#22227)", () => {
openOrdersTable();
cy.intercept("POST", "/api/dataset").as("dataset");
openCreatedAt("Past");
addStartingFrom();
setRelativeDatetimeUnit("months");
setRelativeDatetimeValue(1);
popover().within(() => {
cy.findByText("Add filter").click();
cy.button("Add filter").click();
});
cy.wait("@dataset");
cy.intercept("POST", "/api/dataset").as("dataset");
cy.findByTextEnsureVisible(
"Created At Previous Month, starting 7 months ago",
).click();
setRelativeDatetimeValue(3);
popover().within(() => {
cy.findByText("Update filter").click();
cy.button("Update filter").click();
});
cy.wait("@dataset");
......@@ -240,9 +235,10 @@ describe("scenarios > question > relative-datetime", () => {
).click();
setStartingFromValue(30);
popover().within(() => {
cy.findByText("Update filter").click();
cy.button("Update filter").click();
});
cy.wait("@dataset");
cy.findByTextEnsureVisible(
"Created At Previous 3 Months, starting 30 months ago",
);
......@@ -251,8 +247,6 @@ describe("scenarios > question > relative-datetime", () => {
it("starting from option should set correct sign (metabase#22228)", () => {
openOrdersTable();
cy.intercept("POST", "/api/dataset").as("dataset");
openCreatedAt("Next");
addStartingFrom();
popover().within(() => {
......@@ -318,9 +312,9 @@ const setRelativeDatetimeUnit = unit => {
};
const setRelativeDatetimeValue = value => {
cy.findAllByTestId("relative-datetime-value")
cy.findByTestId("relative-datetime-value")
.click()
.clear()
.clear() // Included twice because it's buggy sometimes
.type(value)
.blur();
};
......@@ -333,9 +327,9 @@ const setStartingFromUnit = unit => {
};
const setStartingFromValue = value => {
cy.findAllByTestId("starting-from-value")
cy.findByTestId("starting-from-value")
.click()
.clear()
.clear() // Included twice because it's buggy sometimes
.type(value)
.blur();
};
......
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