webdriver_test_tools.pageobject.webpage module

class webdriver_test_tools.pageobject.webpage.WebPageObject(driver)[source]

Bases: webdriver_test_tools.pageobject.yaml.YAMLParsingPageObject

Page object prototype for web pages

Subclasses should set the following attributes:

Variables
  • WebPageObject.YAML_FILE – Path to a YAML file representing the web page. This file is parsed during initialization using parse_yaml() and is used to determine PAGE_FILENAME and PAGE_URL

  • WebPageObject.SITE_CONFIG – Test project’s SiteConfig class. Used in parse_yaml() to determine page url attributes if the YAML ‘url’ value is a dictionary with a path relative to a configured URL

The following attributes are determined based on the contents of YAML_FILE (or parsed from INPUT_DICTS, which should be set in subclasses if YAML_FILE is None):

Variables
SITE_CONFIG = None
PAGE_FILENAME = None
PAGE_URL = None
parse_yaml(file_path)[source]

Parse a YAML representation of the web page object and set attributes accordingly

See YAML WebPageObjects doc for details on syntax.

Parameters

file_path – Full path to the YAML file

get_page_title()[source]

Get the title of the current page

Returns

Title of the current page