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 determinePAGE_FILENAME
andPAGE_URL
WebPageObject.SITE_CONFIG – Test project’s
SiteConfig
class. 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_FILE
isNone
):- Variables
File name of the page relative to a base URL declared in
SITE_CONFIG
class.Note
If the ‘url’ key in the YAML file is set to a full URL,
PAGE_FILENAME
will be set toNone
WebPageObject.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