Skip to content

base

django_spire.testing.playwright.pages.base

BasePage

Source code in django_spire/testing/playwright/pages/base.py
def __init__(self, page: Page, base_url: str) -> None:
    self.base_url = base_url
    self.page = page

base_url = base_url instance-attribute

page = page instance-attribute

goto

Source code in django_spire/testing/playwright/pages/base.py
def goto(self, url: str) -> None:
    self.page.goto(url)

has_text

Source code in django_spire/testing/playwright/pages/base.py
def has_text(self, text: str) -> bool:
    return text in self.page.locator('body').inner_text()

wait_for_load_state

Source code in django_spire/testing/playwright/pages/base.py
def wait_for_load_state(self, state: str = 'networkidle') -> None:
    self.page.wait_for_load_state(state)

wait_for_timeout

Source code in django_spire/testing/playwright/pages/base.py
def wait_for_timeout(self, timeout: int) -> None:
    self.page.wait_for_timeout(timeout)