Skip to main content
Version: 9.0.0

Multiselect Field

It is possible to find a multiselect element by following attributes:

NameParameter(s)TypeDescription
multiselectdataTestIdstringSearches for a multiselect field by value of the data-test-id attribute, same as multiselectByDataTestId
container?string
multiselectByIdDataTestIddataTestIdstringSearches for a multiselect field by value of the data-test-id attribute, same as multiselect
container?string
multiselectByIdidstringSearches for a multiselect field by value of the id attribute
container?string
multiselectByattributeNamestringSearches for a multiselect field by an attribute name and value
attributeValuestring
container?string
multiselectByCsscssstringSearches for a multiselect field by a custom scc selector
multiselectByXPathxpathstringSearches 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.

NameParameter(s)TypeDescription
setvaluestring / numberSets 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 }
selectOneValueFromListvaluestringSelects one value from the list with possible options
options?{ timeout?: number, assertionTimeout?: number, interval?: number, retries?: number }
selectValuesFromListvaluesstring[]Selects multiple values from the list with possible options
options?{ timeout?: number, assertionTimeout?: number, interval?: number, retries?: number }
openListoptions?{ timeout?: number, interval?: number, retries?: number }Opens the list with possible options by clicking an arrow icon
closeListoptions?{ timeout?: number, interval?: number, retries?: number }Closes the list with possible options by clicking an arrow icon
deleteItemByTitlevaluestringDeletes one value from Multiselect field

Assertions

Specific assertions

NameParameter(s)TypeDescription
assertListOfSelectedItemsHasValuevaluestringChecks if the multiselect field contains the given value (as selected)
options?{ timeout?: number, assertionTimeout?: number, interval?: number, retries?: number, soft?: boolean }
assertListOfSelectedItemsHasValuesvaluesstring[]Checks if the multiselect field contains given values (as selected)
options?{ timeout?: number, assertionTimeout?: number, interval?: number, retries?: number, soft?: boolean }
assertListOfSelectedItemsHasNoValuevaluestringChecks if the multiselect field does not contain the given value (as selected)
options?{ timeout?: number, assertionTimeout?: number, interval?: number, retries?: number, soft?: boolean }
assertListOfSelectedItemsHasNoValuesvaluesstring[]Checks if the multiselect field does not contain given values (as selected)
options?{ timeout?: number, assertionTimeout?: number, interval?: number, retries?: number, soft?: boolean }
assertChoiceOfOfferFieldHasSuggestedValuevaluestringChecks if the multiselect field contains the given value in an offered choices list
options?{ timeout?: number, assertionTimeout?: number, interval?: number, retries?: number, soft?: boolean }
assertChoiceOfOfferFieldHasSuggestedValuesvaluesstring[]Checks if the multiselect field contains given values in an offered choices list
options?{ timeout?: number, assertionTimeout?: number, interval?: number, retries?: number, soft?: boolean }
assertChoiceOfOfferFieldHasNoSuggestedValuevaluestringChecks 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 }
assertChoiceOfOfferFieldHasNoSuggestedValuesvaluesstring[]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

