Pending step method generation fails with And steps
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 '{decorateNonHtml=true}' Reports view generated with 5 stories (of which 2 pending) containing 3 scenarios (of which 0 failed and 3 pending)
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 '{decorateNonHtml=true}'
Reports view generated with 5 stories (of which 2 pending) containing 3 scenarios (of which 0 failed and 3 pending)