webdriver_test_tools.pageobject.webpage module¶
-
class
webdriver_test_tools.pageobject.webpage.WebPageObject(driver)[source]¶ Bases:
webdriver_test_tools.pageobject.yaml.YAMLParsingPageObjectPage 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 determinePAGE_FILENAMEandPAGE_URLWebPageObject.SITE_CONFIG – Test project’s
SiteConfigclass. Used inparse_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 fromINPUT_DICTS, which should be set in subclasses ifYAML_FILEisNone):- Variables
File name of the page relative to a base URL declared in
SITE_CONFIGclass.Note
If the ‘url’ key in the YAML file is set to a full URL,
PAGE_FILENAMEwill be set toNoneWebPageObject.PAGE_URL – Full URL of the page (e.g.
SITE_CONFIG.BASE_URL + PAGE_FILENAME)
-
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