Search code examples
cucumbergherkincucumber-java

How can I put a String message with a line break in gherkin?


Example: Then I get the message "Registration successful

Welcome Administrator"


Solution

  • You can use doc strings in Gherkin:

    Then the message reads
    """
    Hello
    
    World
    """
    

    In your step definition you can use the String parameter type.