SitePrism 2.4 is out! It contains the following changes:
- It uses #find instead of #first to locate items on a page (this should increase the reliability of your tests) – you don’t need to make any changes, this is an ‘under-the-hood’ fix
- A new #has_no_<element>? method has been added
- Capybara 2.1 is now a dependency
Migrating a Capybara test suite requires a few changes to your code; since SitePrism sits on top of Capybara you’re going to have to make a few tweeks. Fear not, I’ve summarized them here:
In your Gemfile (assuming you use Selenium as your browser driver), add the following line:
In your Capybara config block (probably in your env.rb file if you’re using cucumber or your spec_helper.rb file if you’re using rspec), add the following lines:
- config.match = :prefer_exact
- config.ignore_hidden_elements = false
The above will replicate the behaviour of Capybara 1.*. If you want more details, take a look at Jonas Nicklas’ post entitled Introducing Capybara 2.1, particularly if you want to replicate Capybara 2.0 behaviour rather than 1.* behaviour.
SitePrism 2.1 is out, and thanks to a pull request from 3coins you can now use xpath instead of css if you like. Take a look at the docs here: http://rdoc.info/gems/site_prism/file/README.md#CSS_Selectors_vs__XPath_Expressions.
As usual, find SitePrism here: https://github.com/natritmeyer/site_prism
SitePrism 2.0 is out! Woo! So what’s changed in the API?
Nothing. Nothing at all.
So why release a new version? Well, all previous versions of SitePrism were dependent on Capybara 1.x. Now that Capybara has moved on to 2.x, SitePrism needed a few changes under the hood to get it to work with the new Capybara. That’s all! It just makes sense for SitePrism to be on the same ‘major version’ as Capybara.
Oh, there is one thing: since Capybara 2 doesn’t work with ruby 1.8 any more, SitePrism doesn’t either. You’ll need ruby 1.9 to use the new SitePrism.
So, I’ve previously put together an JUnit formatter for RSpec so I can use RSpec with Jenkins/Hudson, but it was a bit of a hack. People seem to use and like it so I’ve redeveloped it and packaged it as a gem. I’ve also fixed a few problems with it, particularly how it groups tests together. It’s called… “Yet Another RSpec JUnit Formatter“, AKA: yarjuf. Inspired, I know.
Read about it here: https://github.com/natritmeyer/yarjuf
gem install yarjuf
However cool your build radiator is, mine is cooler – it’s powered by a Raspberry Pi
A little while back, a question was asked on StackOverflow: “Why not include assertions in page methods?”
I wrote an answer (something along the lines of: “Almost Never“) and it would be cool if more people added their own thoughts to the question. Whether methods in page objects should contain assertions is a debate that never goes away…
So, assertions in page object methods? Or not? Either way, go write up your thoughts!
I’ve recently come across a problem when doing UI testing with Firefox on a Mac against a web app that uses NTLM authentication. Every time I navigated to the web app I was presented with a dialog box asking me for my username and password.
I did some reading and came across Alister Scott’s Automatic Firefox authentication when using Selenium-WebDriver with AutoAuth post. In it he explains a way to get around the problem:
- Create a Firefox profile using the profile manager
- Add the required credentials to the profile
- Use the above Firefox profile when running tests
- Add the AutoAuth plugin to the profile at test execution time
After a bit of hacking, the result is my first Firefox plugin: the Test Automation Password Manager plugin. It’s quite simple to use; you can find instructions here:
…and the plugin page here:
I’ve not tested it extensively – “It Works On My Machine”
It’s time for another update to SitePrism. Version 1.3 provides the ability to wait for the visibility or invisibility of an element or section.