全球BeforeAll钩黄瓜-jvm吗? [英] Global BeforeAll Hook for cucumber-jvm?

查看:86
本文介绍了全球BeforeAll钩黄瓜-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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