Features
This section describes all features that are shipped with this package.
Scenario Features
- class balderhub.html.lib.scenario_features.HtmlPage(**kwargs)
Bases:
PageFeatureThe base scenario feature that describes a specific html page. You can use this feature to follow the POM (page object model) for writing your tests.
Every page is applicable to a subset of different
balderhub.url.lib.utils.Urlobjects. You can specify this inHtmlPage.applicable_on_url_schema().- property applicable_on_url_schema: Url | List[Url]
This method needs to be overwritten by child classes. It should return one or more
balderhub.url.lib.utils.Urlobjects that describe a schema, on which this page is applicable.For example:
from balderhub.html.lib.scenario_features import HtmlPage from balderhub.url.lib.utils import Url class MyPage(HtmlPage): def applicable_on_url_schema(self) -> Url: return Url('http://example.com/article/<int:article_id>/')
This makes the page applicable on domains like http://example.com/article/1/ or also http://example.com/article/555/, but not on http://example.com/article/a/.
- Returns:
a specific
balderhub.url.lib.utils.Urlobject or a list of it
- property driver: BaseWebdriverDriverClass
- Returns:
returns the driver of this page
- is_applicable()
Checks if this specific page can be used on the current screen. :return: True if this page object can be applied on the current screen, otherwise False