diff --git a/src/Context/BasicContext.php b/src/Context/BasicContext.php index f043981..061a5f9 100644 --- a/src/Context/BasicContext.php +++ b/src/Context/BasicContext.php @@ -499,6 +499,18 @@ JS; $element->click(); } + /** + * Needs to be in single command to avoid "unexpected alert open" errors in Selenium. + * + * @When /^I click on the "([^"]+)" element, confirming the dialog$/ + * @param $selector + */ + public function iClickOnTheElementConfirmingTheDialog($selector) + { + $this->iClickOnTheElement($selector); + $this->iConfirmTheDialog(); + } + /** * @Given /^I (click|double click) "([^"]*)" in the "([^"]*)" element$/ * @param string $clickType