全球BeforeAll钩黄瓜-jvm吗? [英] Global BeforeAll Hook for cucumber-jvm?
问题描述
红宝石版的黄瓜支持全局的前钩子。显然,放置在features / support目录中的* .rb文件只会在运行所有方案之前被调用一次。
请参见 https://github.com/cucumber/cucumber/wiki/ Hooks#global-hooks
The ruby version of cucumber supports a global before hook. An *.rb file placed in the features/support directory gets apparently called only once, before any and all scenarios run. See https://github.com/cucumber/cucumber/wiki/Hooks#global-hooks
这似乎是确保填充数据库(在测试期间以只读方式使用)的好方法处于已知状态),然后再运行任何测试。
That seems to be a great way to make sure a database (used in read-only during tests) gets populated (and thus is in a known state) before any tests run.
Java版本的黄瓜是否有类似功能?
Is there a similar feature available for the Java version of cucumber?
推荐答案
请点击此链接。
这是@BeforeAll和@AfterAll
Please follow this link. this a workaround for @BeforeAll and @AfterAll
https://github.com/cucumber/cucumber-jvm/issues/515
这篇关于全球BeforeAll钩黄瓜-jvm吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!