Skip to content

Instantly share code, notes, and snippets.

@pilot
Created February 25, 2014 11:40
Show Gist options
  • Save pilot/9207373 to your computer and use it in GitHub Desktop.
Save pilot/9207373 to your computer and use it in GitHub Desktop.
<?php
/**
* @Given /^I select the "(?P<field>([^""]|\\")*)" radio button$/
*/
public function iSelectTheRadioButton($field)
{
$field = str_replace('\\"', '"', $field);
$radio = $this->getSession()->getPage()->findField($field);
if (null === $radio) {
throw new ElementNotFoundException(
$this->getSession(), 'form field', 'id|name|label|value', $field
);
}
$this->fillField($radio->getAttribute('name'), $radio->getAttribute('value'));
}
// With this in mind:
$dummy = $this->getSession()->getPage()->find('css', 'label[data-gateway="dummy"] input');
$this->fillField($dummy->getAttribute('name'), $dummy->getAttribute('value'));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment