Simulacrum

Build Status Code Climate Code Climate Dependency Status Gem Version

Simulacrum is a UI regression testing tool. It helps you write unit-like tests for user-interface components in web applications.

It is built around common tools such as RSpec, Capybara & Selenium Webdriver.

Support for 3rd party Selenium Webdriver services (such as Browserstack, and Saucelabs) is provided via additional collaborating gems;

Status
Browserstack plasticine/simulacrum-browserstack WIP 🚧
Saucelabs plasticine/simulacrum-saucelabs WIP 🚧

Does this sound like something you might be interested in?

  • Test your UI components visually
  • Know when a component is visually altered
  • Integrate with
  • Test component behaviour (JS) that manipulates visual appearance

UI Regression Testing

Explain the use-case better.

Opinions

Simulacrum is a little bit opinionated about a few things;

  • selenium webdriver (browserstack)
  • testing components

It would be good to explain these opinions, the reason for them and why they are good.

Setup

Simulacrum requires Ruby 1.9.3 or later. To install, add this line to your Gemfile and run bundle install:

Create a spec helper file for simulacrum — simulacrum_helper.rb — and throw this junk in it:

gem 'simulacrum'

The next step is to create a simulacrum_helper.rb helper file, and then require Simulacrum there:

require 'simulacrum'

Then you can configure Simulacrum within Rspec:

RSpec.configure do |config|
  include Simulacrum

  Simulacrum.configure do |config|
    config.defaults.acceptable_delta = 1 # up to 1% percentage change allowed
    config.defaults.capture_selector = '.components__examples' # CSS selector to crop reference image to
  end
end

Usage

simulacrum --help

Inspiration / Similar tools

  • Huxley
  • Green Onion