Yarjuf – Yet Another RSpec JUnit Formatter (for Jenkins)

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

To install: gem install yarjuf

Assertions in Page Object methods?

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!

Firefox plugin: Test Automation Password Manager

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

The above would get around my problem, but it would lead to having to maintain a firefox profile which isn’t nice. So, I decided to attempt writing a firefox plugin that would allow me to add credentials to firefox’s password manager at runtime using Javascript. After all, according to the documentation it looked possible…

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:

https://github.com/natritmeyer/test_automation_firefox_password_manager

…and the plugin page here:

https://addons.mozilla.org/en-US/firefox/addon/test-automation-password-ma/

I’ve not tested it extensively – “It Works On My Machine:)

List all tags in Cucumber

I needed to get a list of all the tags used in a cucumber project, and what follows is the formatter I wrote to list them all for me.

To use it, save the code in a file called list_tags.rb and then execute the following command:

cucumber -d -f Cucumber::Formatter::ListTags

Done!