2

In my Rails app I have a hidden little form, which is made visible by clicking a button. This is done with some jQuery "hide" and "show" commands, the form itself is pretty much standard stuff.

To test this I can use Selenium Webdriver, but it seems a bit heavy to startup a Firefox browser only for clicking that button with jQuery functionality. Are there any alternatives to do this more lean and simple?

Edit: there is a nice Railscast about using PhantomJS together with Rails and rspec: http://railscasts.com/episodes/391-testing-javascript-with-phantomjs

4

1 回答 1

2

你可以看看 Webdriver 但使用PhantomJS - 它支持无头测试。我自己没有使用它,但我听说如果您不需要/不想启动整个浏览器,这是一个不错的选择。我认为您需要Ghost Driver将其与 Webdriver 绑定,但您需要检查一下。

于 2013-09-05T08:42:32.140 回答