poltergeist/PhantomJS和capybara-webkit有何区别? [英] How do poltergeist/PhantomJS and capybara-webkit differ?

查看:80
本文介绍了poltergeist/PhantomJS和capybara-webkit有何区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

  1. PhantomJS和capybara-webkit有什么区别?
  2. capybara-webkit相对于PhantomJS有什么优势?
  3. 这两者中哪一个是最有效的工具?
  4. 其他...

推荐答案

poltergeist 是水豚司机对于PhantomJS,这是一个基于WebKit构建的无头浏览器. capybara-webkit是一个直接使用WebKit的capybara驱动程序.

poltergeist is the capybara driver for PhantomJS, a headless browser which is built on WebKit. capybara-webkit is a capybara driver which uses WebKit directly.

poltergeist/PhantomJS与capybara-webkit相比有一些很大的优势:

poltergeist/PhantomJS has some big advantages over capybara-webkit:

  • In my experience poltergeist/PhantomJS always times out when it should, whereas capybara-webkit sometimes hangs.
  • Its error messages are much clearer. For example, it will actually tell you if it can't click an element that is on the page because there's another element in front of it.
  • It can be told to re-raise Javascript errors as test errors (by instantiating the driver with js_errors: true).
  • PhantomJS is much easier to install than standalone WebKit. PhantomJS provides a nearly dependency-free executable that you can download, while standalone WebKit has many OS library dependencies which you may have to upgrade or otherwise fiddle with.

这篇关于poltergeist/PhantomJS和capybara-webkit有何区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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