An interesting story & special chars
/path/to/story
Narrative:
In order to renovate my house
As a customer
I want to get a loan
Lifecycle:
Before:
Scope: SCENARIO
Given a scenario step
Scope: STORY
Given a before story step
After:
Scope: SCENARIO
Outcome: ANY
Given a scenario step
Scope: STORY
Outcome: ANY
Given an after story step
Before:
Given a before story step
Scenario: I ask for a loan
GivenStories:
/given/story1
/given/story2
Given I have a balance of $50
!-- Then ignore me
!-- A comment
When I request $20
When I ask Liz for a loan of $100
When I ask Liz for a loan of $99
When I write special chars <>&"
When I write special chars in parameter <>&"
When I write two parameters ,,, and &&&
Then I should... - try again
/path/to/story
Then I should have a balance of $30(FAILED)
java.lang.Exception: Expected <30> got <25> at org.jbehave.core.reporters.StoryNarrator.narrateAnInterestingStory(StoryNarrator.java:71) at org.jbehave.core.reporters.TemplateOutputBehaviour.shouldOutputStoryToHtml(TemplateOutputBehaviour.java:22) (reflection-invoke) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) ...
Then I should have $20(NOT PERFORMED)
Then I don't return loan(FAILED)
org.jbehave.core.model.OutcomesTable$OutcomesFailed at org.jbehave.core.model.OutcomesTable.verify(OutcomesTable.java:55) at org.jbehave.core.reporters.StoryNarrator.narrateAnInterestingStory(StoryNarrator.java:82) at org.jbehave.core.reporters.TemplateOutputBehaviour.shouldOutputStoryToHtml(TemplateOutputBehaviour.java:22) (reflection-invoke) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) ...
Description | Value | Matcher | Verified |
---|---|---|---|
I don't return all | 100 | <50.0> | No |
A wrong date | 01/01/2011 | "02/01/2011" | No |
org.jbehave.core.model.OutcomesTable$OutcomesFailed at org.jbehave.core.model.OutcomesTable.verify(OutcomesTable.java:55) at org.jbehave.core.reporters.StoryNarrator.narrateAnInterestingStory(StoryNarrator.java:82) at org.jbehave.core.reporters.TemplateOutputBehaviour.shouldOutputStoryToHtml(TemplateOutputBehaviour.java:22) (reflection-invoke) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) ...
Scenario: Parametrised Scenario
Examples:
Given money <money>
Then I give it to <to>
money | to |
---|---|
$30 | Mauro |
$50 | Paul |
Example: {money=$30, to=Mauro}
Given money $30
Then I give it to Mauro
Example: {money=$50, to=Paul}
Given money $50
Then I give it to Paul
Then I should have a balance of $30(FAILED)
java.lang.Exception: Expected <30> got <25> at org.jbehave.core.reporters.StoryNarrator.narrateAnInterestingStory(StoryNarrator.java:97) at org.jbehave.core.reporters.TemplateOutputBehaviour.shouldOutputStoryToHtml(TemplateOutputBehaviour.java:22) (reflection-invoke) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) ...
After:
Given an after story step
STORY CANCELLED (DURATION 2 s)
@When("something \"$param\"") @Pending public void whenSomething() { // PENDING }
@Then("something is <param1>") @Pending public void thenSomethingIsParam1() { // PENDING }