Name: capybara-inline-screenshot
Owner: Buildkite
Description: Extends capybara-screenshot with inline image output
Created: 2015-05-07 07:53:18.0
Updated: 2018-04-16 18:49:21.0
Pushed: 2017-03-20 23:35:02.0
Homepage: null
Size: 131
Language: Ruby
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
Extends capybara-screenshot with inline image output.
In iTerm3 (beta):
In Buildkite:
In your Gemfile simply replace capybara-screenshot
with capybara-inline-screenshot
:
'capybara-inline-screenshot'
For RSpec update your capabara-screenshot require
statement from:
ire 'capybara-screenshot/rspec'
to:
ire 'capybara-inline-screenshot/rspec'
For MiniTest update your capabara-screenshot require
statement from:
ire 'capybara-screenshot/rspec'
to:
ire 'capybara-inline-screenshot/minitest'
and then include it in your tests as you need:
s SystemTest < Minitest::Test
clude CapybaraInlineScreenshot::Minitest
For Cucumber update your capabara-screenshot require
statement from:
ire 'capybara-screenshot/cucumber'
to:
ire 'capybara-inline-screenshot/cucumber'
The final step is to configure your build steps to upload the screenshot artifacts. The default path is your app?s tmp
directory, so the artifact upload pattern would be tmp/*.png
Thanks the wonder of ANSI escape codes if your terminal client doesn't understand the escape codes it'll simply ignore them?it'll just be be like using the standard capybara-screenshot gem.
If the CI
environment variable is present screenshots will be output in the Terminal artifact:// format with the expectation that the images are uploaded as build artifacts and inlined by your CI system. You can also force this mode by setting the environment variable CAPYBARA_INLINE_SCREENSHOT=artifact
.
If the CI
environment variable is not present screenshots will be output in the base64 encoded iTerm2 image format for viewing in a local terminal. You'll need the nightly release of iTerm to see the images.
See the LICENSE file for license rights and limitations (MIT).