How can I get the current Example
out of a Ruby cucumber test in an After
hook?
I can get the title with the code below. My Scenario
has several Examples
with it. Can I access the current Example
being tested?
Feature file
Scenario Outline: Successful login with primary accounts
Given I start on the login page
When I log into Overview page with "<acct>"
Then I am on the Overview page
Examples:
| acct |
| account1 |
| account2 |
After hook
After do |scenario|
scenario.scenario_outline.title # will give me the title
How to I get the current Example
?
Here is how I did it.