jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • JBehave
  • JBEHAVE-279

GivenScenarios runs called scenario as PENDING not the implemented version

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Minor Minor
  • Resolution: Not A Bug
  • Affects Version/s: 2.5.1
  • Fix Version/s: 2.5.2
  • Component/s: Core
  • Labels:
    None
  • Environment:
    Eclipse, JDK1.5, MacOS

Description

We are trying to use GivenScenarios but when the scenario containing it runs it generate the PENDING steps not the actual steps. When the called scenario is run independently it runs fine. My step implementation are simply printlns. This is just running in Eclipse with jbehave-core-2.5.1. Any idea what we could be missing here. As a workaround I can embed the steps method for the first scenario before the steps method of the second then it works as expected.
Please see attached source in bdd1.jar
tx
Warren

1. user_logs_in_successfully
Given I am not logged in
When I log in as Liz with a password abc
Then I should see a message, "Welcome, Liz!"

output:
runBeforeScenario
logged out
login for user: csm with password: abc
checkMessage: Welcome, Liz!
runThisAfterScenarioAny
runThisAfterScenarioSuccess

2. user_places_an_order
Scenario: User logs in and places an order
GivenScenarios: com/test/examples/scenarios/user_logs_in_successfully.scenario
When I place an order
Then I should see a message, "Order placed"

output:
(com/test/examples/scenarios/user_logs_in_successfully.scenario)
Scenario:
Given I am not logged in (PENDING)
When I log in as service with a password service (PENDING)
Then I should see a message, "Welcome, CSM!" (NOT PERFORMED)

placing Order
checkMessage: Order placed

3. Run user_places_an_order with workaround (embedded steps method). Interesting is that the before and after steps of the first steps class is run in the second as well.

output:
runBeforeScenario
logged out
login for user: Liz with password: abc
checkMessage: Welcome, Liz!
runThisAfterScenarioAny
runThisAfterScenarioSuccess
runBeforeScenario
placing Order
checkMessage: Order placed
runThisAfterScenarioAny
runThisAfterScenarioSuccess

  • Options
    • Sort By Name
    • Sort By Date
    • Ascending
    • Descending
    • Download All

Attachments

  1. Hide
    Java Archive File
    bdd1.jar
    30/Apr/10 8:38 AM
    11 kB
    Warren Muller
    1. File
      META-INF/MANIFEST.MF 0.1 kB
    2. File
      bdd1/bin/com/.../scenarios/LoginSteps.class 2 kB
    3. File
      bdd1/bin/.../scenarios/PlaceOrderSteps.class 1 kB
    4. File
      bdd1/.../user_logs_in_successfully.scenario 0.1 kB
    5. File
      bdd1/bin/.../user_places_an_order.scenario 0.2 kB
    6. File
      bdd1/bin/.../UserLogsInSuccessfully$1.class 1 kB
    7. File
      bdd1/bin/.../UserLogsInSuccessfully.class 0.7 kB
    8. File
      bdd1/bin/.../UserPlacesAnOrder$1.class 1 kB
    9. File
      bdd1/bin/.../UserPlacesAnOrder.class 0.7 kB
    10. XML File
      bdd1/build.xml 1 kB
    11. Java Source File
      bdd1/src/main/.../scenarios/LoginSteps.java 2 kB
    12. Java Source File
      bdd1/src/.../scenarios/PlaceOrderSteps.java 0.5 kB
    13. File
      bdd1/.../user_logs_in_successfully.scenario 0.1 kB
    14. File
      bdd1/src/.../user_places_an_order.scenario 0.2 kB
    15. Java Source File
      bdd1/src/.../UserLogsInSuccessfully.java 0.9 kB
    16. Java Source File
      bdd1/src/.../UserPlacesAnOrder.java 0.8 kB
    Download Zip
    Show
    Java Archive File
    bdd1.jar
    30/Apr/10 8:38 AM
    11 kB
    Warren Muller

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
Mauro Talevi added a comment - 01/May/10 3:50 AM

Warren,

you need to add all the Steps instances that your Scenario will need to match the steps.

So, e.g., in UserPlacesAnOrder (which requires both login and order steps) you need

addSteps(new LoginSteps(), new PlaceOrderSteps());

and not just

addSteps(new PlaceOrderSteps());

else the scenario won't know how to match the login steps, as you are experiencing.

Show
Mauro Talevi added a comment - 01/May/10 3:50 AM Warren, you need to add all the Steps instances that your Scenario will need to match the steps. So, e.g., in UserPlacesAnOrder (which requires both login and order steps) you need addSteps(new LoginSteps(), new PlaceOrderSteps()); and not just addSteps(new PlaceOrderSteps()); else the scenario won't know how to match the login steps, as you are experiencing.
Hide
Permalink
Mauro Talevi added a comment - 01/May/10 3:51 AM

Not a bug, just a misconfiguration, as per comment.

Show
Mauro Talevi added a comment - 01/May/10 3:51 AM Not a bug, just a misconfiguration, as per comment.

People

  • Assignee:
    Mauro Talevi
    Reporter:
    Warren Muller
Vote (0)
Watch (0)

Dates

  • Created:
    30/Apr/10 8:37 AM
    Updated:
    01/May/10 3:51 AM
    Resolved:
    01/May/10 3:51 AM
  • Atlassian JIRA (v5.0.4#731-sha1:3aa7374)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.