NameParameter(s)TypeDescription
shouldBeVisibleoptions?{ index?: number, timeout?: number, assertionTimeout?: number, interval?: number, retries?: number, soft?: boolean }Checks if the element exists and is visible
shouldExistoptions?{ index?: number, timeout?: number, assertionTimeout?: number, interval?: number, retries?: number, soft?: boolean }Checks if the element exists
shouldNotBeVisibleoptions?{ index?: number, timeout?: number, assertionTimeout?: number, interval?: number, retries?: number, soft?: boolean }Checks if the element exists but is not visible
shouldNotExistoptions?{ index?: number, timeout?: number, assertionTimeout?: number, interval?: number, retries?: number, soft?: boolean }Checks if the element does not exist
shouldHaveTextvaluestringChecks if the element's inner text contains a given string
options?{ index?: number, timeout?: number, assertionTimeout?: number, interval?: number, retries?: number, soft?: boolean }
shouldNotHaveTextvaluestringChecks 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 }
shouldHaveExactTextvaluestringChecks 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 }
shouldNotHaveExactTextvaluestringChecks 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 }
shouldHaveValuevaluestringChecks if the element's value contains a given string
options?{ index?: number, timeout?: number, assertionTimeout?: number, interval?: number, retries?: number, soft?: boolean }
shouldNotHaveValuevaluestringChecks if the element's value does not contain a given string
options?{ index?: number, timeout?: number, assertionTimeout?: number, interval?: number, retries?: number, soft?: boolean }
shouldBeEnabledoptions?{ index?: number, timeout?: number, assertionTimeout?: number, interval?: number, retries?: number, soft?: boolean }Checks if the element doesn't have a disabled attribute
shouldBeDisabledoptions?{ index?: number, timeout?: number, assertionTimeout?: number, interval?: number, retries?: number, soft?: boolean }Checks if the element has a disabled attribute
shouldBeRequiredoptions?{ timeout?: number, assertionTimeout?: number, interval?: number, retries?: number, soft?: boolean }Checks if the field is mandatory
shouldNotBeRequiredoptions?{ timeout?: number, assertionTimeout?: number, interval?: number, retries?: number, soft?: boolean }Checks if the field is not mandatory
shouldHaveValidationTypevalidationTypestringChecks if the element's validation type is equal to a given one
options?{ timeout?: number, assertionTimeout?: number, interval?: number, retries?: number, soft?: boolean }
shouldNotHaveValidationTypevalidationTypestringChecks 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

NameParameter(s)TypeDescription
waitUntilVisibilityoptions?{ timeout?: number, interval?: number, retries?: number }Waits for the element to be visible
waitUntilInvisibilityoptions?{ timeout?: number, interval?: number, retries?: number }Waits for the element to be invisible
waitUntilElementExistsoptions?{ timeout?: number, interval?: number, retries?: number }Waits for the element to exist
waitUntilElementNotExistoptions?{ 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:

NameParameter(s)TypeDescription
waitUntilVisibilityByTexttextstringFilters collection of elements by text and waits for the element to be visible
options?{ timeout?: number, interval?: number, retries?: number }
waitUntilVisibilityByAttributeattributeNamestringFilters collection of elements by attribute and waits for the element to be visible
attributeValuestring
options?{ timeout?: number, interval?: number, retries?: number }
waitUntilVisibilityByIndexindexnumberFilters collection of elements by index and waits for the element to be visible
options?{ timeout?: number, interval?: number, retries?: number }
waitUntilInvisibilityByIndexindexnumberFilters 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

NameParameter(s)TypeDescription
waitUntilCollectionOfElementsSizeIsGreaterOrEqualexpectedSizenumberWaits until collection of elements have specific size (or there are more)
options?{ timeout?: number, interval?: number, retries?: number }
waitUntilCollectionOfElementsSizeIsLessThanexpectedSizenumberWaits until collection of elements have fewer elements than specified
options?{ timeout?: number, interval?: number, retries?: number }

Actionability check

ActionabilityCheckTypes == attached | stable | visible | enabled | editable

NameParameter(s)TypeDescription
waitForSelectActionabilityCheckcheck types[]Waits for the element to pass all the selected actionability check types
isFilterByVisibilityboolean (true by default)

e.g.

await pega.multiselectById('fafff1e2').waitForSelectActionabilityCheck(['attached', 'visible', 'stable']);

Other helpers

NameParameter(s)TypeDescription
focusoptions?{ 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
hoveroptions?{ 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
pressTabSimulates "press Tab key" action
clickoptions?{ timeout?: number, interval?: number, retries?: number }Clicks in the field

IsVisible and IsExists functions

NameParameter(s)TypeDescription
isVisibleoptions?{ timeout?: number, interval?: number, retries?: number }Returns true if the element exists and is visible
isExistoptions?{ timeout?: number, interval?: number, retries?: number }Returns true if the element exists

GetValue and GetText functions

NameParameter(s)TypeDescription
getValueReturns element's value as a string
getTextReturns element's inner text as a string