JBehave
  1. JBehave
  2. JBEHAVE-405

Signal that next step is of different type

    Details

    • Type: New Feature New Feature
    • Status: Open Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Core
    • Labels:
      None
    • Number of attachments :
      0

      Description

      Consider:

        Given something
        And something else
        Then it happened
      
        or..
      
        Given something
        Then it happened
      
        and..
      
        @When("something")
        public void something() {
        }
        @When("something else")
        public void somethingElse() {
        }
        @Then("it happened")
        public void itHappened() {
        }
      

      I'd like to be able to know in something() whether the next step is of a different type or not.

        @When("something")
        public void something(@Named("lastOfStepType") boolean lastOfStepType) {
        }
      

      This is particularly useful for UI interactions (WebDriver etc).

      Given I am have a hat in the cart
      When I purchase with credit card
      And I specify an alternate delivery address
      Then I should see a warning about different addresses

      I might want...

      When I purchase with credit card

      ... as a standalone, or with refining AND clauses. In the last of the when lines that's pertinent I may execute the whole set. When in this context feels like a continuation of sorts.

        Activity

        There are no entries against this issue.

          People

          • Assignee:
            Unassigned
            Reporter:
            Paul Hammant
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated: