Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

capybara-rc

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

capybara-rc

  • 0.5.1
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Capybara::Rc

This gem provides an adapter that allows Selenium-RC-based code to execute using Capybara instead. This is useful because:

  • Selenium-RC has been deprecated for a while
  • Capybara allows your tests to run against different backends (not just selenium)
  • Porting an existing test suite to a new library is dangerous — you can wind up modifying your tests in such a way that they still pass but are no longer actually testing what you want.

Caveats

  • This is not a full adapter yet — it only adapts the methods that we are using at CDD.
  • Some things that were possible with Selenium-RC are not possible in Capybara. See DIFFERENCES.md for a list of some of these.

Installation

Add this line to your application's Gemfile:

gem 'capybara-rc'

And then execute:

$ bundle

Or install it yourself as:

$ gem install capybara-rc

Usage

  • Configure Capybara as is appropriate for your application
  • Replace your Selenium-RC initialization with something like this:
require 'capybara/rc'
# If @browser was your Selenium-RC browser before …
@browser = Capybara::Rc::Adapter.new(Capybara.current_session)

Additions

The ideal with this adapter is that you'd be able to drop it in and run your existing test suite with no changes. The reality is that you probably use some features of Selenium-RC that can't be adapted to Capybara (get_eval and the Selenium-RC in-browser JavaScript API are likely sources of this).

In order to limit the changes you need to make to your test suite, the Adapter class provides some lower-level translation methods:

  • capybara_find_by_locator(locator): returns a Capybara element corresponding to the given Selenium-RC locator. You can use the Capybara API to do further querying/testing on the returned element.
  • capybara_has_no_locator?(locator): allows you to bypass Capybara's wait when you are trying to test that something isn't present. Maps from a Selenium-RC locator to the appropriate Capybara has_no_* method (has_no_css, has_no_xpath, etc.).
  • capybara_has_locator?(locator): The positive version of the previous method. Similarly maps to the appropriate Capybara has_* method.

Development

Project infrastructure

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/cdd/capybara-rc.

License

The gem is available as open source under the terms of the MIT License.

FAQs

Package last updated on 15 Dec 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc