Created
November 16, 2011 20:24
-
-
Save cystbear/1371256 to your computer and use it in GitHub Desktop.
Behat meta steps -- tiny example
This file contains 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
<?php | |
/** | |
* @Given /^I logged in as "([^"]*)" with "([^"]*)" password$/ | |
*/ | |
public function iLoggedInAsWithPassword($username, $password) | |
{ | |
return array( | |
new Step\Given("I am on \"/login\""), | |
new Step\When("I fill in \"Username\" with \"$username\""), | |
new Step\When("I fill in \"Password\" with \"$password\""), | |
new Step\When("I press \"Login\""), | |
new Step\Then("I should be on \"/home\""), | |
); | |
} |
This file contains 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
Scenario: Test my feature | |
Given I am on "/login" | |
When I fill in "Username" with "admin" | |
And I fill in "Password" with "admin" | |
And I press "Login" | |
And I should be on "/home" | |
And I go to "/feature-page" # your start your real steps here | |
And ... | |
And ... | |
Then ... | |
And ... | |
And ... |
This file contains 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
Scenario: Test my feature | |
Given I logged in as "admin" with "admin" password | |
When I go to "/feature-page" # your start your real steps here | |
And ... | |
Then ... | |
And ... |
Not working anymore:
https://github.com/KnpLabs/FriendlyContexts/blob/master/doc/feature-smartStep.md
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
thanks this was useful