Giter Club home page Giter Club logo

capybara-firebug's Introduction

capybara-firebug provides a dead-simple way to run Capybara-based Cucumber scenarios or RSpec request specs with Firebug enabled under the selenium driver.

To use it in RSpec examples, require 'capybara/firebug/rspec' in spec_helper.rb, and tag the examples you need to debug with :firebug => true.

To use it in Cucumber scenarios, require 'capybara/firebug/cucumber' in env.rb, and tag the scenarios you need to debug with @firebug.

Firebug Versions

By default, this gem uses Firebug 2.0.2, which is compatible with Firefox 30-32.

If you want to use Firebug 1.12.8 (compatible with Firefox 23+), you need to explicitly specify the firebug_version setting in your capybara.rb support file:

# located in features/support/capybara.rb or similar
require 'capybara/firebug'
Selenium::WebDriver::Firefox::Profile.firebug_version = '1.12.8'

Customizing the Profile

If you wish to further customize the Firefox profile used by selenium, you can use the #enable_firebug method to add the Firebug extension to it:

profile = Selenium::WebDriver::Firefox::Profile.new
profile.enable_firebug

This can also be used to enable Firebug on a remote browser:

Capybara::Driver::Selenium.new(app,
   :browser => :remote,
   :url => "http://my.ip.add.ress:4444/wd/hub",
   :desired_capabilities => Selenium::WebDriver::Remote::Capabilities.firefox(:firefox_profile => profile))

Upgrading from 1.x

Cucumber and RSpec support has been split into separate files. You'll need to change spec_helper.rb to require 'capybara/firebug/rspec' or env.rb to require 'capybara/firebug/cucumber'.

A "stop and let me debug" step definition is no longer provided. You can add it yourself if needed:

Then /^stop and let me debug$/ do
  debugger
end

Ruby 1.8.x is no longer supported. Please upgrade to 2.0 or later.

capybara-firebug's People

Contributors

danielfrey avatar gregolsen avatar grzuy avatar jfirebaugh avatar johnbintz avatar joliss avatar leshill avatar myabc avatar ronny avatar werkshy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

capybara-firebug's Issues

Firebug 1.11

Hi,

it doesn't work with Firebug 1.11, Firebug simply doesn't show up.

what I could try?

thanks!

In acceptance testing

Is there anyway I can use firebug on selenium-webdriver with acceptance testing? I am using steak for acceptance testing.

execution expired (Timeout::Error)

I tried it out and changed 1 scenario to @firebug from @javascript, and I suddenly saw many errors like this (even on other scenarios).

execution expired (Timeout::Error)
/home/ramon/.rvm/rubies/ree-1.8.7-2011.03/lib/ruby/1.8/timeout.rb:64:in `rbuf_fill'
/home/ramon/.rvm/rubies/ree-1.8.7-2011.03/lib/ruby/1.8/net/protocol.rb:134:in `rbuf_fill'
/home/ramon/.rvm/rubies/ree-1.8.7-2011.03/lib/ruby/1.8/net/protocol.rb:116:in `readuntil'
/home/ramon/.rvm/rubies/ree-1.8.7-2011.03/lib/ruby/1.8/net/protocol.rb:126:in `readline'
/home/ramon/.rvm/rubies/ree-1.8.7-2011.03/lib/ruby/1.8/net/http.rb:2028:in `read_status_line'
/home/ramon/.rvm/rubies/ree-1.8.7-2011.03/lib/ruby/1.8/net/http.rb:2017:in `read_new'
/home/ramon/.rvm/rubies/ree-1.8.7-2011.03/lib/ruby/1.8/net/http.rb:1051:in `request'
/home/ramon/.rvm/rubies/ree-1.8.7-2011.03/lib/ruby/1.8/net/http.rb:1037:in `request'
/home/ramon/.rvm/rubies/ree-1.8.7-2011.03/lib/ruby/1.8/net/http.rb:543:in `start'
/home/ramon/.rvm/rubies/ree-1.8.7-2011.03/lib/ruby/1.8/net/http.rb:1035:in `request'
./features/step_definitions/web_steps.rb:20:in `/^(?:|I )am on (.+)$/'
features/manage_pages.feature:115:in `Given I have a site "Fancake", and I am the moderator "bob"'

no such file to load -- ruby-debug (LoadError)

Then stop and let me debug # capybara-firebug-0.0.7/lib/capybara/firebug.rb:43 no such file to load -- ruby-debug (LoadError)

I think specifying dependencies in .gemspec will fix this

Add RSpec howto to enable capybara-firebug

In order to use the gem, we had to add the following to our spec_helper.rb.

Perhaps this should be added to the readme documentation?

RSpec.configure do |config|
  config.before(:each, firebug: true) do
    Capybara.current_driver = :selenium_with_firebug
  end
end

How to enable for remote browser?

I am using selenium with a remote browser (cucumber is executed remotely, and the browser triggered is on my desktop). How can I get this to work when it is triggering a remote browser? Here's what I've got in my env.rb:

# Capybara configuration (using Selenium)
require 'capybara'
require 'capybara/dsl'
require 'capybara/cucumber'
require 'capybara/firebug'

Capybara.default_driver = :selenium
Capybara.javascript_driver = :selenium
Capybara.run_server = false
#Capybara.app_host = "https://google.com" # this is replaced in my Before hook
Capybara.register_driver :selenium do |app|
  Capybara::Driver::Selenium.new(app,
    :browser => :remote,
    :url => "http://my.ip.add.ress:4444/wd/hub",
    :desired_capabilities => :firefox)
end

World(Capybara)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.