【发布时间】:2018-03-11 13:52:44
【问题描述】:
我尝试在我的功能文件中添加一个标签(使用 eclipse 中的黄瓜插件)但是当我运行我的功能文件时它给了我一个错误:
Exception in thread "main" gherkin.TagExpression$BadTagException: Bad tag: "env" What am I doing wrong?
我想要的是当我运行测试时,我希望它在运行场景之前先设置环境:
功能示例:
Feature: Log into an account
@env
Scenario: Log Into Account With Correct Details
Given User navigates to stackoverflow website
环境设置类:
@Before("env")
public void setEnvironment() {
System.setProperty("webdriver.chrome.driver", "xxx//chromedriver.exe");
this.driver = new ChromeDriver();
ActiveEnvironment = LivePortal;
EnvironmentUsed.add(ActiveEnvironment);
driver.manage().window().maximize();
}
【问题讨论】:
标签: java eclipse cucumber gherkin