Label
It is possible to find label element by following attributes:
Name | Parameter(s) | Type | Description |
---|---|---|---|
label | dataTestId | string | Searches for a label by value of a Pega data-test-id attribute, same as labelByTestId |
labelByTestId | dataTestId | string | Searches for a label by value of a Pega data-test-id attribute, same as label |
labelByAttribute | attributeName | string | Searches for a label by an attribute name and value |
attributeValue | string |
Assertions
Assertions include many methods for filtering by index because quite often readonly text fields have the same data-test-ids and it`s difficult to differentiate them.
Name | Parameter(s) | Type | Description |
---|---|---|---|
shouldBeVisible | options? | { timeout?: number, assertionTimeout?: number, interval?: number, retries?: number } | Checks if the element exists and is visible |
shouldBeVisibleByIndex | index | number | Checks if the element exists and visible by a given index |
options? | { timeout?: number, assertionTimeout?: number, interval?: number, retries?: number } | ||
shouldExist | options? | { timeout?: number, assertionTimeout?: number, interval?: number, retries?: number } | Checks if the element exists |
shouldNotBeVisible | options? | { timeout?: number, assertionTimeout?: number, interval?: number, retries?: number } | Checks if the element exists but is not visible |
shouldNotBeVisibleByIndex | index | number | Checks if the element exists but is not visible by a given index |
options? | { timeout?: number, assertionTimeout?: number, interval?: number, retries?: number } | ||
shouldNotExist | options? | { timeout?: number, assertionTimeout?: number, interval?: number, retries?: number } | Checks if the element does not exist |
shouldHaveText | value | string | Checks if the element's inner text contains a given string |
options? | { timeout?: number, assertionTimeout?: number, interval?: number, retries?: number } | ||
shouldHaveTextByIndex | value | string | Checks if the element's inner text by a given index contains a given string |
index | number | ||
options? | { timeout?: number, assertionTimeout?: number, interval?: number, retries?: number } | ||
shouldNotHaveText | value | string | Checks if the element's inner text does not contain a given string |
options? | { timeout?: number, assertionTimeout?: number, interval?: number, retries?: number } | ||
shouldNotHaveTextByIndex | value | string | Checks if the element's inner text by a given index does not contain a given string |
index | number | ||
options? | { timeout?: number, assertionTimeout?: number, interval?: number, retries?: number } | ||
shouldHaveExactText | value | string | Checks if the element's inner text is equal to a given string |
options? | { timeout?: number, assertionTimeout?: number, interval?: number, retries?: number } | ||
shouldHaveExactTextByIndex | value | string | Checks if the element's inner text by a given index is equal to a given string |
index | number | ||
options? | { timeout?: number, assertionTimeout?: number, interval?: number, retries?: number } | ||
shouldNotHaveExactText | value | string | Checks if the element's inner text is not equal to a given string |
options? | { timeout?: number, assertionTimeout?: number, interval?: number, retries?: number } | ||
shouldNotHaveExactTextByIndex | value | string | Checks if the element's inner text by a given index is not equal to a given string |
index | number | ||
options? | { timeout?: number, assertionTimeout?: number, interval?: number, retries?: number } | ||
shouldNotBeBlank | options? | { timeout?: number, assertionTimeout?: number, interval?: number, retries?: number } | Checks if the element's inner text is not equal to an empty string ("") |
shouldNotBeBlankByIndex | index | number | Checks if the element's inner text by a given index is not equal to an empty string ("") |
options? | { timeout?: number, assertionTimeout?: number, interval?: number, retries?: number } |
Wait for
functions
Simple wait for visibility functions
Name | Parameter(s) | Type | Description |
---|---|---|---|
waitUntilVisibility | options? | { timeout?: number, interval?: number, retries?: number } | Waits for the element to be visible |
waitUntilInvisibility | options? | { timeout?: number, interval?: number, retries?: number } | Waits for the element to be invisible |
waitUntilElementExists | options? | { timeout?: number, interval?: number, retries?: number } | Waits for the element to exist |
waitUntilElementNotExist | options? | { timeout?: number, interval?: number, retries?: number } | Waits for the element not to exist |
Complex wait for visibility functions
Allow filtering of available elements by index, text, attribute:
Name | Parameter(s) | Type | Description |
---|---|---|---|
waitUntilVisibilityByText | text | string | Filters collection of elements by text and waits for the element to be visible |
options? | { timeout?: number, interval?: number, retries?: number } | ||
waitUntilVisibilityByAttribute | attributeName | string | Filters collection of elements by attribute and waits for the element to be visible |
attributeValue | string | ||
options? | { timeout?: number, interval?: number, retries?: number } | ||
waitUntilVisibilityByIndex | index | number | Filters collection of elements by index and waits for the element to be visible |
options? | { timeout?: number, interval?: number, retries?: number } | ||
waitUntilInvisibilityByIndex | index | number | Filters collection of elements by index and waits for the element not to be visible |
options? | { timeout?: number, interval?: number, retries?: number } |
Actionability check
ActionabilityCheckTypes == attached
| stable
| visible
| enabled
| editable
Name | Parameter(s) | Type | Description |
---|---|---|---|
waitForSelectActionabilityCheck | check types | [] | Waits for the element to pass all the selected actionability check types |
isFilterByVisibility | boolean (true by default) |
e.g.
await pega.label('Label').waitForSelectActionabilityCheck(['attached', 'visible', 'stable']);
IsVisible and IsExists functions
Name | Parameter(s) | Type | Description |
---|---|---|---|
isVisible | options? | { timeout?: number, interval?: number, retries?: number } | Returns true if the element exists and is visible |
isExists | options? | { timeout?: number, interval?: number, retries?: number } | Returns true if the element exists |
GetText function
Name | Parameter(s) | Type | Description |
---|---|---|---|
getText | Returns element's inner text as a string |