Skip to content

Commit

Permalink
test: Prepare for Shell rewrite
Browse files Browse the repository at this point in the history
The new Shell will not render the ".curtains-ct" element at all when
it shouldn't be shown.
  • Loading branch information
mvollmer authored and jelly committed Oct 3, 2024
1 parent d2e1f5d commit 7957a12
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions test/common/testlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -905,18 +905,23 @@ def enter_page(self, path: str, host: str | None = None, reconnect: bool = True)

self.switch_to_top()

def wait_no_curtain() -> None:
# Older shells make the curtain invisible, newer shells
# remove it entirely. Let's cater to both.
self.wait_js_cond('!ph_is_present(".curtains-ct") || !ph_is_visible(".curtains-ct")')

while True:
try:
self._wait_present("iframe.container-frame[name='%s'][data-loaded]" % frame)
self.wait_not_visible(".curtains-ct")
wait_no_curtain()
self.wait_visible("iframe.container-frame[name='%s']" % frame)
break
except Error as ex:
if reconnect and ex.msg.startswith('timeout'):
reconnect = False
if self.is_present("#machine-reconnect"):
self.click("#machine-reconnect")
self.wait_not_visible(".curtains-ct")
wait_no_curtain()
continue
raise

Expand Down

0 comments on commit 7957a12

Please sign in to comment.