Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我们正在我们的测试界面中动态地创建一堆特性测试。为了便于阅读,我想将它们放在一个组中。我看到可以在流文件中引用组,是否有一个“start_group”接口方法,可以在创建测试列表时添加测试列表?
谢谢
我认为您可以将组参数分配给单个测试,这可能会有所帮助:
group :my_group do test :test1 test :test2 end # This is equivalent test :test1, group: :my_group test :test2, group: :my_group
显然,如果在您的情况下更可取,可以在界面中注入 group 参数。
还要记住,您可以在流中调用的所有内容都可以在接口中调用,因此您也可以group :blah do ... end在接口逻辑中使用该方法。
group :blah do ... end