Skip to content

Commit 21c99a1

Browse files
committed
attempt setting timeout on expect global
1 parent c09115f commit 21c99a1

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/reactpy/testing/display.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from types import TracebackType
66
from typing import Any
77

8-
from playwright.async_api import Browser, Page, async_playwright
8+
from playwright.async_api import Browser, Page, async_playwright, expect
99

1010
from reactpy.config import REACTPY_TESTS_DEFAULT_TIMEOUT
1111
from reactpy.testing.backend import BackendFixture
@@ -62,6 +62,8 @@ async def __aenter__(self) -> DisplayFixture:
6262
or os.environ.get("PLAYWRIGHT_HEADLESS") == "1"
6363
or GITHUB_ACTIONS
6464
)
65+
66+
expect.set_options(timeout=self.timeout * 1000)
6567
await self.configure_page()
6668

6769
if not hasattr(self, "backend"): # nocov
@@ -75,8 +77,6 @@ async def configure_page(self) -> None:
7577
self.page = await self.browser.new_page()
7678
self.page.set_default_navigation_timeout(self.timeout * 1000)
7779
self.page.set_default_timeout(self.timeout * 1000)
78-
self.page.context.set_default_navigation_timeout(self.timeout * 1000)
79-
self.page.context.set_default_timeout(self.timeout * 1000)
8080
self.page.on("console", lambda msg: print(f"BROWSER CONSOLE: {msg.text}")) # noqa: T201
8181
self.page.on("pageerror", lambda exc: print(f"BROWSER ERROR: {exc}")) # noqa: T201
8282

0 commit comments

Comments
 (0)