WatirSplash 2
WatirSplash 2 has been released already some time ago, but i haven’t covered the nice things which came with it. This situation will be improved with the following posts.
New Features
The biggest changes in WatirSplash 2 compared to version 1.x are:
- Loading all dependencies with the help of Bundler.
- Fixed support for Ruby 1.9.
- Introduced so called Page Objects.
- Removed cumbersome and usually not needed “ui-test-common” functionality.
- Made WatirSplash more transparent making it easier to follow what, when and how it does the things it does and giving better control over it.
Removed Features
It is quite easy to understand from the “New Features” list that projects generated with WatirSplash 1.x won’t work out of the box with WatirSplash 2. I had to break backwards compatibility due to the decisions made in the past which were in my way improving the framework to make it just a lot better.
I’ve paid attention to the users of WatirSplash and noticed what they didn’t like or what they have been wanting to do differently. This has caused me to use .rspec file to configure RSpec all the way instead of doing it programmatically from the WatirSplash itself. This gives a better control for tuning the usage of RSpec when needed.
Even browser window won’t be opened and maximized automatically anymore - you can still do it with the help of RSpec.configure block.
All these little details should make the experience of using WatirSplash even better!
Getting Started
Starting to use WatirSplash is as easy as splashin’ in the water. First you have to install the gem itself ofcourse:
After doing that you’d need to generate a default project structure. It can be done by using the “new” generator:
Being inside of the newly created project directory, install all the required dependencies aswell:
After having that done, generate the very first Page Object with the “page” generator. For example:
There you have it. Modify the newly generated files and start specc’ing. There will be a more thorough posts about the main new features including how to use Page Objects in the future - stay tuned. Feel free to read more information about WatirSplash from it’s repository at GitHub.




9 months ago