Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🤖 backported "Fix flaky dashboard repro tests (issue 39863)" #42097

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { SAMPLE_DATABASE } from "e2e/support/cypress_sample_database";
import { ORDERS_QUESTION_ID } from "e2e/support/cypress_sample_instance_data";
import {
createDashboardWithTabs,
dashboardGrid,
goToTab,
popover,
restore,
Expand Down Expand Up @@ -213,31 +214,37 @@ describe("issue 39863", () => {
}).then(dashboard => visitDashboard(dashboard.id));

// Initial query for 1st tab
cy.wait("@dashcardQuery");
assertNoLoadingSpinners();
cy.get("@dashcardQuery.all").should("have.length", 1);

// Initial query for 2nd tab
goToTab(TAB_2.name);
cy.wait("@dashcardQuery");
assertNoLoadingSpinners();
cy.get("@dashcardQuery.all").should("have.length", 2);

// No parameters change, no query rerun
goToTab(TAB_1.name);
cy.wait("@dashcardQuery");
assertNoLoadingSpinners();
cy.get("@dashcardQuery.all").should("have.length", 2);

// Rerun 1st tab query with new parameters
setDateFilter();
cy.wait("@dashcardQuery");
assertNoLoadingSpinners();
cy.get("@dashcardQuery.all").should("have.length", 3);

// Rerun 2nd tab query with new parameters
goToTab(TAB_2.name);
cy.wait("@dashcardQuery");
assertNoLoadingSpinners();
cy.get("@dashcardQuery.all").should("have.length", 4);

// No parameters change, no query rerun
goToTab(TAB_1.name);
goToTab(TAB_2.name);
assertNoLoadingSpinners();
cy.get("@dashcardQuery.all").should("have.length", 4);
});

Expand Down Expand Up @@ -270,31 +277,37 @@ describe("issue 39863", () => {
}).then(dashboard => visitDashboard(dashboard.id));

// Initial query for 1st tab
cy.wait("@dashcardQuery");
assertNoLoadingSpinners();
cy.get("@dashcardQuery.all").should("have.length", 1);

// Initial query for 2nd tab
goToTab(TAB_2.name);
cy.wait("@dashcardQuery");
assertNoLoadingSpinners();
cy.get("@dashcardQuery.all").should("have.length", 2);

// No parameters change, no query rerun
goToTab(TAB_1.name);
cy.wait("@dashcardQuery");
assertNoLoadingSpinners();
cy.get("@dashcardQuery.all").should("have.length", 2);

// Rerun 1st tab query with new parameters
setDateFilter();
cy.wait("@dashcardQuery");
assertNoLoadingSpinners();
cy.get("@dashcardQuery.all").should("have.length", 3);

// Rerun 2nd tab query with new parameters
goToTab(TAB_2.name);
cy.wait("@dashcardQuery");
assertNoLoadingSpinners();
cy.get("@dashcardQuery.all").should("have.length", 4);

// No parameters change, no query rerun
goToTab(TAB_1.name);
goToTab(TAB_2.name);
assertNoLoadingSpinners();
cy.get("@dashcardQuery.all").should("have.length", 4);
});
});
Expand All @@ -305,3 +318,7 @@ function setDateFilter() {
.findByText(/Last 12 months/i)
.click();
}

function assertNoLoadingSpinners() {
dashboardGrid().findAllByTestId("loading-spinner").should("have.length", 0);
}