*Windows* 中的并行 Cucumber/Watir 场景
关于我可以做什么/使用什么来在 Windows 上并行运行 Cucumber 场景有什么想法吗?到目前为止,我已经尝试过(有以下发现):
WatirGrid
必须使用 Ruby 线程实际“并行”运行。 这迫使我们将浏览器对象包装在一个线程中,因此 一旦线程块关闭就无法访问。 (无法传递浏览器对象 到黄瓜环境)
Hydra:
需要 SSH(和公钥)访问远程盒子(即没有 Windows)
Selenium Grid:
超级重,无法找到清晰的 Cucumber测试路径
TestJour:
需要 Bonjour(不适用于 Windows)
Any thoughts on what I can do/use to run cucumber scenarios in parallel on Windows? So far, I've tried (with the follow findings):
WatirGrid
Have to use Ruby threads to actually run in "parallel".
This forces us to wrap the browser object in a thread, and therefore
un-reachable once the thread block closes. (Can't pass Browser object
to cucumber environment)
Hydra:
Need SSH (and public-key) access to remote boxes (ie. No Windows)
Selenium Grid:
Super heavy and can't find clear Cucumber testing path
TestJour:
Requires Bonjour (which isn't available for Windows)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
关于 Watirgrid ...
我添加了一个迭代方法,可以传递一个 watir 代码块来针对远程浏览器对象执行。因此浏览器对象在步骤之间可以重用。更新的详细黄瓜示例如下:
https://github .com/90kts/watirgrid/blob/master/examples/cucumber/step_definitions/example_steps.rb
你的 cuke 步骤最终看起来像这样:
如果您有任何疑问,请随时给我留言。我们还在 EC2 上提供了 watirgrid 的商业实施,可用于测试版: http://gridinit.com/public/examples 请继续关注不同测试框架的更多更新!
仅供参考,控制/迭代帮助程序位于 watirgrid v1.1.2 的最新版本中。
另外,为了在每个提供程序上的不同场景中并行执行,我只需要一个 support/env.rb ,它看起来像这样的东西:
注意我正在使用
:take_all =>; true
获得对提供程序的独占访问权限并将其释放回网格at_exit
...然后我将使用 CLI 从单独的测试运行程序调用我的场景,可能包含在 bash 中或 DOS 脚本,例如Re Watirgrid ...
I've since added an iterate method which can be passed a block of watir code to execute against remote browser objects. So the browser objects become reusable between steps. An updated detailed cucumber example is here:
https://github.com/90kts/watirgrid/blob/master/examples/cucumber/step_definitions/example_steps.rb
Your cuke steps end up looking like this:
If you have any questions feel free to drop me a line. We also have a commercial implementation of watirgrid on EC2 available for beta at http://gridinit.com/public/examples so stay tuned for more updates with different test frameworks!
FYI the control / iterate helpers are in the latest version of watirgrid v1.1.2
Alternatively to do it in parallel with different scenarios on each of the providers, I would just have a support/env.rb that looks something like this:
Note I'm using
:take_all => true
to get exclusive access to a provider and releasing it back to the gridat_exit
... I would then call my scenarios from a separate test runner using the CLI, maybe wrapped in a bash or DOS script e.g.