diff --git a/src/Context/BasicContext.php b/src/Context/BasicContext.php index f0439814..061a5f9f 100644 --- a/src/Context/BasicContext.php +++ b/src/Context/BasicContext.php @@ -499,6 +499,18 @@ public function iClickOnTheElement($selector) $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