mirror of
https://github.com/silverstripe/silverstripe-behat-extension
synced 2024-10-22 17:05:32 +02:00
FIX iSelectFromInputGroup not understanding bootstraps input-in-label structure
This commit is contained in:
parent
b6ee213de7
commit
c3ed455ec6
@ -480,8 +480,14 @@ JS;
|
||||
|
||||
foreach($parent->findAll('css', 'label') as $option) {
|
||||
if($option->getText() == $value) {
|
||||
$input = null;
|
||||
|
||||
// First, look for inputs referenced by the "for" element on this label
|
||||
$for = $option->getAttribute('for');
|
||||
$input = $parent->findById($for);
|
||||
if ($for) $input = $parent->findById($for);
|
||||
|
||||
// Otherwise look for inputs _inside_ the label
|
||||
if (!$input) $input = $option->find('css', 'input');
|
||||
|
||||
if(!$input) throw new \InvalidArgumentException(sprintf('Input "%s" cannot be found', $value));
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user