ree + 中的无头 JavaScript 测试黄瓜
有没有办法在 ree(Ruby 企业版)中进行无头 JavaScript 测试?
我见过 celerity/culerity/capybara,它与 jruby + HTMLUnit 一起工作,但我似乎无法让它与 ree 一起工作。当我只是尝试在 ree 下使用 @culerity
注释我的黄瓜测试时,我得到 jruby: command not found
,这当然是有道理的,因为我在 ree 下运行,不是朱比。
Is there a way to do headless javascript testing in ree (Ruby Enterprise Edition)?
I've seen celerity/culerity/capybara, which work with jruby + HTMLUnit, but I can't seem to get it working with ree. When I simply try to annotate my cucumber test with @culerity
under ree, I get jruby: command not found
, which of course makes sense, because I'm running under ree, not jruby.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我一直在寻找不同的库来进行无头 JavaScript 测试。
我尝试过基于 HTMLUnit 的 akephalos,它确实很有前途,但我无法让测试正常工作与硒一起工作。
我现在使用 capybara-webkit,它工作完美。在安装 gem 之前,您需要安装 Qt。
但是一旦完成(在 ubuntu 上安装起来非常容易),您只需将 gem 添加到您的 Gemfile 中
并将您的 Capybara Javascript 驱动程序设置为 webkit:
然后您就可以开始了。希望这有帮助。
I have been looking at different libraries to do headless javascript testing.
I have tried akephalos, based on HTMLUnit, which was really promising, but I was unable to get tests working that worked with selenium.
I am now using capybara-webkit, and it works flawlessly. You will need to install Qt before installing the gem.
But once that is done (and on ubuntu it is really easy to install), you just add the gem to your
Gemfile
And set your Capybara Javascript driver to webkit:
And you are good to go. Hope this helps.
您可以使用 capybara-webkit 或使用 Xvfb 运行 selenium - 请参阅此 post 并解释如何设置它。
You can use capybara-webkit or run selenium with Xvfb - see this post with explanations on how to set it up.
也看看poltergeist
https://github.com/jonleighton/poltergeist
Capybara.javascript_driver = :poltergeist
take a look also at poltergeist
https://github.com/jonleighton/poltergeist
Capybara.javascript_driver = :poltergeist