如果您使用标签,有一个简单的解决方案可以解决您的问题。
首先标记您的功能文件以指示特定功能需要像这样的 WatiN:
Feature: Save Proportion Of Sample Pool Required
As an <User>
I want to <Configure size of the Sample required>
so that <I can advise the deployment team of resourcing requirments>.
@WatiN
Scenario: Save valid sample size mid range
Given the user enters 10 as sample size
When the user selects save
Then the value is stored
然后用指示标签的属性装饰 BeforeScenario 绑定:
[BeforeScenario("WatiN")]
public void BeforeScenario()
{
...
}
这个 BeforeScenario 方法将只为使用 WatiN 的功能调用。