Created
July 7, 2011 10:22
-
-
Save richsage/1069251 to your computer and use it in GitHub Desktop.
Behat step for logging in
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$steps->Given('/^I am logged into the admin area as rich_81$/', function($world) { | |
$session = $world->getSession(); | |
$doc = $session->getPage(); | |
// Ensure we're logged out for cases where the session isn't | |
// reset between Behat steps | |
$session->visit($world->locatePath("/admin/logout")); | |
$session->visit($world->locatePath("/admin")); | |
$doc->fillField("_username", "rich_81"); | |
$doc->fillField("_password", "foobar"); | |
$doc->clickButton("Log in"); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment