Methods
(static) getSelect2ToggleSelectorByName(name, args) → {object}
Get the selector object for a Select2 dropdown by input name.
Parameters:
Name | Type | Description |
---|---|---|
name |
string | Input name. |
args |
object | Options. Valid fields: "multiple" - boolean - whether the input is a multiselector (default: false) |
Returns:
xpath selector.
- Type
- object
(static) select2Option(driver, selector, option) → {Promise}
Select a select2 dropdown option.
Parameters:
Name | Type | Description |
---|---|---|
driver |
WebDriver | Instance of WebDriver. |
selector |
object | The selector for the dropdown. |
option |
string | The text for the option to try and select. |
Returns:
A promise that will be resolved to true
if the option is found and selected,
or false
if unable to find and select the element.
- Type
- Promise
(static) select2OptionWithSearch(driver, selector, keyword, option) → {Promise}
Select a select2 search dropdown option.
Parameters:
Name | Type | Description |
---|---|---|
driver |
WebDriver | Instance of WebDriver. |
selector |
object | The selector for the dropdown. |
keyword |
string | The text to type in the search field. |
option |
string | The text for the option to try and select. |
Returns:
A promise that will be resolved to true
if the option is found and selected,
or false
if unable to find and select the element.
- Type
- Promise
(static) setSelect2WithSearch(driver, selector, keyword, option) → {Promise}
Select a select2 search dropdown option.
Parameters:
Name | Type | Description |
---|---|---|
driver |
WebDriver | Instance of WebDriver. |
selector |
object | The selector for the dropdown. |
keyword |
string | The text to type in the search field. |
option |
string | The text for the option to try and select. |
Returns:
A promise that will be resolved to true
if the option is found and selected,
or false
if unable to find and select the element.
- Type
- Promise
(static) waitTillAlertAccepted(driver, waitMs) → {Promise}
Wait for and accept an alert.
Timeout occurs after waitMs
if the alert is never present.
Parameters:
Name | Type | Description |
---|---|---|
driver |
WebDriver | Instance of WebDriver. |
waitMs |
number | How long to wait in milliseconds. Defaults to 1000. |
Returns:
A promise that will be resolved to true
if/when an alert happens and is successfully accepted,
or false
if timeout after waitMs
happens first.
- Type
- Promise
(static) waitTillAnimationFinished(driver, waitMs) → {Promise}
Wait until jQuery animations are finished.
Timeout occurs after waitMs
if the animation is still happening.
Parameters:
Name | Type | Description |
---|---|---|
driver |
WebDriver | Instance of WebDriver. |
waitMs |
number | How long to wait in milliseconds. Defaults to 1000. |
Returns:
A promise that will be resolved to true
if/when no jQuery animations are present,
or false
if timeout after waitMs
happens first.
- Type
- Promise
(static) waitTillUIBlockNotPresent(driver, waitMs) → {Promise}
Wait until the loading spinner overlay is not present.
Timeout occurs after waitMs
if the UI block is still present.
Parameters:
Name | Type | Description |
---|---|---|
driver |
WebDriver | Instance of WebDriver. |
waitMs |
number | How long to wait in milliseconds. Defaults to 1000. |
Returns:
A promise that will be resolved to true
if/when the UI block is not present,
or false
if timeout after waitMs
happens first.
- Type
- Promise
(static) waitTillUIBlockPresent(driver, waitMs) → {Promise}
Wait until the loading spinner overlay is present.
Timeout occurs after waitMs
if the overlay is not present.
Parameters:
Name | Type | Description |
---|---|---|
driver |
WebDriver | Instance of WebDriver. |
waitMs |
number | How long to wait in milliseconds. Defaults to 1000. |
Returns:
A promise that will be resolved to true
if/when the UI block is present,
or false
if timeout after waitMs
happens first.
- Type
- Promise