A PageElementGroup manages PageNodes of arbitrary types and structure in its Content
which can be accessed be
accessed via PageElementGroup's $
accessor.
It provides a convenient way to handle HTML forms, because it allows for state retrieval, state check, wait and setter functions to be executed on all of its managed PageNodes with a single function call. This can greatly reduce the code required to fill in a form.
PageElementGroup does not force its managed PageNodes to support a certain function - it simply checks if a
PageNode implements the said function before invoking it. If a PageNode does not implement a function, the
invocation of this function is skipped for the affected PageNode and undefined
will be written as the PageNode's
result value.
The result values returned by and the parameter values passed to functions which are executed on the managed
PageNodes are mapped to the structure of PageElementGroup's Content
by replacing the Content
's original values
(PageNodes) with the result value or the parameter value of the function executed on PageNode. The keys of the
Content
structure are never changed.
a string which uniquely identifies a PageElementGroup in a PageNodeStore
the XPath selector of PageNode
an instance of PageNodeStore which can be used to retrieve/create PageNodes
provides access to a PageElementGroup's Content
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 PageNode should be invoked or if its invocation should be skipped because the PageNode is not included by a filterMask.
Invokes a state check function for each PageNode in PageElementGroup's Content
and returns true if the result of
each state check function invocation was true.
this function checks if a PageNode implements the NodeInterface
required to invoke
checkFunc
is a state check function executed for each PageNode in PageElementGroup's Content
. It is
passed an args
object containing the PageNode and either the PageNode's expected value used by the state check
comparison or the PageNode's optional (sub) filter mask.
a structure 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 PageNodes.
a boolean indicating whether the result of each state check function invocation was true
Invokes a state check function for each PageNode in PageElementGroup's Content
and returns a structure
of state check function results.
this function checks if a PageNode implements the NodeInterface
required to invoke
compareFunc
is a state check function executed for each PageNode in PageElementGroup's Content
. It is
passed an args
object containing the PageNode and either the PageNode's expected value used by the state check
comparison or the PageNode's optional (sub) filter mask.
a structure 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 PageNodes.
a structure of results of a state check function executed for each PageNode in PageElementGroup's
Content
Invokes an action for each PageNode in PageElementGroup's Content
.
this function checks if a PageNode implements the NodeInterface
required to invoke
action
an action executed for each PageNode in PageElementGroup's Content
. It is
passed an args
object containing the PageNode and the PageNode's optional (sub) filter mask.
can be used to skip the invocation of an action for some or all PageNodes.
this (an instance of PageElementGroup)
Invokes a state retrieval function for each PageNode in PageElementGroup's Content
and returns a structure
of state retrieval function results.
this function checks if a PageNode implements the NodeInterface
required to invoke
getFunc
is a state retrieval function executed for each PageNode in PageElementGroup's Content
. It is
passed an args
object containing the PageNode and the PageNode's optional (sub) filter mask.
can be used to skip the invocation of the state retrieval function for some or all PageNodes. The results of skipped function invocations are not included in the total results structure.
a structure of results of a state retrieval function executed for each PageNode in PageElementGroup's
Content
Invokes a setter function for each PageNode in PageElementGroup's Content
.
this function checks if a PageNode implements the NodeInterface
required to invoke
setFunc
a setter function executed for each PageNode in PageElementGroup's Content
. It is
passed an args
object containing the PageNode and the PageNode's value.
a structure of setter values
this (an instance of PageElementGroup)
Invokes a wait function for each PageNode in PageElementGroup's Content
.
this function checks if a PageNode implements the NodeInterface
required to invoke
waitFunc
is a wait function executed for each PageNode in PageElementGroup's Content
. It is
passed an args
object containing the PageNode and either the PageNode's expected value used by the wait condition
or the PageNode's optional (sub) filter mask.
a structure 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 PageNodes.
this (an instance of PageElementGroup)
Returns the 'containsDirectText' status of all PageNodes managed by PageElementGroup as a result structure after executing the initial waiting condition of each PageNode.
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 PageNodes managed by PageElementGroup as a result structure after executing the initial waiting condition of each PageNode.
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 PageNodes managed by PageElementGroup as a result structure after executing the initial waiting condition of each PageNode.
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
PageNodes. The results of skipped function invocations are not included in the total results structure.
Returns the 'hasAnyDirectText' status of all PageNodes managed by PageElementGroup as a result structure after performing the initial waiting condition of each PageNode.
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
PageNodes. The results of skipped function invocations are not included in the total results structure.
Returns the 'hasAnyText' status of all PageNodes managed by PageElementGroup as a result structure after performing the initial waiting condition of each PageNode.
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
PageNodes. The results of skipped function invocations are not included in the total results structure.
Returns the 'hasDirectText' status of all PageNodes managed by PageElementGroup as a result structure after executing the initial waiting condition of each PageNode.
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 PageNodes managed by PageElementGroup as a result structure after executing the initial waiting condition of each PageNode.
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 PageNodes managed by PageElementGroup as a result structure after executing the initial waiting condition of each PageNode.
can be used to skip the invocation of the getIsEnabled
function for some or all managed
PageNodes. The results of skipped function invocations are not included in the total results structure.
Returns the texts of all PageNodes managed by PageElementGroup as a result structure after executing the initial waiting condition of each PageNode.
can be used to skip the invocation of the getText
function for some or all managed
PageNodes. The results of skipped function invocations are not included in the total results structure.
Generated using TypeDoc
A PageElementGroup manages PageNodes of arbitrary types and structure in its
Content
which can be accessed be accessed via PageElementGroup's$
accessor.It provides a convenient way to handle HTML forms, because it allows for state retrieval, state check, wait and setter functions to be executed on all of its managed PageNodes with a single function call. This can greatly reduce the code required to fill in a form.
PageElementGroup does not force its managed PageNodes to support a certain function - it simply checks if a PageNode implements the said function before invoking it. If a PageNode does not implement a function, the invocation of this function is skipped for the affected PageNode and
undefined
will be written as the PageNode's result value.The result values returned by and the parameter values passed to functions which are executed on the managed PageNodes are mapped to the structure of PageElementGroup's
Content
by replacing theContent
's original values (PageNodes) with the result value or the parameter value of the function executed on PageNode. The keys of theContent
structure are never changed.Store type of the PageNodeStore instance which can be used to retrieve/create PageNodes
Content an arbitrary object structure of PageNode instances as values and the names used to identify these PageNodes as keys