I'm trying to write a test which includes a step to choose a given value from a dropdown select list. I have found a number of ways to do this in the docs and on the forum, but none of them are working with my list. I'm wondering whether it may be because my drop down uses option groups and this is throwing it out in some way. The test looks like this:
const countrySelect = Selector('#del_country');
const countryOption = countrySelect.find('option');
While the HTML of the form looks like this:
<select name="del_country" id="del_country" class="country form-control custom-select required selectpicker">
<optgroup label="Common choices">
<option value="GB" selected="selected" data-delivery-charge="4">United Kingdom</option>
<option value="IE" data-delivery-charge="19">Ireland</option>
<option value="NL" data-delivery-charge="19">Netherlands</option>
<option value="FR" data-delivery-charge="19">France</option>
<option value="DE" data-delivery-charge="19">Germany</option>
<optgroup label="Other countries">
...other options etc
The test fails with the error:
"options" argument is expected to be a non-null object, but it was string.
I'm pretty sure I must be missing something, but I can't see what at this point. Any help would be greatly appreciated.