Skip to content

The easy-to-use open source Business Intelligence and Embedded Analytics tool that lets everyone work with data :bar_chart:

Fix the flaky "trash" e2e test (#76634)

Nemanja Glumacccfc78c97aa5
diff --git a/e2e/test/scenarios/collections/trash.cy.spec.js b/e2e/test/scenarios/collections/trash.cy.spec.js
index 0e91e2cbb5a..18b124bc1e6 100644
--- a/e2e/test/scenarios/collections/trash.cy.spec.js
+++ b/e2e/test/scenarios/collections/trash.cy.spec.js
@@ -757,7 +757,6 @@ describe("scenarios > collections > trash", () => {
cy.intercept("GET", `/api/dashboard/${dashboard.id}*`).as("getDashboard");
H.visitDashboard(dashboard.id);
cy.wait("@getDashboard");
- H.openNavigationSidebar();
assertTrashSelectedInNavigationSidebar();
});
@@ -769,7 +768,6 @@ describe("scenarios > collections > trash", () => {
);
H.visitQuestion(question.id);
cy.wait("@getQuestionResult");
- H.openNavigationSidebar();
assertTrashSelectedInNavigationSidebar();
});
});
@@ -994,6 +992,10 @@ function assertChecked(name, checked = true) {
}
function assertTrashSelectedInNavigationSidebar() {
+ // Routes like a dashboard or question collapse the navbar, so ensure it's
+ // open before asserting. openNavigationSidebar is idempotent and self-heals
+ // against a pending collapse, so it's safe to call unconditionally here.
+ H.openNavigationSidebar();
H.navigationSidebar().within(() => {
cy.findByText("Trash")
.parents("li")