Multiselect Field
It is possible to find a multiselect element by following attributes:
Name | Parameter(s) | Type | Description |
---|---|---|---|
multiselect | dataTestId | string | Searches for a multiselect field by value of the data-test-id attribute, same as multiselectByDataTestId |
container? | string | ||
multiselectByIdDataTestId | dataTestId | string | Searches for a multiselect field by value of the data-test-id attribute, same as multiselect |
container? | string | ||
multiselectById | id | string | Searches for a multiselect field by value of the id attribute |
container? | string | ||
multiselectBy | attributeName | string | Searches for a multiselect field by an attribute name and value |
attributeValue | string | ||
container? | string | ||
multiselectByCss | css | string | Searches for a multiselect field by a custom scc selector |
multiselectByXPath | xpath | string | Searches for a multiselect field by a custom xpath selector |
container? | string |
Main action functions
In the multiselect field, it is possible to filter existing values and to add them to the field value or to type and add your own value (just type it and press Enter
or Tab
key). Another one option is to open the list with possible values by clicking an arrow and select the value without filtering.
Name | Parameter(s) | Type | Description |
---|---|---|---|
set | value | string / number | Sets the value to filter. Accepts string or number, it is also possible to select the element by index (in options parameter) |
options? | { index?: number, timeout?: number, assertionTimeout?: number, interval?: number, retries?: number } | ||
selectOneValueFromList | value | string | Selects one value from the list with possible options |
options? | { timeout?: number, assertionTimeout?: number, interval?: number, retries?: number } | ||
selectValuesFromList | values | string[] | Selects multiple values from the list with possible options |
options? | { timeout?: number, assertionTimeout?: number, interval?: number, retries?: number } | ||
openList | options? | { timeout?: number, interval?: number, retries?: number } | Opens the list with possible options by clicking an arrow icon |
closeList | options? | { timeout?: number, interval?: number, retries?: number } | Closes the list with possible options by clicking an arrow icon |
deleteItemByTitle | value | string | Deletes one value from Multiselect field |
Assertions
Specific assertions
Name | Parameter(s) | Type | Description |
---|---|---|---|
assertListOfSelectedItemsHasValue | value | string | Checks if the multiselect field contains the given value (as selected) |
options? | { timeout?: number, assertionTimeout?: number, interval?: number, retries?: number, soft?: boolean } | ||
assertListOfSelectedItemsHasValues | values | string[] | Checks if the multiselect field contains given values (as selected) |
options? | { timeout?: number, assertionTimeout?: number, interval?: number, retries?: number, soft?: boolean } | ||
assertListOfSelectedItemsHasNoValue | value | string | Checks if the multiselect field does not contain the given value (as selected) |
options? | { timeout?: number, assertionTimeout?: number, interval?: number, retries?: number, soft?: boolean } | ||
assertListOfSelectedItemsHasNoValues | values | string[] | Checks if the multiselect field does not contain given values (as selected) |
options? | { timeout?: number, assertionTimeout?: number, interval?: number, retries?: number, soft?: boolean } | ||
assertChoiceOfOfferFieldHasSuggestedValue | value | string | Checks if the multiselect field contains the given value in an offered choices list |
options? | { timeout?: number, assertionTimeout?: number, interval?: number, retries?: number, soft?: boolean } | ||
assertChoiceOfOfferFieldHasSuggestedValues | values | string[] | Checks if the multiselect field contains given values in an offered choices list |
options? | { timeout?: number, assertionTimeout?: number, interval?: number, retries?: number, soft?: boolean } | ||
assertChoiceOfOfferFieldHasNoSuggestedValue | value | string | Checks if the multiselect field does not contain the given value in an offered choices list |
options? | { timeout?: number, assertionTimeout?: number, interval?: number, retries?: number, soft?: boolean } | ||
assertChoiceOfOfferFieldHasNoSuggestedValues | values | string[] | Checks if the multiselect field does not contain given values in an offered choices list |
options? | { timeout?: number, assertionTimeout?: number, interval?: number, retries?: number, soft?: boolean } |
Common assertions
Name | Parameter(s) | Type | Description |
---|---|---|---|
shouldBeVisible | options? | { index?: number, timeout?: number, assertionTimeout?: number, interval?: number, retries?: number, soft?: boolean } | Checks if the element exists and is visible |
shouldExist | options? | { index?: number, timeout?: number, assertionTimeout?: number, interval?: number, retries?: number, soft?: boolean } | Checks if the element exists |
shouldNotBeVisible | options? | { index?: number, timeout?: number, assertionTimeout?: number, interval?: number, retries?: number, soft?: boolean } | Checks if the element exists but is not visible |
shouldNotExist | options? | { index?: number, timeout?: number, assertionTimeout?: number, interval?: number, retries?: number, soft?: boolean } | Checks if the element does not exist |
shouldHaveText | value | string | Checks if the element's inner text contains a given string |
options? | { index?: number, timeout?: number, assertionTimeout?: number, interval?: number, retries?: number, soft?: boolean } | ||
shouldNotHaveText | value | string | Checks if the element's inner text does not contain a given string |
options? | { index?: number, timeout?: number, assertionTimeout?: number, interval?: number, retries?: number, soft?: boolean } | ||
shouldHaveExactText | value | string | Checks if the element's inner text is equal to a given string |
options? | { index?: number, timeout?: number, assertionTimeout?: number, interval?: number, retries?: number, soft?: boolean } | ||
shouldNotHaveExactText | value | string | Checks if the element's inner text is not equal to a given string |
options? | { index?: number, timeout?: number, assertionTimeout?: number, interval?: number, retries?: number, soft?: boolean } | ||
shouldHaveValue | value | string | Checks if the element's value contains a given string |
options? | { index?: number, timeout?: number, assertionTimeout?: number, interval?: number, retries?: number, soft?: boolean } | ||
shouldNotHaveValue | value | string | Checks if the element's value does not contain a given string |
options? | { index?: number, timeout?: number, assertionTimeout?: number, interval?: number, retries?: number, soft?: boolean } | ||
shouldBeEnabled | options? | { index?: number, timeout?: number, assertionTimeout?: number, interval?: number, retries?: number, soft?: boolean } | Checks if the element doesn't have a disabled attribute |
shouldBeDisabled | options? | { index?: number, timeout?: number, assertionTimeout?: number, interval?: number, retries?: number, soft?: boolean } | Checks if the element has a disabled attribute |
shouldBeRequired | options? | { timeout?: number, assertionTimeout?: number, interval?: number, retries?: number, soft?: boolean } | Checks if the field is mandatory |
shouldNotBeRequired | options? | { timeout?: number, assertionTimeout?: number, interval?: number, retries?: number, soft?: boolean } | Checks if the field is not mandatory |
shouldHaveValidationType | validationType | string | Checks if the element's validation type is equal to a given one |
options? | { timeout?: number, assertionTimeout?: number, interval?: number, retries?: number, soft?: boolean } | ||
shouldNotHaveValidationType | validationType | string | Checks if the element's validation type is not equal to a given one |
options? | { timeout?: number, assertionTimeout?: number, interval?: number, retries?: number, soft?: boolean } |
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 } |
Wait for a collection size functions
Name | Parameter(s) | Type | Description |
---|---|---|---|
waitUntilCollectionOfElementsSizeIsGreaterOrEqual | expectedSize | number | Waits until collection of elements have specific size (or there are more) |
options? | { timeout?: number, interval?: number, retries?: number } | ||
waitUntilCollectionOfElementsSizeIsLessThan | expectedSize | number | Waits until collection of elements have fewer elements than specified |
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.multiselectById('fafff1e2').waitForSelectActionabilityCheck(['attached', 'visible', 'stable']);
Other helpers
Name | Parameter(s) | Type | Description |
---|---|---|---|
focus | options? | { timeout?: number, interval?: number, retries?: number } | Focuses the element. A focused element is ready to be activated with a keyboard or any keyboard-emulating technology |
hover | options? | { timeout?: number, interval?: number, retries?: number } | Hovers over the element. A hovered element is ready to be activated with a mouse or any mouse-emulating technology |
pressTab | Simulates "press Tab key" action | ||
click | options? | { timeout?: number, interval?: number, retries?: number } | Clicks in the field |
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 |
isExist | options? | { timeout?: number, interval?: number, retries?: number } | Returns true if the element exists |
GetValue and GetText functions
Name | Parameter(s) | Type | Description |
---|---|---|---|
getValue | Returns element's value as a string | ||
getText | Returns element's inner text as a string |