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. *