Combining Doc Strings and Scenario Outlines
Now think of a situation where you are passing a Doc String but you have to combine that with a Scenario Outline. How does Cucumber behave in such a situation?
Let's think of a situation where we are specifying the requirements for the content of an e-mail, but the content is based on the role from which the e-mail is sent. So how do we specify such a requirement in a Feature file and how do we write the Step Definitions for it? Let's find out in this recipe.
How to do it…
- For this recipe, let's consider this Scenario:
Scenario Outline: E-mail content verification Given I have a user account with <Role> rights Then I should receive an email with the body: """ Dear user, You have been granted <Role> ...
Get Cucumber Cookbook now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.