Abstract
Protected
Readonly
_driverProtected
Readonly
_locatorProtected
Readonly
_parentReadonly
aftReadonly
reporterAbstract
driverthe top-level interface between the application DOM and the code.
for operations within the scope of this UiComponent
the getRoot
function should be used instead
Abstract
locatorthe itentifier used to locate this component's root
Abstract
parenta function returning the view node object that encapsulates
this UiComponent
. the parent
can be used to chain a scoped
lookup refresh back to the root of the view preventing stale nodes
creates a new UiComponent
instance of the specified type passing in
the driver
, aftConfig
, reporter
and () => this.getRoot()
as parent
a class extending from UiComponent
providing a
Page Object Model interface with the DOM
Optional
options: Partial<UiComponentOptions>an object allowing for overrides to the default driver
,
locator
, parent
, reporter
and aftConfig
objects
an instance of the specified UiComponent
class
Abstract
getreturns the root view node object identified by this component's
locator
. the root node should be used to compartmentalise DOM
lookups to a scope only within this UiComponent
.
implementations should resemble the following:
override async getRoot(): Promise<WebElement> {
const searchContext = (this.parent != null) ? await this.parent() : this.driver;
return searchContext.findElement(this.locator);
}to ensure a fresh lookup of the root and child elements
Generated using TypeDoc
used to encapsulate logical blocks of a UI providing the ability to chain element lookups back to a root ancestor meaning that individual locators only need to be concerned with elements that exist as a child of the parent of this
UiFacet
. this is especially useful when UI elements exist in multiple places on a page and you only wish to get one instance in a specific location