From 52a23ed1f226f95305ce3af4db63855deac26ee3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Romey?= Date: Thu, 7 Mar 2013 11:27:55 +0100 Subject: [PATCH] Added 'Then print current URL' --- src/Behat/MinkExtension/Context/MinkContext.php | 10 ++++++++++ src/Behat/MinkExtension/Context/MinkDictionary.php | 10 ++++++++++ 2 files changed, 20 insertions(+) diff --git a/src/Behat/MinkExtension/Context/MinkContext.php b/src/Behat/MinkExtension/Context/MinkContext.php index ea8bfc1..5e1a1ab 100644 --- a/src/Behat/MinkExtension/Context/MinkContext.php +++ b/src/Behat/MinkExtension/Context/MinkContext.php @@ -397,6 +397,16 @@ class MinkContext extends RawMinkContext implements TranslatedContextInterface $this->assertSession()->elementsCount('css', $element, intval($num)); } + /** + * Prints current URL to console. + * + * @Then /^print current URL$/ + */ + public function printCurrentUrl() + { + $this->printDebug($this->getSession()->getCurrentUrl()); + } + /** * Prints last response to console. * diff --git a/src/Behat/MinkExtension/Context/MinkDictionary.php b/src/Behat/MinkExtension/Context/MinkDictionary.php index a36aef3..27a3178 100644 --- a/src/Behat/MinkExtension/Context/MinkDictionary.php +++ b/src/Behat/MinkExtension/Context/MinkDictionary.php @@ -463,6 +463,16 @@ trait MinkDictionary $this->assertSession()->elementsCount('css', $element, intval($num)); } + /** + * Prints current URL to console. + * + * @Then /^print current URL$/ + */ + public function printCurrentUrl() + { + $this->printDebug($this->getSession()->getCurrentUrl()); + } + /** * Prints last response to console. *