Search code examples
cucumbercucumber-javacucumber-serenity

CucumberOptions "strict" is undefined


I have some manual test cases in which I don't want to define a cucumber step (whats the point as it's not going to be automated). I found I could use the option within @CucumberOptions called "strict" and set this to false so Cucumber would go over undefined steps without throwing an error. However, it seems that this option is no longer available. What should be used instead?

I am using the Serenity, so I am using the CucumberWithSerenity runner class.

enter image description here

enter image description here


Solution

  • strict has been decommissioned starting from Cucumber 7.0.0. As per this discussion if you have some WIP scenarios it is recommended to tag them appropriately and exclude from the run.

    For example:

    Feature: blah
    
      Scenario: my defined scenario
    
        Given defined step
    
      @wip
      Scenario: my undefined scenario
    
        Given undefined step
    

    Then your runner would look like:

    @RunWith(Cucumber.class)
    @CucumberOptions(tags = "not(@wip)")
    public class Runner {
    }