• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

diffux / diffux
99%
master: 98%

Build:
Build:
LAST BUILD BRANCH: rspec
DEFAULT BRANCH: master
Repo Added 26 Apr 2014 03:27PM CUT
Files 24
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

LAST BUILD ON BRANCH rspec-matcher
branch: rspec-matcher
CHANGE BRANCH
x
Reset
  • rspec-matcher
  • master
  • rails
  • rspec
  • switch-to-webdriver

pending completion
480

push

travis-ci

trotzig
Experimental: Add rspec-matcher `look_like_before`

I've been playing around with creating an RSpec matcher that can help
you keep track of the visual appearance of your app. A couple of
examples:

Example: Check for regressions on an entire page.

describe 'The start page' do
  context 'on a mobile device' do
    it 'has no visual regressions' do
      expect('/').to look_like_before(at_width: 320)
    end
  end

  context 'on a laptop' do
    it 'has no visual regressions' do
      expect('/').to look_like_before(at_width: 1000)
    end
  end
end

Example: Check for regressions to a particular component on a page.

describe 'Button component' do
  it 'has no visual regressions' do
    expect('/components/button').to look_like_before(crop_selector: '.button')
  end
end

The first time an example using this matcher is run, it will always
pass. When it does that, a baseline image is created. This baseline
image is then supposed to be commited to the repository. Next time you
run the spec a new snapshot image is created and compared with the
stored baseline. If it's different, the spec fails and a diff image is
created. If you made an intended change, you can simply ditch the diff
image and replace the baseline.

Tricky workflow? Perhaps. I want to give this a spin before it is
added to documentation and "released".

Suggested next steps:
 - Break out the matcher into its own gem, e.g. "diffux-rspec".
 - Add more examples from the Diffux UI.

450 of 455 relevant lines covered (98.9%)

148.53 hits per line

Relevant lines Covered
Build:
Build:
455 RELEVANT LINES 450 COVERED LINES
148.53 HITS PER LINE
Source Files on rspec-matcher
  • List 0
  • Changed 0
  • Source Changed 0
  • Coverage Changed 0
Loading...
Coverage∆FileLinesRelevantCoveredMissedHits/Line
No data available in table
Showing 0 to 0 of 0 entries
  • Previous
  • Next

Recent builds

Builds Branch Commit Type Ran Committer Via Coverage
480 rspec-matcher Experimental: Add rspec-matcher `look_like_before` I've been playing around with creating an RSpec matcher that can help you keep track of the visual appearance of your app. A couple of examples: Example: Check for regressions on an entire page.... push 29 Jun 2014 05:03PM CUT trotzig travis-ci pending completion  
See All Builds (104)
  • Repo on GitHub
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc