We’re thrilled to announce the public release of 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.
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.
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!
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:
$ BROWSER=firefox irb irb(main):001:0> require 'lapis_lazuli' => true irb(main):002:0> include LapisLazuli => Object irb(main):003:0> browser.goto "http://spritecloud.com" Could not load configuration from: config/config.yml => "http://www.spritecloud.com/" irb(main):004:0> browser.take_screenshot A, [2015-03-30T16:58:36.081356 #25370] ANY -- : Logging to # initialized with level INFO. D, [2015-03-30T16:58:36.081552 #25370] DEBUG -- #: Screenshot saved: ./screenshots/150330_165834_screenshot.png => "./screenshots/150330_165834_screenshot.png"
In this example, you can observe the following features:
- Selecting a browser to run tests in can be as easy as setting the
- To avoid poisoning the global namespace, explicitly include the
- The module provides a
browserobject that creates a Firefox window all by itself. The
gotomethod 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.
The LapisLazuli project is documented on the github Wiki.
Our Test Automation guide, “Test Automation: nearly everything you need to know.”