Behat: Ignore native dropdowns if they're not visible

The CmsUiContext->theIFillInTheDropdownWith() method was written
primarily for TreeDropdownField, which don't have a select tag (only an input tag).
The method currently fails for CMS dropdowns (Dropdown form field class),
since they have a hidden select tag.

I've checked through core feature files and confirmed that every use
of the method relates to TreeDropdownField, which is why this bug hasn't ocurred earlier.
This commit is contained in:
Ingo Schommer 2015-01-06 10:19:17 +13:00
parent fb8fda0058
commit c705c547fd

View File

@ -418,7 +418,7 @@ class CmsUiContext extends BehatContext {
'named',
array('select', $this->getSession()->getSelectorsHandler()->xpathLiteral($field))
);
if($nativeField) {
if($nativeField && $nativeField->isVisible()) {
$nativeField->selectOption($value);
return;
}