From f18a54afbe1e471b5b24d57c6c37e26adf9cbf2c Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Fri, 16 Aug 2013 13:32:13 +0200 Subject: [PATCH] stepIPressTheButtonConfirmingTheDialog --- .../BehatExtension/Context/BasicContext.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/SilverStripe/BehatExtension/Context/BasicContext.php b/src/SilverStripe/BehatExtension/Context/BasicContext.php index 33555e8..ed309ac 100644 --- a/src/SilverStripe/BehatExtension/Context/BasicContext.php +++ b/src/SilverStripe/BehatExtension/Context/BasicContext.php @@ -276,6 +276,17 @@ JS; $matchedEl->click(); } + /** + * Needs to be in single command to avoid "unexpected alert open" errors in Selenium. + * + * @Given /^I press the "([^"]*)" button, confirming the dialog$/ + */ + public function stepIPressTheButtonConfirmingTheDialog($button) + { + $this->stepIPressTheButton($button); + $this->iConfirmTheDialog(); + } + /** * @Given /^I click "([^"]*)" in the "([^"]*)" element$/ */