A PageElementMap manages multiple related "static" PageElements which all have the same type and the same "base" selector.
The PageElements managed by PageElementMap are always known in advance and do not change (eg. navigation menu entries). They can therefore be statically identified when PageElementMap is initially created by constraining the map's "base" XPath selector using XPath modification functions.
This initial identification process makes use of a mappingObject
and a mappingFunc
which are both defined in
PageElement's identifier
object:
mappingObject
, mappingFunc
is invoked with the map's "base" selector as the first and
the value of the currently processed property as the second parameter.mappingFunc
then constrains the "base" selector by using XPath modification functions which are passed the
values of the currently processed properties as parameters.mappingObject
's propertiesThe resulting object of mapped PageElements can be accessed via PageElementMap's $
accessor.
All of PageElementMap's state retrieval (getXXX) and state check functions (hasXXX/hasAnyXXX/containsXXX) return
their result values as a result map. This is an object whose key names or taken from PageElementMap's $
accessor and whose values are the results of the respective function being executed on the mapped PageElement.
the "base" XPath selector of PageElementMap which is constrained to identify the map's managed PageElements
_$
provides access to all mapped PageElements of PageElementMap.
the options passed to _elementStoreFunc
to configure a managed PageElement instance
This function retrieves an instance of a PageElement mapped by PageElementMap from the map's PageNodeStore.
This _identifier
provides a mappingObject
and a mappingFunc
which are used to constrain the "base"
XPath selector of PageElementMap using XPath modification functions in order to statically identify a
PageElementMap's managed PageElements when the PageElementMap is initially created.
The identified and mapped PageElements can be accessed via PageElementMap's $
accessor.
Stores the last differences of PageNode's check state functions.
Intended for framework-internal usage only.
the XPath selector of PageNode
an instance of PageNodeStore which can be used to retrieve/create PageNodes
$
provides access to all mapped PageElements of PageElementMap.
Provides custom error handling of 'could not be located' and 'WaitUntilTimeoutError' errors for functions that check if a condition returns true within a specific timeout.
the function which is supposed to return true within a specific timeout
Executes func and trows any errors that occur during its execution.
If an error occurs because an element could not be located on the page, throws a custom 'could not be located' error message.
the function to be executed
the result value of the executed function
Provides custom error handling of 'could not be located' and 'WaitUntilTimeoutError' errors for functions that wait for a condition to become true within a specific timeout and throw an error if the condition does not become true.
the function which is supposed to return true within a specific timeout and throws an error if the condition does not become true
an errorMessage that describes the condition which did not become true within a specific timeout
the timeout used to wait for the result of the passed func to return true
this (an instance of PageNode)
This function executes a waitFunc until it returns true or a specific timeout is reached. If the return value of waitFunc does not become true within the timeout, this function throws a 'WaitUntilTimeoutError'.
__waitUntil also provides custom error handling for 'could not be located' errors.
the function which is supposed to return true within a specific timeout
a function that returns an errorMessage which describes the condition that did not become true within a specific timeout
the timeout used to wait for the result of the waitFunc to return true
the interval used to check for the result of the waitFunc to return true
this (an instance of PageNode)
This function implements custom error handling for 'could not be located' and 'WaitUntilTimeoutError' errors.
an arbitrary type of error
used to describe the failed condition check which caused a WaitUntilTimeoutError
the timeout used to wait for an element to be located or for a wait condition to return true
Used to determine if a function of a managed PageElement should be invoked or if its invocation should be skipped because the PageElement is not included by a filterMask.
This function changes the mappingObject
used by PageElementMap's identifier
object to constrain the "base"
XPath selector of PageElementMap using XPath modification functions in order to statically identify a
PageElementMap's managed PageElements.
This can be useful if, for example, the links of a navigation menu are represented using a PageElementMap and
the GUI is switched to another language: Now the values used to identify the links by text change while the keys
used to access the links via tha map's $
property stay the same.
Invokes a state check function for each PageElement in a passed context
map and returns true if the result of
each state check function invocation was true.
a map containing all PageElements for which checkFunc
should be executed
a state check function executed for each PageElement in context
. It is passed a PageElement as
first parameter and an expected value used by the state check comparison as an optional second parameter.
a map of expected values used for the state check comparisons
if set to true, the expected
parameter represents a filterMask which can be used to skip the
invocation of the state check function for some or all PageElements.
The results of skipped function invocations are not included in the results map.
true if the state check functions of all checked PageElements returned true or if no state check functions were invoked at all
Invokes a state check function for each PageElement in a passed context
map and returns a map of state
check function results.
a map containing all PageElements for which checkFunc
should be executed
a state check function executed for each PageElement in context
. It is passed a PageElement as
first parameter and an expected value used by the state check comparison as an optional second parameter.
a map of expected values used for the state check comparisons
if set to true, the expected
parameter represents a filterMask which can be used to skip the
invocation of the state check function for some or all PageElements.
The results of skipped function invocations are not included in the total results map.
an map of results of a state check function executed for each PageElement in context
Invokes an action for each of PageElementMap's managed PageElements.
an action executed for each of PageElementMap's managed PageElements
can be used to skip the execution of an action for some or all PageElements
this (an instance of PageElementMap)
Invokes a state retrieval function for each PageElement in a passed context
map and returns a map of state
retrieval function results.
a map containing all PageElements for which getFunc
should be executed
a state retrieval function executed for each PageElement in context
. It is passed a PageElement
as first parameter.
can be used to skip the invocation of the state retrieval function for some or all PageElements. The results of skipped function invocations are not included in the total results map.
an map of results of a state retrieval function executed for each PageElement in context
Invokes a setter function for each PageElement in a passed context
map.
a map containing all PageElements for which setFunc
should be executed
a setter function executed for each PageElement in context
. It is passed a PageElement as
first parameter and the value to be set as second parameter.
a map of setter values
this (an instance of PageElementMap)
Invokes a wait function for each PageElement in a passed context
map.
a map containing all PageElements for which checkFunc
should be executed
a wait function executed for each PageElement in context
. It is passed a PageElement as
first parameter and an expected value used by the wait condition as an optional second parameter.
a map of expected values used for the wait conditions
if set to true, the expected
parameter represents a filterMask which can be used to skip the
invocation of the wait function for some or all PageElements.
this (an instance of PageElementMap)
Returns the 'containsDirectText' status of all PageElements managed by PageElementMap as a result map after performing the initial waiting condition of each managed PageElement.
A PageElement's 'containsDirectText' status is set to true if its actual direct text contains the expected direct text.
A direct text is a text that resides on the level directly below the selected HTML element. It does not include any text of the HTML element's nested children HTML elements.
the expected direct texts used in the comparisons which set the 'containsDirectText' status
Returns the 'containsText' status of all PageElements managed by PageElementMap as a result map after performing the initial waiting condition of each managed PageElement.
A PageElement's 'containsText' status is set to true if its actual text contains the expected text.
the expected texts used in the comparisons which set the 'containsText' status
Returns the direct texts of all PageElements managed by PageElementMap as a result map after performing the initial waiting condition of each PageElement.
A direct text is a text that resides on the level directly below the selected HTML element. It does not include any text of the HTML element's nested children HTML elements.
can be used to skip the invocation of the getDirectText
function for some or all managed
PageElements. The results of skipped function invocations are not included in the total results object.
Returns the 'hasAnyDirectText' status of all PageElements managed by PageElementMap as a result map after performing the initial waiting condition of each managed PageElement.
A PageElement's 'hasAnyDirectText' status is set to true if the PageElement has any direct text.
A direct text is a text that resides on the level directly below the selected HTML element. It does not include any text of the HTML element's nested children HTML elements.
can be used to skip the invocation of the getHasAnyDirectText
function for some or all managed
PageElements. The results of skipped function invocations are not included in the total results object.
Returns the 'hasAnyText' status of all PageElements managed by PageElementMap as a result map after performing the initial waiting condition of each managed PageElement.
A PageElement's 'hasAnyText' status is set to true if the PageElement has any text.
can be used to skip the invocation of the getHasAnyText
function for some or all managed
PageElements. The results of skipped function invocations are not included in the total results object.
Returns the 'hasDirectText' status of all PageElements managed by PageElementMap as a result map after performing the initial waiting condition of each managed PageElement.
A PageElement's 'hasDirectText' status is set to true if its actual direct text equals the expected direct text.
A direct text is a text that resides on the level directly below the selected HTML element. It does not include any text of the HTML element's nested children HTML elements.
the expected direct texts used in the comparisons which set the 'hasDirectText' status
Returns the 'hasText' status of all PageElements managed by PageElementMap as a result map after performing the initial waiting condition of each managed PageElement.
A PageElement's 'hasText' status is set to true if its actual text equals the expected text.
the expected texts used in the comparisons which set the 'hasText' status
Returns the 'enabled' status of all PageElements managed by PageElementMap as a result map after performing the initial waiting condition of each PageElement.
can be used to skip the invocation of the getIsEnabled
function for some or all managed
PageElements. The results of skipped function invocations are not included in the total results object.
Returns the "base" XPath selector that identifies all PageElements managed by PageElementMap.
Returns the texts of all PageElements managed by PageElementMap as a result map after performing the initial waiting condition of each PageElement.
can be used to skip the invocation of the getText
function for some or all managed
PageElements. The results of skipped function invocations are not included in the total results object.
Generated using TypeDoc
A PageElementMap manages multiple related "static" PageElements which all have the same type and the same "base" selector.
The PageElements managed by PageElementMap are always known in advance and do not change (eg. navigation menu entries). They can therefore be statically identified when PageElementMap is initially created by constraining the map's "base" XPath selector using XPath modification functions.
This initial identification process makes use of a
mappingObject
and amappingFunc
which are both defined in PageElement'sidentifier
object:mappingObject
,mappingFunc
is invoked with the map's "base" selector as the first and the value of the currently processed property as the second parameter.mappingFunc
then constrains the "base" selector by using XPath modification functions which are passed the values of the currently processed properties as parameters.mappingObject
's propertiesThe resulting object of mapped PageElements can be accessed via PageElementMap's
$
accessor.All of PageElementMap's state retrieval (getXXX) and state check functions (hasXXX/hasAnyXXX/containsXXX) return their result values as a result map. This is an object whose key names or taken from PageElementMap's
$
accessor and whose values are the results of the respective function being executed on the mapped PageElement.// baseSelector = "//nav/a[.="Dashboard"]" // mappingObject = {dashboard: "Dashboard"} // // returns '//nav/a[.="Dashboard"]' for this mappingFunc: ( baseSelector, mappingValue ) => xpath( baseSelector ).text( mappingValue )
// returns {dashboard: PageElement("//nav/a[.="Dashboard"]")} this.$
Store type of the PageNodeStore instance which can be used to retrieve/create PageNodes
K the key names of PageElementMap's
$
accessor used to access the map's managed PageElementsPageElementType type of the PageElements managed by PageElementList
PageElementOpts type of the opts parameter passed to the constructor function of the PageElements managed by PageElementList