This commit is contained in:
kmayo-ss 2015-04-07 11:20:28 +00:00
commit c639c8b2ea
1 changed files with 26 additions and 0 deletions

View File

@ -373,6 +373,32 @@ JS;
$element->click();
}
/**
* Click on the element with the provided xpath query
*
* @When /^I click on the element with css selector "([^"]*)"$/
*/
public function iClickOnTheElementWithCSSSelector($cssSelector) {
$session = $this->getSession();
$element = $session->getPage()->find(
'xpath',
$session->getSelectorsHandler()->selectorToXpath('css', $cssSelector) // just changed xpath to css
);
if (null === $element) {
throw new \InvalidArgumentException(sprintf('Could not evaluate CSS Selector: "%s"', $cssSelector));
}
$element->click();
}
/**
* @Given /^I click on the element with css selector "([^"]*)", confirming the dialog$/
*/
public function iClickOnTheElementWithCSSSelectorConfirmingTheDialog($cssSelector) {
$this->iClickOnTheElementWithCSSSelector($cssSelector);
$this->iConfirmTheDialog();
}
/**
* @Given /^I type "([^"]*)" into the dialog$/
*/