Page Interface

Warning

This is auto-generated interface documentation for the abstract Page class.

This is essential for providing a comprehensive overview of all available methods for the Page object.

For the actual signature, please refer to dyatel.base.page.Page.

The Page class is a fundamental building block for creating Page Object Models (POM) in web testing. It provides a comprehensive set of methods that allow you to interact with web pages.

These methods could be found below.


class dyatel.base.page.Page(*args, **kwargs)

Page object crossroad. Should be defined as class

property driver_wrapper: DriverWrapper

Retrieves the driver wrapper instance.

Returns:

The current DriverWrapper instance that assigned for this object.

Return type:

DriverWrapper

anchor: Element
reload_page(wait_page_load: bool = True) Page

Reload the current page and optionally wait for the page to fully load.

Parameters:

wait_page_load (bool) – If True, waits until the page is fully loaded and an anchor element is visible. Defaults to True.

Returns:

Page - The current instance of the page object.

open_page(url: str = '') Page

Open a page using the given URL, or use the default URL from the page class if no URL is provided.

Parameters:

url (str) – The URL to navigate to. If not provided, the default URL from the page class will be used.

Returns:

Page - The current instance of the page object.

wait_page_loaded(silent: bool = False, timeout: int | float = 15) Page

Wait until the page is fully loaded by checking the visibility of the anchor element and other page elements.

Waits for the anchor element to become visible, and depending on the configuration of each page element, it waits for either their visibility or to be hidden.

Parameters:
  • silent (bool) – If True, suppresses logging during the waiting process. Defaults to False.

  • timeout (Union[int, float]) – The maximum time (in seconds) to wait for the page or elements to load. Defaults to WAIT_PAGE.

Returns:

Page - The current instance of the page object.

is_page_opened(with_elements: bool = False, with_url: bool = False) bool

Check whether the current page is opened.

Parameters:
  • with_elements (bool) – If True, verify the page is opened by checking specific elements.

  • with_url (bool) – If True, verify the page is opened by checking the URL.

Returns:

bool - True if the page is opened, otherwise False.

property driver: WebDriver | WebDriver | Page

Retrieves the source driver instance, which could be a Selenium, Appium, or Playwright driver.

Returns:

Current source driver that assigned for this object, which is either

selenium.webdriver.remote.webdriver.WebDriver or

appium.webdriver.webdriver.WebDriver or

playwright.sync_api.Page instance.

log(message: str, level: str = 'info') None

Logs a message with detailed context in the following format:

# Format
[time][level][driver_index][module][function:line] <message>
# Example
[Aug 14][16:04:22.767][I][2_driver][play_element.py][is_displayed:328] Check visibility of "Mouse page"
Parameters:
  • message (str) – The log message to record.

  • level (str) – The logging level, which should be one of the values from LogLevel

Returns:

None

swipe(start_x: int, start_y: int, end_x: int, end_y: int, duration: int = 0, sleep: int | float = 0) Page

Appium only: Swipe from one point to another, with an optional duration and post-swipe delay.

Parameters:
  • start_x (int) – The x-coordinate at which to start the swipe.

  • start_y (int) – The y-coordinate at which to start the swipe.

  • end_x (int) – The x-coordinate at which to end the swipe.

  • end_y (int) – The y-coordinate at which to end the swipe.

  • duration (int) – The duration of the swipe in milliseconds.

  • sleep (Union[int, float]) – The delay (in seconds) after completing the swipe.

Returns:

Page - The current instance of the page object.

swipe_down() Page

Scroll the page downward using a swipe gesture.

Returns:

Page - The current instance of the page object.

swipe_up() Page

Scroll the page upward using a swipe gesture.

Returns:

Page - The current instance of the page object.