From 5b31add62fe914c3c410a12c76fdf98fc4ede568 Mon Sep 17 00:00:00 2001 From: Martin Pitt Date: Tue, 23 Jul 2024 08:35:18 +0200 Subject: [PATCH] Robustify interactive browser Too small window sizes make the test unstable. Now it works reliably in a loop. --- bidi.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bidi.py b/bidi.py index eb3d1f2..3295c4b 100755 --- a/bidi.py +++ b/bidi.py @@ -116,6 +116,9 @@ class WebdriverBidi: else: raise WebdriverError("timed out waiting for default realm") + # avoid not seeing elements due to too small window + await self.bidi("browsingContext.setViewport", context=self.context, viewport={"width": 1024, "height": 5000}) + async def __aenter__(self): await self.start_session() return self