blog

Let's talk about testing

Announcing LapisLazuli

The Open Source project is the fruit of our years of experience with automated testing of web applications and APIs. When we provide automated testing, we use other Open Source tools like cucumber, Watir and Selenium. LapisLazuli adds functionality on top of those projects for test suites that are less fragile and more maintainable.

Motivation

When you’re writing a test suite for your own software project, it’s very likely that the tests and software will evolve alongside each other. As the project grows, you’ll add more and more functionality to the test suite, because you don’t want to repeat yourself.

Now picture writing and maintaining not one, but many test suites. You’ve added a nifty piece of helper code to one test suite that solves a pesky little problem. A few days later you are working on another test suite, and run into a similar problem. What do you do?

Essentially, you’re running into a release management issue here, except not for the software you want to test, but for the test suite itself. Instead of wildly copying & pasting code, you start building a library of utility functions… that is how LapisLazuli started.

But you don’t have to write test automation code for a living to benefit from LapisLazuli. It simplifies things you would also run into in a single project.

Open Source

We want to give back to the FOSS community. And we don’t want to charge our customers for solving problems again that we already solved elsewhere. That made it an easy choice to publish LapisLazuli under the MIT +no-false-attribs License.

We hope you like it!

Example

In lieu of a full user guide, here’s a few lines of ruby code to give you some idea of the help LapisLazuli provides:

Selecting a browser to run tests in can be as easy as setting the BROWSER environment variable.

To avoid poisoning the global namespace, explicitly include the LapisLazuli module.

The module provides a browser object that creates a Firefox window all by itself. The goto method is from Watir.

LapisLazuli tries to load a configuration file, by default from config/config.yml — with that, you can customize much of the library’s behaviour.

There’s a built-in logger using our own teelogger gem for easier post-mortem debugging.

In contrast to stock Watir, screenshots are automatically named. In interactive ruby, the name is not particularly exciting — but called from within cucumber, screenshots are named after the scenario from which they’re generated.

Yep, that’s 6 features in 4 lines. And from within cucumber, a lot more stuff happens than in interactive ruby.