Details

    • Type: Improvement Improvement
    • Status: Resolved Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 3.5.2
    • Fix Version/s: 3.5.3, 3.6
    • Component/s: Core
    • Labels:
      None
    • Number of attachments :
      0

      Description

      Having @Composite steps calling other @Composite steps does not seem to work at all:

      @Then("all buttons are enabled")
      @Composite(steps = {
          "Then all left buttons are enabled",
          "Then all top buttons are enabled" }
      )
      public void all() {}
      
      @Then("all left buttons are enabled")
      @Composite(steps = {
          "Then first left button is enabled",
          "Then second left button is enabled" }
      )
      public void left() {}
      
      @Then("all top buttons are enabled")
      @Composite(steps = {
          "Then first top button is enabled",
          "Then second top button is enabled" }
      )
      public void top() {}
      
      @Then("first top button is enabled")
      public void firstTop() {
        Assert.fail("Bah");
      }
      

      In the given scenario neither the substeps will be resolved nor called. So Then second top button is enabled will not be marked as pending and Then first top button is enabled won't fail.

      That's not nice as it might break your steps if you do some refactorings to them. Composite-calls should not need know if they again resolve to Composite steps.

        Activity

        Hide
        Mauro Talevi added a comment -

        The nested composite steps use case was never considered when the feature was introduced.

        It deserves a discussion on its merits, but it's not a bug as such.

        Show
        Mauro Talevi added a comment - The nested composite steps use case was never considered when the feature was introduced. It deserves a discussion on its merits, but it's not a bug as such.
        Hide
        Mark Michaelis added a comment -
        • The use case I currently have is to provide an API of steps other projects can use. Having this I cannot make composite steps within the API as the step definitions will get unusable.
        • Actually I think it is too easy to forget about the rule and the problem is that nothing breaks but the test reports to be fine.
        • So either an Exception needs to be thrown that nested Composite steps are not allowed or it must be supported. Otherwise you will get your tests green just by using nested Composite steps
        Show
        Mark Michaelis added a comment - The use case I currently have is to provide an API of steps other projects can use. Having this I cannot make composite steps within the API as the step definitions will get unusable. Actually I think it is too easy to forget about the rule and the problem is that nothing breaks but the test reports to be fine. So either an Exception needs to be thrown that nested Composite steps are not allowed or it must be supported. Otherwise you will get your tests green just by using nested Composite steps
        Mauro Talevi made changes -
        Field Original Value New Value
        Summary Nested Composite Steps are not resolved Support nested composite steps
        Issue Type Bug [ 1 ] Improvement [ 4 ]
        Assignee Mauro Talevi [ maurotalevi ]
        Fix Version/s 3.5.3 [ 18047 ]
        Fix Version/s 3.6 [ 17721 ]
        Mauro Talevi made changes -
        Status Open [ 1 ] In Progress [ 3 ]
        Hide
        Mauro Talevi added a comment -

        The use case is valid and is now supported. Please check latest snapshot and let us know if is satisfies all your use cases.

        Show
        Mauro Talevi added a comment - The use case is valid and is now supported. Please check latest snapshot and let us know if is satisfies all your use cases.
        Hide
        Mark Michaelis added a comment -

        Great. Tested it with 3.6-SNAPSHOT and it works! Thanks for that.

        Show
        Mark Michaelis added a comment - Great. Tested it with 3.6-SNAPSHOT and it works! Thanks for that.
        Mauro Talevi made changes -
        Status In Progress [ 3 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]

          People

          • Assignee:
            Mauro Talevi
            Reporter:
            Mark Michaelis
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: