From 6c292e7f02e7be88e372b48fd3a863ab7e0dbca3 Mon Sep 17 00:00:00 2001 From: everzet Date: Tue, 19 Jun 2012 18:36:45 +0200 Subject: [PATCH] added homepage definition shortcut --- src/Behat/MinkExtension/Context/MinkContext.php | 11 +++++++++++ src/Behat/MinkExtension/Context/MinkDictionary.php | 11 +++++++++++ 2 files changed, 22 insertions(+) diff --git a/src/Behat/MinkExtension/Context/MinkContext.php b/src/Behat/MinkExtension/Context/MinkContext.php index 8970524..168b38d 100644 --- a/src/Behat/MinkExtension/Context/MinkContext.php +++ b/src/Behat/MinkExtension/Context/MinkContext.php @@ -23,6 +23,17 @@ use Behat\Behat\Context\TranslatedContextInterface, */ class MinkContext extends RawMinkContext implements TranslatedContextInterface { + /** + * Opens homepage. + * + * @Given /^(?:|I )am on homepage$/ + * @When /^(?:|I )go to homepage$/ + */ + public function iAmOnHomepage() + { + $this->getSession()->visit($this->locatePath('/')); + } + /** * Opens specified page. * diff --git a/src/Behat/MinkExtension/Context/MinkDictionary.php b/src/Behat/MinkExtension/Context/MinkDictionary.php index b15908d..c8004d4 100644 --- a/src/Behat/MinkExtension/Context/MinkDictionary.php +++ b/src/Behat/MinkExtension/Context/MinkDictionary.php @@ -92,6 +92,17 @@ trait MinkDictionary return $this->getMink()->assertSession($name); } + /** + * Opens homepage. + * + * @Given /^(?:|I )am on homepage$/ + * @When /^(?:|I )go to homepage$/ + */ + public function iAmOnHomepage() + { + $this->getSession()->visit($this->locatePath('/')); + } + /** * Opens specified page. *