mirror of
https://github.com/silverstripe/silverstripe-behat-extension
synced 2024-10-22 17:05:32 +02:00
API Allow "I select the * radio button"
This commit is contained in:
parent
68524346c6
commit
a7ae2497d4
@ -516,6 +516,9 @@ It's based on the `vendor/bin/behat -di @cms` output.
|
||||
When /^(?:|I )additionally select "(?P<option>(?:[^"]|\\")*)" from "(?P<select>(?:[^"]|\\")*)"$/
|
||||
- Selects additional option in select field with specified id|name|label|value.
|
||||
|
||||
When /^I select the "([^"]*)" radio button$/
|
||||
- Selects a radio button with the given id|name|label|value
|
||||
|
||||
When /^(?:|I )check "(?P<option>(?:[^"]|\\")*)"$/
|
||||
- Checks checkbox with specified id|name|label|value.
|
||||
|
||||
|
@ -629,4 +629,17 @@ JS;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Selects the specified radio button
|
||||
*
|
||||
* @Given /^I select the "([^"]*)" radio button$/
|
||||
*/
|
||||
public function iSelectTheRadioButton($radioLabel) {
|
||||
$session = $this->getSession();
|
||||
$radioButton = $session->getPage()->findField($radioLabel);
|
||||
assertNotNull($radioButton);
|
||||
assertEquals('radio', $radioButton->getAttribute('type'));
|
||||
$session->getDriver()->click($radioButton->getXPath());
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user