Sample HTML:
<select id="random_text">
<option value="option1">asadka_TEST</option>
<option value="option2">Peter Parker</option>
<option value="option3">Clark Kent</option>
<option value="option4">aldkfsd_TEST</option>
</select>
Javascript code within the class
class TestPage extends Page {
get fullNameSelect() {return browser.element('#random_text');}
iterateAndSelect() {
this.fullNameSelect.value.ForEach() //pseudo code
}
}
I am trying to make iterateAndSelect function go through all options and choose the first one that ends with "_TEST".
Currently, I have only managed to discover the selectByVisibleText
action, but the issue is that I want to select an option based on a condition that the value ends with "_TEST" string, while this action requires providing the exact value.