Skip to content
A RedGlass plugin which enables snapshot archives to be analyzed by DomReactor.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
example
lib
spec
.gitignore
.ruby-version
Gemfile
LICENSE
README.md
Rakefile
domreactor-redglass.gemspec

README.md

DomReactor + RedGlass

A RedGlass plugin which enables snapshot archives to be analyzed by DomReactor.

Requirements

You will need a DomReactor account and an API token to use DomReactor's automated layout analysis service. Visit http://domreactor.com to sign up.

Usage

# Configurations
browsers = [:firefox, :chrome]
archive_location = '/Users/you/Desktop/red_glass_snapshots'
test_id = 1
page_url = 'http://google.com'
opts = {
    baseline_browser: {name: 'firefox', version: '20.0', platform: 'darwin'},
    threshold: 0.02
}

# Take a RedGlass snapshot in each browser.
browsers.each do |browser|
  listener = RedGlassListener.new
  driver = Selenium::WebDriver.for browser, :listener => listener
  red_glass = RedGlass.new driver, {listener: listener, archive_location: archive_location, test_id: test_id}
  driver.navigate.to page_url
  red_glass.take_snapshot
  driver.quit
end

# Send the page archives to DomReactor.
DomReactorRedGlass.auth_token = '12345'
DomReactorRedGlass.create_chain_reaction("#{archive_location}/#{test_id}", opts)

License

The MIT License - Copyright (c) 2013 Binary Mechanics

You can’t perform that action at this time.