Details
Description
When I run over a scenario with 'and' steps, pending method generation fails. The same scenario without the 'and' steps generates methods without any problem (and is jolly useful).
The failure happens in 3.3.1 and in 3.4-SNAPSHOT, commit c27f34.
The failure results from an NPE; JBehave knows the story has failed, but the run times out and then exits with 'pass' from the JUnit POV. Is that the expected behaviour, btw?
Failing scenario:
Scenario: When I log in with good credentials after having been redirected to the login page from my intended page, I am redirected to my intended page
Given I am not logged in
And I have been redirected from my intended page to the login page
When I log in with good credentials
Then I am redirected to my intended page
And I am logged in
Console output:
Scenario: When I log in with good credentials after having been redirected to the login page from my intended page, I am redirected to my intended page
Given I am not logged in (PENDING)
And I have been redirected from my intended page to the login page (PENDING)
When I log in with good credentials (PENDING)
Then I am redirected to my intended page (PENDING)
And I am logged in (PENDING)
Failed to run story package.name.here/login/i_can_log_in_with_correct_credentials.story
java.lang.NullPointerException
at org.jbehave.core.steps.PendingStepMethodGenerator.stepStartsWithWord(PendingStepMethodGenerator.java:86)
at org.jbehave.core.steps.PendingStepMethodGenerator.findStepType(PendingStepMethodGenerator.java:64)
at org.jbehave.core.steps.PendingStepMethodGenerator.generateMethod(PendingStepMethodGenerator.java:32)
at org.jbehave.core.embedder.StoryRunner.generatePendingStepMethods(StoryRunner.java:287)
at org.jbehave.core.embedder.StoryRunner.runScenarioSteps(StoryRunner.java:272)
at org.jbehave.core.embedder.StoryRunner.run(StoryRunner.java:170)
at org.jbehave.core.embedder.StoryRunner.run(StoryRunner.java:95)
at org.jbehave.core.embedder.Embedder$EnqueuedStory.call(Embedder.java:686)
at org.jbehave.core.embedder.Embedder$EnqueuedStory.call(Embedder.java:1)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:680)
Story package.name.here/login/i_can_log_in_with_correct_credentials.story has timed out after 61 seconds
Generating reports view to '/Users/jonathanwoods/Documents/workspaces/main/mobile/target/jbehave' using formats '[stats, console, txt, html, xml]' and view properties '
'
Reports view generated with 5 stories (of which 2 pending) containing 3 scenarios (of which 0 failed and 3 pending)
Activity
Field | Original Value | New Value |
---|---|---|
Comment |
[ Hi Jon,
I've added your scenario to the trader pending.story and the problem cannot be reproduced, i.e. And steps are well-handled. From the stacktrace the problem is most probably with your configuration, possibly of the keywords. It seems the for some reason the And keyword or step type is not found. Can you please provide a little self-contained project that reproduces the problem? Something as simple as the pom.xml and the Stories class and the .story file that you are using. ] |
Assignee | Mauro Talevi [ maurotalevi ] | |
Fix Version/s | 3.3.2 [ 17308 ] | |
Affects Version/s | 3.4 [ 17278 ] |
Status | Open [ 1 ] | In Progress [ 3 ] |
Fix Version/s | 3.4 [ 17278 ] |
Status | In Progress [ 3 ] | Resolved [ 5 ] |
Resolution | Fixed [ 1 ] |
Hi Jon,
I've added your scenario to the trader pending.story and the problem cannot be reproduced, i.e. And steps are well-handled.
From the stacktrace the problem is most probably with your configuration, possibly of the keywords. It seems the for some reason the And keyword or step type is not found.
Can you please provide a little self-contained project that reproduces the problem? Something as simple as the pom.xml and the Stories class and the .story file that you are using.