Merge 4dc379a38a
into 7db12fc9bb
This commit is contained in:
commit
c639c8b2ea
|
@ -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$/
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue