From 4467bed37d6ba6ace56b937b500d575313966302 Mon Sep 17 00:00:00 2001 From: rmorshea Date: Sun, 26 Jun 2022 14:59:57 -0700 Subject: [PATCH 1/4] add asgiref dep + set default timeout on page --- requirements/pkg-deps.txt | 1 + src/idom/testing/display.py | 3 +++ 2 files changed, 4 insertions(+) diff --git a/requirements/pkg-deps.txt b/requirements/pkg-deps.txt index 6e970f4c2..f13b33bf9 100644 --- a/requirements/pkg-deps.txt +++ b/requirements/pkg-deps.txt @@ -5,3 +5,4 @@ jsonpatch >=1.32 fastjsonschema >=2.14.5 requests >=2 colorlog >=6 +asgiref >=3 diff --git a/src/idom/testing/display.py b/src/idom/testing/display.py index 30151a7a3..8a8727f99 100644 --- a/src/idom/testing/display.py +++ b/src/idom/testing/display.py @@ -7,6 +7,7 @@ from playwright.async_api import Browser, BrowserContext, Page, async_playwright from idom import html +from idom.config import IDOM_TESTING_DEFAULT_TIMEOUT from idom.types import RootComponentConstructor from .backend import BackendFixture @@ -57,6 +58,8 @@ async def __aenter__(self) -> DisplayFixture: browser = self._browser self.page = await browser.new_page() + self.page.set_default_timeout(IDOM_TESTING_DEFAULT_TIMEOUT * 1000) + if not hasattr(self, "backend"): self.backend = BackendFixture() await es.enter_async_context(self.backend) From 6531be9e6153a358c0c7c4fa3ceb1c6cd27c3815 Mon Sep 17 00:00:00 2001 From: rmorshea Date: Sun, 26 Jun 2022 15:02:15 -0700 Subject: [PATCH 2/4] add changelog entry --- docs/source/about/changelog.rst | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/docs/source/about/changelog.rst b/docs/source/about/changelog.rst index 7fd722c5d..1f9e595c3 100644 --- a/docs/source/about/changelog.rst +++ b/docs/source/about/changelog.rst @@ -23,7 +23,13 @@ more info, see the :ref:`Contributor Guide `. Unreleased ---------- -No changes. +**Added** + +- :pull:`123` - ``asgiref`` as a dependency + +**Changed** + +- :pull:`123` - set default timeout on playwright page for testing v0.39.0 From b7af1554f54bc02cd98775586fb974d7cc8a6db2 Mon Sep 17 00:00:00 2001 From: Ryan Morshead Date: Mon, 27 Jun 2022 12:08:01 -0700 Subject: [PATCH 3/4] Update display.py --- src/idom/testing/display.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/idom/testing/display.py b/src/idom/testing/display.py index 8a8727f99..0715f7a51 100644 --- a/src/idom/testing/display.py +++ b/src/idom/testing/display.py @@ -58,7 +58,7 @@ async def __aenter__(self) -> DisplayFixture: browser = self._browser self.page = await browser.new_page() - self.page.set_default_timeout(IDOM_TESTING_DEFAULT_TIMEOUT * 1000) + self.page.set_default_timeout(IDOM_TESTING_DEFAULT_TIMEOUT.current * 1000) if not hasattr(self, "backend"): self.backend = BackendFixture() From 5c0aa1ce5aaa9d5b846b7f562e1727bad524bb0b Mon Sep 17 00:00:00 2001 From: Ryan Morshead Date: Mon, 27 Jun 2022 12:09:21 -0700 Subject: [PATCH 4/4] Update config.py --- src/idom/config.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/idom/config.py b/src/idom/config.py index a13a2e26f..dec2cb958 100644 --- a/src/idom/config.py +++ b/src/idom/config.py @@ -80,7 +80,8 @@ IDOM_TESTING_DEFAULT_TIMEOUT = _Option( "IDOM_TESTING_DEFAULT_TIMEOUT", - 3.0, + 5.0, mutable=False, validator=float, ) +"""A default timeout for testing utilities in IDOM"""