mirror of
https://github.com/silverstripe/silverstripe-behat-extension
synced 2024-06-28 15:39:48 +02:00
find radio button by its type and filter by label
This commit is contained in:
parent
e7400a7c91
commit
47b268ad65
|
@ -648,9 +648,12 @@ JS;
|
|||
*/
|
||||
public function iSelectTheRadioButton($radioLabel) {
|
||||
$session = $this->getSession();
|
||||
$radioButton = $session->getPage()->findField($radioLabel);
|
||||
$radioButtons = $session->getPage()->findAll("css", "input[type='radio']");
|
||||
foreach ($radioButtons as $radioButton) {
|
||||
if($radioButton->getAttribute('label') == $radioLabel)
|
||||
break;
|
||||
}
|
||||
assertNotNull($radioButton);
|
||||
assertEquals('radio', $radioButton->getAttribute('type'));
|
||||
$session->getDriver()->click($radioButton->getXPath());
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user