Last active
August 29, 2015 14:07
-
-
Save richteri/b914473aa063cf4daa18 to your computer and use it in GitHub Desktop.
JBehave maps textual steps to Java methods via CandidateSteps. The scenario writer need only provide annotated methods that match, by regex patterns, the textual steps.
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
| public class FormTest { | |
| @Steps | |
| FormSteps endUser; | |
| @Given("the user is on the form page") | |
| public void givenTheUserIsOnTheFormPage() { | |
| endUser.on_the_form_page(); | |
| } | |
| @When("the user enters the name '$name' and age '$age' and submits the form") | |
| public void whenTheUserEntersName(String name, String age) { | |
| endUser.enters_name(name); | |
| endUser.enters_age(age); | |
| endUser.posts_form(); | |
| } | |
| @Then("they should see the error message '$errorName' for name and '$errorAge' for age") | |
| public void thenTheyShouldSeeErrorMessages(String errorName, String errorAge) { | |
| endUser.should_see_name_error(errorName); | |
| endUser.should_see_age_error(errorAge); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment