Skip to content

Commit

Permalink
test: Robustify Browser.assert_no_oops
Browse files Browse the repository at this point in the history
Webdriver's script preloading doesn't happen for empty frames. So our
test-functions.js isn't available in tests which never navigate to a
page, such as TestConnection.

Do the first check with a direct `getElementById()` instead of relying
on our page helpers.
  • Loading branch information
martinpitt committed Aug 2, 2024
1 parent 9150172 commit 295eb26
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test/common/testlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -1366,7 +1366,7 @@ def assert_no_oops(self) -> None:

if self.cdp and self.cdp.valid:
self.switch_to_top()
if self.is_present("#navbar-oops"):
if self.eval_js("document.getElementById('navbar-oops')"):
assert not self.is_visible("#navbar-oops"), "Cockpit shows an Oops"


Expand Down

0 comments on commit 295eb26

Please sign in to comment.