mirror of
https://github.com/silverstripe/silverstripe-behat-extension
synced 2024-10-22 17:05:32 +02:00
Merge pull request #119 from open-sausages/hamishs_fixes
FIX iSelectFromInputGroup not understanding bootstraps input-in-label
This commit is contained in:
commit
1d5e5816f0
@ -480,8 +480,14 @@ JS;
|
|||||||
|
|
||||||
foreach($parent->findAll('css', 'label') as $option) {
|
foreach($parent->findAll('css', 'label') as $option) {
|
||||||
if($option->getText() == $value) {
|
if($option->getText() == $value) {
|
||||||
|
$input = null;
|
||||||
|
|
||||||
|
// First, look for inputs referenced by the "for" element on this label
|
||||||
$for = $option->getAttribute('for');
|
$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));
|
if(!$input) throw new \InvalidArgumentException(sprintf('Input "%s" cannot be found', $value));
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user