I'm wanting to add an examples table to a background step in a cucumber feature file. How do I go about doing this?
I want to do something like this:
Background:
Given <username> has logged in
Examples:
|username|
|User 1 |
|User 2 |
Scenario: .....
Does this help you..
Feature: Passing background with multiline args
Background:
Given table |a|b|
|c|d|
And multiline string """ I'm a cucumber
and I'm okay. I sleep all night and I test all day """
Scenario: passing background
Then the table should be
|a|b|
|c|d|
Then the multiline string should be """ I'm a cucumber and I'm okay. I sleep all night and I test all day
""" Scenario: another passing background
Then the table should be |a|b| |c|d|
Then the multiline string should be """ I'm a cucumber and I'm okay. I sleep all night and I test all day
Refer this link for more scenarios..
https://www.relishapp.com/cucumber/cucumber/docs/gherkin/background
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With