I am currently encountering an issue while trying to select values from a Bootstrap-select2 drop-down in my form during the process of writing some function tests.
If Select2 is unfamiliar to you, here are some examples that may help:
The drop-downs are unordered lists that become visible when clicked on.
To make the list appear, I use the following code:
.findById('select2-chosen-1').click().end()
After making the list appear, I am unsure how to specifically select an item from it.
If I run the following code snippet, all the selections get printed out:
.findById('select2-results-1')
.getVisibleText()
.then(function(text) {
console.info(text);
})
Although I attempted to fetch all the li tag names using .findAllByTagName('li')
, I am uncertain about what further actions to take with that array.
I would greatly appreciate any guidance or suggestions to steer me in the right direction. Feel free to ask if you need additional information.
Thank you!