Skip to content

Instantly share code, notes, and snippets.

@attilagyorffy
Created November 29, 2011 14:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save attilagyorffy/1405063 to your computer and use it in GitHub Desktop.
Save attilagyorffy/1405063 to your computer and use it in GitHub Desktop.
Capybara, with Selenium and Firebug
Capybara.register_driver :selenium do |app|
Capybara::Selenium::Driver # this line ensures that the top level Selenium module is loaded
profile = Selenium::WebDriver::Firefox::Profile.new
profile.add_extension File.expand_path "spec/support/vendor/firebug-1.8.4-fx.xpi"
profile.add_extension File.expand_path "spec/support/vendor/fireStarter-0.1a6.xpi"
profile.add_extension File.expand_path "spec/support/vendor/netExport-0.8b20.xpi"
# Configures Firebug - look at http://getfirebug.com/developer/api/firebug1.6/symbols/src/defaults_preferences_firebug.js.html
profile['extensions.firebug.currentVersion'] = "1.8.4" # avoid 'first run' tab
profile["extensions.firebug.previousPlacement"] = 1
profile["extensions.firebug.onByDefault"] = true
profile["extensions.firebug.net.enableSites"] = true # Enables the Net Panel
profile["extensions.firebug.defaultPanelName"] = "net" # sets the default pane to Net for easier access
Capybara::Selenium::Driver.new(app, { :browser => :firefox, :profile => profile })
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment