= What is Futile? Futile aims to be a cross-platform, cross-framework, robust and lightweight functional testing package for web pages.
And yes, we deliberately used those buzzwords.
= Why should I use it? For a hypothetical users of your website the most important thing is that it works. They don't care wether your #authorize method returns instance of user or an integer. They don't give a damn about it! They want to see the page, type in their login/password and see their profile. That's it. Easy as it sounds.
== What is wrong with
end The test passes, you are happy. Now go to your registration form and change the name of login field to :log_in. The test passes again. But the registration is not working! User is unable to register which seems to be a serious bug.
Also the #register_user_path method might be considered wrong. Remember that users type in your page address and it's probably the last thing they type into address bar -- unless they are leaving your page. The rest happens through and
This proves the main flaw of built-in functional tests for frameworks -- they don't test views. They do render them but nothing more. Remember -- view is the only interface endusers see when they visit your webpage. They only click links, fill fields and that's it!
= Installation $ sudo gem install futile
= Usage We provide you with a tool that will help you test your site from a view of enduser. You will be able to click buttons, type fields and do thing a regular user would do on your site.
== Show me some examples Let's say we want to test google. We want to be sure that the search results are ok, that the page is shown and such.
require "rubygems" require "futile"
g = Futile::Session.new("http://www.google.com") g.get("/") # (1) g.fill("q", "google") # (2) g.click_button("Search") # (3)
== What happens here?
= JavaScript No. This tool supports only html, no browser (as Firefox or Safari) is available so you are not able to test JS.
= Authors Futile is developed by
If you would like to contribute feel free to contact us.