Hi,
Yesterday I wanted to add some functional tests for Create page/space actions and I found
that the Selenium version we're using doesn't work on Snow Leopard (my OS) so I
started looking at issues and found that the pb was fixed in Selenium2/WebDriver. Since I
had wanted to explore it for a while I took the time to do a quick exploration...
Selenium2 is the merge of Selenium and WebDriver.
Pros of Selenium2:
* No more JS sandbox. In selenium1 all the selenium API is executed as JS in the browser.
In Selenium2 the browsers are controlled using their native APIs (JNA).
* Faster (as a consequence of the previous point)
* Allows to do stuff such as file uploads, etc since there's no longer the issue of
the JS sandbox
* No need to start a Selenium Proxy. All you need is to start XE and then you can run the
tests as simple JUnit tests.
* The API is much cleaner (this is to be expected with hindsight). See
http://seleniumhq.org/docs/09_webdriver.html
* There's a very fast executing HtmlUnit driver (not to be used with tests using JS
though since it emulates browser JS support and thus cannot guarantee the result in the
real browser)
Now Selenium2 also recommends to use the PageObject pattern which IMO is a very good
pattern that we should use. More here:
http://code.google.com/p/selenium/wiki/PageObjects
In order to get a feel of it, I've committed a first test in the sandbox using the
PageObjects pattern:
http://svn.xwiki.org/svnroot/xwiki/contrib/sandbox/webdriver-ui-tests/
To run the test:
* Start a local XE on port 8080
* Open the project in your IDE and run LoginTest as a JUnit test
Let me know what you think.
My opinion
* We should test it more, on Ajaxy web pages to verify it's stable and working well
enough
* If that works well enough then we could make it our default way of writing functional UI
tests and start migrating existing tests one by one + write new ones in it
Thanks
-Vincent