2
A
回答
2
您可以使用标准JUnit注释。
在类似这样的亚军类写点东西:
@RunWith(Cucumber.class)
@Cucumber.Options(format = {"html:target/cucumber-html-report", "json-pretty:target/cucumber-json-report.json"})
public class RunCukesTest {
@BeforeClass
public static void setup() {
System.out.println("Ran the before");
}
@AfterClass
public static void teardown() {
System.out.println("Ran the after");
}
}
1
使用TestNG套件的功能将正常工作。
@BeforeSuite
public static void setup() {
System.out.println("Ran once the before all the tests");
}
@AfterSuite
public static void cleanup() {
System.out.println("Ran once the after all the tests");
}
-1
黄瓜的情景基础测试,您应该一步写自己的场景.feature
文件的步骤和这些步骤是由他们的步骤定义分别执行。
所以如果你想要在所有步骤之后发生一些事情,你应该在最后一步写出它,并在步骤定义中开发这一步骤。
另外,对于您想要在执行其他步骤之前要执行的操作,您应该在.feature
文件中的所有步骤之前考虑一个步骤,并在其步骤定义中对其进行开发。
相关问题
- 1. NoMethodError运行黄瓜测试
- 2. “耙”运行我所有的黄瓜测试罚款,但“黄瓜”没有步骤
- 3. 黄瓜测试没有运行
- 4. 告诉黄瓜测试运行在https
- 5. 在heroku上运行黄瓜测试
- 6. 黄瓜测试场景并行运行?
- 7. 黄瓜运行所有测试忽略“cucumber.yml”
- 8. 黄瓜错误,当我运行我的黄瓜测试
- 9. 的IntelliJ运行宁静黄瓜测试
- 10. 无法使用黄瓜运行测试
- 11. Dcucumber.options,运行单个黄瓜测试
- 12. 手动运行黄瓜JVM测试
- 13. 停止运行黄瓜测试功能
- 14. 量角器黄瓜测试不运行
- 15. 运行并发测试黄瓜/水豚
- 16. InitializationError而黄瓜运行JUnit测试
- 17. 运行引擎RSpec的/黄瓜测试
- 18. 黄瓜测试
- 19. 如何在重新运行后报告黄瓜测试?
- 20. 在黄瓜运行测试前运行一次代码
- 21. 的黄瓜测试
- 22. 黄瓜is_admin?测试
- 23. 如何在黄瓜中有条件地运行测试
- 24. 黄瓜测试没有并行运行(cucumber-jvm-parallel-plugin)?
- 25. 在黄瓜堆积测试
- 26. 为什么测试通过,如果运行“耙黄瓜:wip”,并失败为“耙黄瓜:所有”
- 27. 生成测试执行与Nightwatch黄瓜嫁接黄瓜报告
- 28. 黄瓜测试没有运行使用蚂蚁?
- 29. 如何检测是否红宝石运行黄瓜测试
- 30. 我黄瓜测试场景