mirror of
https://github.com/silverstripe/silverstripe-behat-extension
synced 2024-10-22 17:05:32 +02:00
Merge pull request #38 from tractorcow/pulls/radio-select
API Allow "I select the * radio button"
This commit is contained in:
commit
51f7fc9e20
@ -516,6 +516,9 @@ It's based on the `vendor/bin/behat -di @cms` output.
|
|||||||
When /^(?:|I )additionally select "(?P<option>(?:[^"]|\\")*)" from "(?P<select>(?:[^"]|\\")*)"$/
|
When /^(?:|I )additionally select "(?P<option>(?:[^"]|\\")*)" from "(?P<select>(?:[^"]|\\")*)"$/
|
||||||
- Selects additional option in select field with specified id|name|label|value.
|
- 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>(?:[^"]|\\")*)"$/
|
When /^(?:|I )check "(?P<option>(?:[^"]|\\")*)"$/
|
||||||
- Checks checkbox with specified id|name|label|value.
|
- 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