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

Fix question E2E flakes (#21085)

* Fix repro 12457 flake

* Fix repro 17397 flake

* Remove redundant tests
parent ebdc3d21
Branches
Tags
No related merge requests found
......@@ -528,20 +528,20 @@ describe("scenarios > question > filter", () => {
// Via the GUI, create a filter with "include-current" option
filter({ mode: "notebook" });
cy.findByText("Created At").click({ force: true });
cy.get("input[type='text']").type("{selectall}{del}5");
cy.contains("Include today").click();
cy.findByText("Add filter").click();
cy.button("Add filter").click();
// Switch to custom expression
cy.findByText("Created At Previous 5 Days").click();
cy.findByText("Created At Previous 30 Days").click();
popover().within(() => {
cy.icon("chevronleft").click();
cy.findByText("Custom Expression").click();
});
cy.findByText("Done").click();
cy.button("Done").click();
// Back to GUI and "Include today" should be still checked
cy.findByText("Created At Previous 5 Days").click();
cy.findByText("Created At Previous 30 Days").click();
cy.findByLabelText("Include today").should("be.checked");
});
......
import {
enterCustomColumnDetails,
getNotebookStep,
interceptPromise,
modal,
openOrdersTable,
openProductsTable,
......@@ -153,7 +152,20 @@ describe("scenarios > question > notebook", () => {
});
it("should show the real number of rows instead of HARD_ROW_LIMIT when loading (metabase#17397)", () => {
const req = interceptPromise("POST", "/api/dataset");
cy.intercept(
{
method: "POST",
url: "/api/dataset",
middleware: true,
},
req => {
req.on("response", res => {
// Throttle the response to 500 Kbps to simulate a mobile 3G connection
res.setThrottle(500);
});
},
).as("dataset");
const questionDetails = {
query: {
"source-table": ORDERS_ID,
......@@ -173,9 +185,10 @@ describe("scenarios > question > notebook", () => {
.type("3{enter}");
cy.findByText("Product ID is 2 selections");
// Still loading
cy.contains("Showing 98 rows");
req.resolve();
cy.wait("@dataset");
cy.contains("Showing 175 rows");
});
......
......@@ -2,9 +2,6 @@ import {
restore,
openOrdersTable,
popover,
getAddDimensionButton,
summarize,
sidebar,
filter,
} from "__support__/e2e/cypress";
import { SAMPLE_DATABASE } from "__support__/e2e/cypress_sample_database";
......@@ -17,51 +14,6 @@ describe("scenarios > question > view", () => {
cy.signInAsAdmin();
});
describe("summarize sidebar", () => {
it("should summarize by category and show a bar chart", () => {
openOrdersTable();
summarize();
cy.contains("Category").click();
cy.contains("Done").click();
cy.contains("Count by Product → Category");
});
it("should show orders by year and product category", () => {
openOrdersTable();
summarize();
sidebar()
.contains("Created At")
.click();
cy.findByText("Done").click();
cy.contains("Count by Created At: Month");
// Go back into sidebar
summarize();
sidebar()
.contains("by month")
.click();
cy.get(".PopoverBody")
.contains("Year")
.click();
cy.contains("Count by Created At: Year");
getAddDimensionButton({ name: "Category" }).click();
cy.contains("Done").click();
// check for title, legend, and x axis labels
cy.contains("Count by Created At: Year and Product → Category");
["2016", "2017", "2018", "2019", "2020"].forEach(l => cy.contains(l));
["Doohickey", "Gadget", "Gizmo", "Widget"].forEach(l => cy.contains(l));
});
});
describe("filter sidebar", () => {
it("should filter a table", () => {
openOrdersTable();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment