Nerian/akephalos2 — Issue #24: Support multiple versions of HTMLUnit
Author: Nerian
Created: 2011-11-24 21:21:59+00:00
State: open
Labels: Feature

Right now the HTMLUnit version that Akephalos uses is pretty much hardcoded. It is a very hard dependency since it has to download an entire git repo.

Granted, I could be rewriting the history of that repo all the time in order to eliminate duplicated binaries and such, but this approach sucks.

We need to handle this dependency in a dynamic way that allows the developer to choose what HTMLUnit version is used, in a per project basis.

Interface:

``` ruby
Capybara.register_driver :akephalos do |app|
# available options:
# 2.8 , 2.9, 2.10. It defaults to 2.10
Capybara::Driver::Akephalos.new(app, :htmtunit_version => "2.10")
end
```

Akephalos will default to 2.10. So the first time that Akephalos is used, it is going to check if the code for HTMLUnit 2.10 has been downloaded. If it is not downloaded, then it downloads it.

The download will be stored at .akephalos/:version/ in the Rails (or whatever you are testing) project folder.

So you could potentially use your own version code of HTMLUnit; just store it there and use the adequate `htmlunit_version` string

This folder should be ignored by git.

The HTMLUnit downloads are located at:

http://sourceforge.net/projects/htmlunit/files/htmlunit/