How do poltergeist/PhantomJS and capybara-webkit differ?

前端 未结 4 1048
故里飘歌
故里飘歌 2020-12-23 16:03
  1. What are the differences between PhantomJS and capybara-webkit?
  2. What are the advantages of capybara-webkit over PhantomJS?
  3. Which of the two is the mo
4条回答
  •  庸人自扰
    2020-12-23 16:34

    capybara-webkit and PhantomJS both use Webkit under the hood to render web pages headlessly, i.e., without the need for a browser. They're different tools, however:

    • capybara-webkit serves as an adapter for Capybara, a Ruby gem that lets you write and perform high-level UI testing for a Rails or Rack app.
    • PhantomJS is a lower level tool that simply lets you run scripts against a web page. It can also be used to write UI tests as well (see Casper, for instance, or any of the other testing tools that build upon PhantomJS).

提交回复
热议问题