在 c# SpecFlow 中,例如在 AfterScenario 方法中,我可以将 Scenario Title 获取为ScenarioContext.Current.ScenarioInfo.Title
如果场景包含许多示例(在 Gherkin 功能文件的意义上)并且我想获取示例上下文,让我们说它在示例列表中的索引。我怎样才能找到它?我必须在测试开始时设置它吗?如果是,如何以及在哪里?
以下是 Gherkin 场景的示例:
Scenario Outline: a scenario
Given The user '<UserName>'
When He opens the
Then The he should
Examples:
| UserName |
| user1 |
| user2 |
谢谢!