From c754d70042e0f98d2f1ce93b005d3b66ba1633bc Mon Sep 17 00:00:00 2001 From: Steve Boyd Date: Thu, 15 Apr 2021 13:37:09 +1200 Subject: [PATCH] NEW add iClickOnTheElementConfirmingTheDialog --- src/Context/BasicContext.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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