capybara-firebug 1.0.1 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +9 -8
- data/capybara-firebug.gemspec +1 -1
- data/features/step_definitions/web_steps.rb +1 -1
- data/lib/capybara/firebug-1.9.1.xpi +0 -0
- data/lib/capybara/firebug.rb +9 -1
- data/spec/enable_firebug_spec.rb +3 -3
- data/spec/rspec_configuration_spec.rb +13 -0
- data/spec/spec_helper.rb +1 -0
- metadata +8 -8
- data/lib/capybara/firebug-1.8.4.xpi +0 -0
data/README.md
CHANGED
@@ -1,10 +1,12 @@
|
|
1
|
-
capybara-firebug provides a dead-simple way to run
|
2
|
-
enabled under the selenium driver.
|
1
|
+
capybara-firebug provides a dead-simple way to run Capybara-based Cucumber
|
2
|
+
scenarios or RSpec request specs with Firebug enabled under the selenium driver.
|
3
3
|
|
4
4
|
1. Install the gem
|
5
|
-
2. `require 'capybara/firebug'` in env.rb
|
6
|
-
3. Tag
|
7
|
-
|
5
|
+
2. `require 'capybara/firebug'` in env.rb or spec_helper.rb
|
6
|
+
3. Tag the tests you need to debug:
|
7
|
+
- Tag Cucumber scenarios with `@firebug`
|
8
|
+
- Tag RSpec examples with `:firebug => true`
|
9
|
+
4. Run 'em
|
8
10
|
|
9
11
|
Firebug will be set up so that all features are fully enabled on every page.
|
10
12
|
|
@@ -16,10 +18,9 @@ Gemfile: `gem 'ruby-debug'` for 1.8, `gem 'ruby-debug19'` for 1.9.)
|
|
16
18
|
|
17
19
|
## Firebug Versions
|
18
20
|
|
19
|
-
By default, this gem uses Firebug 1.
|
20
|
-
6, 7, 8, and 9.
|
21
|
+
By default, this gem uses Firebug 1.9.1, which is compatible with Firefox 6-11.
|
21
22
|
|
22
|
-
If you want to use Firebug 1.7.3 (compatible with Firefox 3.6, 4
|
23
|
+
If you want to use Firebug 1.7.3 (compatible with Firefox 3.6, 4, and 5), you
|
23
24
|
need to explicitly specify the firebug_version setting in your `capybara.rb`
|
24
25
|
support file:
|
25
26
|
|
data/capybara-firebug.gemspec
CHANGED
@@ -7,5 +7,5 @@ Then /^I should be on "([^"]+)"$/ do |page|
|
|
7
7
|
end
|
8
8
|
|
9
9
|
Then /^Firebug should be active$/ do
|
10
|
-
evaluate_script('window.console.firebug').
|
10
|
+
evaluate_script('!!(window.console && (window.console.firebug || window.console.exception))').should be_true
|
11
11
|
end
|
Binary file
|
data/lib/capybara/firebug.rb
CHANGED
@@ -2,7 +2,7 @@ require 'selenium/webdriver'
|
|
2
2
|
|
3
3
|
class Selenium::WebDriver::Firefox::Profile
|
4
4
|
def self.firebug_version
|
5
|
-
@firebug_version ||= '1.
|
5
|
+
@firebug_version ||= '1.9.1'
|
6
6
|
end
|
7
7
|
|
8
8
|
def self.firebug_version=(version)
|
@@ -45,3 +45,11 @@ if defined?(Cucumber::RbSupport)
|
|
45
45
|
debugger
|
46
46
|
end
|
47
47
|
end
|
48
|
+
|
49
|
+
if defined?(RSpec::configure)
|
50
|
+
RSpec.configure do |config|
|
51
|
+
config.before(:each, :firebug => true) do
|
52
|
+
Capybara.current_driver = :selenium_with_firebug
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
data/spec/enable_firebug_spec.rb
CHANGED
@@ -4,8 +4,8 @@ describe Selenium::WebDriver::Firefox::Profile do
|
|
4
4
|
before { described_class.firebug_version = nil } # Reset
|
5
5
|
|
6
6
|
describe ".firebug_version" do
|
7
|
-
it "defaults to 1.
|
8
|
-
described_class.firebug_version.should == "1.
|
7
|
+
it "defaults to 1.9.1" do
|
8
|
+
described_class.firebug_version.should == "1.9.1"
|
9
9
|
end
|
10
10
|
|
11
11
|
it "can be explicitly set" do
|
@@ -16,7 +16,7 @@ describe Selenium::WebDriver::Firefox::Profile do
|
|
16
16
|
|
17
17
|
describe "#enable_firebug" do
|
18
18
|
it "adds the Firebug extension" do
|
19
|
-
subject.should_receive(:add_extension).with(/firebug-1\.
|
19
|
+
subject.should_receive(:add_extension).with(/firebug-1\.9\.1\.xpi$/)
|
20
20
|
subject.enable_firebug
|
21
21
|
end
|
22
22
|
|
@@ -0,0 +1,13 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe "RSpec Configuration" do
|
4
|
+
describe "configuring Capybara without Cucumber" do
|
5
|
+
it "should not set the driver to selenium_with_firebug by default" do
|
6
|
+
Capybara.current_driver.should_not == :selenium_with_firebug
|
7
|
+
end
|
8
|
+
|
9
|
+
it "should set the driver to selenium_with_firebug when tagged", :firebug => true do
|
10
|
+
Capybara.current_driver.should == :selenium_with_firebug
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: capybara-firebug
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 19
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
|
-
- 0
|
9
8
|
- 1
|
10
|
-
|
9
|
+
- 0
|
10
|
+
version: 1.1.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- John Firebaugh
|
@@ -15,8 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2012-
|
19
|
-
default_executable:
|
18
|
+
date: 2012-02-10 00:00:00 Z
|
20
19
|
dependencies:
|
21
20
|
- !ruby/object:Gem::Dependency
|
22
21
|
name: capybara
|
@@ -87,12 +86,12 @@ files:
|
|
87
86
|
- features/support/env.rb
|
88
87
|
- lib/capybara-firebug.rb
|
89
88
|
- lib/capybara/firebug-1.7.3.xpi
|
90
|
-
- lib/capybara/firebug-1.
|
89
|
+
- lib/capybara/firebug-1.9.1.xpi
|
91
90
|
- lib/capybara/firebug-license.txt
|
92
91
|
- lib/capybara/firebug.rb
|
93
92
|
- spec/enable_firebug_spec.rb
|
93
|
+
- spec/rspec_configuration_spec.rb
|
94
94
|
- spec/spec_helper.rb
|
95
|
-
has_rdoc: true
|
96
95
|
homepage: https://github.com/jfirebaugh/capybara-firebug
|
97
96
|
licenses: []
|
98
97
|
|
@@ -122,7 +121,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
122
121
|
requirements: []
|
123
122
|
|
124
123
|
rubyforge_project: capybara-firebug
|
125
|
-
rubygems_version: 1.
|
124
|
+
rubygems_version: 1.8.15
|
126
125
|
signing_key:
|
127
126
|
specification_version: 3
|
128
127
|
summary: Run selenium with Firebug enabled
|
@@ -131,4 +130,5 @@ test_files:
|
|
131
130
|
- features/step_definitions/web_steps.rb
|
132
131
|
- features/support/env.rb
|
133
132
|
- spec/enable_firebug_spec.rb
|
133
|
+
- spec/rspec_configuration_spec.rb
|
134
134
|
- spec/spec_helper.rb
|
Binary file
|