diff --git a/pyproject.toml b/pyproject.toml index 1622645..c275be7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -23,7 +23,7 @@ readme = "README.md" requires-python = ">=3.11" dependencies = [ - "widgetastic.core>=2.0.0a2", + "widgetastic.core>=2.0.0", # 2.x.x supports Playwright (1.x.x supports Selenium) ] [project.optional-dependencies] diff --git a/testing/conftest.py b/testing/conftest.py index 33f33e2..a8133a5 100644 --- a/testing/conftest.py +++ b/testing/conftest.py @@ -94,7 +94,7 @@ def browser_context(playwright_browser_instance: PlaywrightBrowser) -> BrowserCo context.close() -@pytest.fixture(scope="session") +@pytest.fixture(scope="module") def page(browser_context: BrowserContext) -> Iterator[Page]: """Creates the initial page within the session context.""" page = browser_context.new_page() @@ -105,7 +105,8 @@ def page(browser_context: BrowserContext) -> Iterator[Page]: @pytest.fixture(scope="module") def browser(page: Page, pf_version: str, request): testing_page_url = urljoin(TESTING_PAGES.get(pf_version), request.module.TESTING_PAGE_COMPONENT) - page.goto(testing_page_url) + page.goto(testing_page_url, wait_until="networkidle") + page.wait_for_load_state("domcontentloaded") print(f"Testing page: {testing_page_url}") browser = Browser(page) if browser.elements(".//button[@aria-label='Close banner']"):