Skip to content

Commit 5dcde54

Browse files
MatteoStifanoJenkins
authored andcommitted
edit_dashboard: Wait for page reload before asserting dashboard deletion
This avoid flakes during teardown. Change-Id: I3a9ed1868a71d2e6a300d02a2ba4040c74578bf0
1 parent 64e35e8 commit 5dcde54

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

tests/gui_e2e/testlib/playwright/pom/customize/edit_dashboard.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,12 @@ def delete_dashboard(self, dashboard_name: str) -> None:
108108
custom_dashboard_row = self.main_area.locator("tr", has=custom_dashboard_link)
109109
custom_dashboard_row.get_by_role("link", name="Delete").click()
110110
self.main_area.get_confirmation_popup_button("Delete").click()
111+
# Deletion triggers a server-side redirect back to this page before the
112+
# success message is rendered; wait for that reload to settle so the
113+
# assertion below isn't racing the navigation.
114+
self.page.wait_for_url(url=re.compile("edit_dashboards.py"), wait_until="load")
111115

112116
expect(
113117
self.main_area.locator("div.success"),
114-
message=f"Dashboard '{self.page_title}' is not deleted",
118+
message=f"Dashboard '{dashboard_name}' is not deleted",
115119
).to_have_text("Your dashboard has been deleted.")

0 commit comments

Comments
 (0)