No commit activity in last 3 years
No release in over 3 years
View capybara page dumps remotely
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.3
>= 0
>= 0

Runtime

>= 0
>= 0
 Project Readme

Capybara::Remote::Viewer

Capybara remote viewer runs a server that provides a navigable browser interface to the HTML dumps generated by capybara's save_page helper. It is especially useful if you're developing an app on a remote machine or working within a shell that can't open a browser window on your desktop.

Installation

Add this line to your application's Gemfile:

gem 'capybara-remote-viewer'

And then execute:

$ bundle

Or install it yourself as:

$ gem install capybara-remote-viewer

Usage

As a stand-alone binary

Start a server with: $ capy-remote

It will start on port 3000 by default and look in the current working directory (and all subdirectories) for any .html files to serve.

You can specify a path to a directory containing .html files with the -t option.

You can also specify the port with the -p option.

With foreman

Add a binstub

$ bundle binstub capybara-remote-viewer

Add a line to your Procfile

capy: bin/capy-remote -t tmp -p $PORT

Interface

All files dumped by capybara with the save_page method will automatically appear in the viewer interface as they are generated. No need to refresh!

Optional capybara configuration

Capybara does not clean up after itself when it dumps html files, so as these files appear, they will fill up remote viewer's interface with old junk. You can tell cucumber to clean these up before each run.

In features/support/capybara.rb:

AfterConfiguration do |config|
  Dir.glob(File.expand_path('../../../tmp/capybara/*', __FILE__)).
    each { |f| FileUtils.rm_f f }
end

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request