capybara-firebug 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +15 -0
- data/Rakefile +4 -1
- data/capybara-firebug.gemspec +4 -2
- data/lib/capybara/firebug-1.7.0.xpi +0 -0
- data/lib/capybara/firebug.rb +3 -3
- data/spec/enable_firebug_spec.rb +13 -0
- data/spec/spec_helper.rb +5 -0
- metadata +21 -16
data/README.md
CHANGED
@@ -11,3 +11,18 @@ Firebug will be set up so that all features are fully enabled on every page.
|
|
11
11
|
You'll want to be able to pause the scenario at some point to inspect things
|
12
12
|
in Firebug. A step definition for `Then stop and let me debug` is provided
|
13
13
|
for this purpose. When executed, it breaks in the Ruby debugger.
|
14
|
+
|
15
|
+
== Customizing the Profile ==
|
16
|
+
|
17
|
+
If you wish to further customize the Firefox profile used by selenium, you
|
18
|
+
can use the `#enable_firebug` method to add the Firebug extension to it:
|
19
|
+
|
20
|
+
profile = Selenium::WebDriver::Firefox::Profile.new
|
21
|
+
profile.enable_firebug
|
22
|
+
|
23
|
+
This can also be used to enable Firebug on a remote browser:
|
24
|
+
|
25
|
+
Capybara::Driver::Selenium.new(app,
|
26
|
+
:browser => :remote,
|
27
|
+
:url => "http://my.ip.add.ress:4444/wd/hub",
|
28
|
+
:desired_capabilities => Selenium::WebDriver::Remote::Capabilities.firefox(:firefox_profile => profile))
|
data/Rakefile
CHANGED
data/capybara-firebug.gemspec
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = "capybara-firebug"
|
5
|
-
s.version = "0.0.
|
5
|
+
s.version = "0.0.4"
|
6
6
|
s.platform = Gem::Platform::RUBY
|
7
7
|
s.authors = ["John Firebaugh"]
|
8
8
|
s.email = ["john.firebaugh@gmail.com"]
|
@@ -18,8 +18,10 @@ enabled under the selenium driver.}
|
|
18
18
|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
19
19
|
s.require_paths = ["lib"]
|
20
20
|
|
21
|
-
|
21
|
+
# We rely on this 0.4.1.2 bug fix:
|
22
|
+
# https://github.com/jnicklas/capybara/commit/90a1cf78ab782a5cb596a8c3d8611e465d591cd1
|
22
23
|
s.add_dependency "capybara", "~> 0.4.1.2"
|
23
24
|
|
24
25
|
s.add_development_dependency "rspec", "~> 2.0"
|
26
|
+
s.add_development_dependency "cucumber", "~> 0.10.0"
|
25
27
|
end
|
Binary file
|
data/lib/capybara/firebug.rb
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
require 'selenium/webdriver'
|
2
2
|
|
3
3
|
class Selenium::WebDriver::Firefox::Profile
|
4
|
-
def enable_firebug
|
5
|
-
add_extension(File.expand_path("../firebug
|
4
|
+
def enable_firebug(version = "1.6.2")
|
5
|
+
add_extension(File.expand_path("../firebug-#{version}.xpi", __FILE__))
|
6
6
|
|
7
7
|
# Prevent "Welcome!" tab
|
8
8
|
self["extensions.firebug.currentVersion"] = "999"
|
@@ -26,7 +26,7 @@ Capybara.register_driver :selenium_with_firebug do |app|
|
|
26
26
|
Capybara::Driver::Selenium.new(app, :browser => :firefox, :profile => profile)
|
27
27
|
end
|
28
28
|
|
29
|
-
if defined?(Cucumber)
|
29
|
+
if defined?(Cucumber::RbSupport)
|
30
30
|
Before '@firebug' do
|
31
31
|
Capybara.current_driver = :selenium_with_firebug
|
32
32
|
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Selenium::WebDriver::Firefox::Profile, "#enable_firebug" do
|
4
|
+
it "adds the Firebug extension" do
|
5
|
+
subject.should_receive(:add_extension).with(/firebug-1\.6\.2\.xpi$/)
|
6
|
+
subject.enable_firebug
|
7
|
+
end
|
8
|
+
|
9
|
+
it "accepts an optional version argument" do
|
10
|
+
subject.should_receive(:add_extension).with(/firebug-1\.7\.0\.xpi$/)
|
11
|
+
subject.enable_firebug("1.7.0")
|
12
|
+
end
|
13
|
+
end
|
data/spec/spec_helper.rb
ADDED
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
version: 0.0.
|
8
|
+
- 4
|
9
|
+
version: 0.0.4
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- John Firebaugh
|
@@ -14,11 +14,11 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2011-03-
|
17
|
+
date: 2011-03-30 00:00:00 -07:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
|
-
name:
|
21
|
+
name: capybara
|
22
22
|
prerelease: false
|
23
23
|
requirement: &id001 !ruby/object:Gem::Requirement
|
24
24
|
none: false
|
@@ -27,13 +27,14 @@ dependencies:
|
|
27
27
|
- !ruby/object:Gem::Version
|
28
28
|
segments:
|
29
29
|
- 0
|
30
|
-
-
|
31
|
-
-
|
32
|
-
|
30
|
+
- 4
|
31
|
+
- 1
|
32
|
+
- 2
|
33
|
+
version: 0.4.1.2
|
33
34
|
type: :runtime
|
34
35
|
version_requirements: *id001
|
35
36
|
- !ruby/object:Gem::Dependency
|
36
|
-
name:
|
37
|
+
name: rspec
|
37
38
|
prerelease: false
|
38
39
|
requirement: &id002 !ruby/object:Gem::Requirement
|
39
40
|
none: false
|
@@ -41,15 +42,13 @@ dependencies:
|
|
41
42
|
- - ~>
|
42
43
|
- !ruby/object:Gem::Version
|
43
44
|
segments:
|
44
|
-
- 0
|
45
|
-
- 4
|
46
|
-
- 1
|
47
45
|
- 2
|
48
|
-
|
49
|
-
|
46
|
+
- 0
|
47
|
+
version: "2.0"
|
48
|
+
type: :development
|
50
49
|
version_requirements: *id002
|
51
50
|
- !ruby/object:Gem::Dependency
|
52
|
-
name:
|
51
|
+
name: cucumber
|
53
52
|
prerelease: false
|
54
53
|
requirement: &id003 !ruby/object:Gem::Requirement
|
55
54
|
none: false
|
@@ -57,9 +56,10 @@ dependencies:
|
|
57
56
|
- - ~>
|
58
57
|
- !ruby/object:Gem::Version
|
59
58
|
segments:
|
60
|
-
- 2
|
61
59
|
- 0
|
62
|
-
|
60
|
+
- 10
|
61
|
+
- 0
|
62
|
+
version: 0.10.0
|
63
63
|
type: :development
|
64
64
|
version_requirements: *id003
|
65
65
|
description: |-
|
@@ -85,8 +85,11 @@ files:
|
|
85
85
|
- features/support/env.rb
|
86
86
|
- lib/capybara-firebug.rb
|
87
87
|
- lib/capybara/firebug-1.6.2.xpi
|
88
|
+
- lib/capybara/firebug-1.7.0.xpi
|
88
89
|
- lib/capybara/firebug-license.txt
|
89
90
|
- lib/capybara/firebug.rb
|
91
|
+
- spec/enable_firebug_spec.rb
|
92
|
+
- spec/spec_helper.rb
|
90
93
|
has_rdoc: true
|
91
94
|
homepage: https://github.com/jfirebaugh/capybara-firebug
|
92
95
|
licenses: []
|
@@ -123,3 +126,5 @@ test_files:
|
|
123
126
|
- features/firebug.feature
|
124
127
|
- features/step_definitions/web_steps.rb
|
125
128
|
- features/support/env.rb
|
129
|
+
- spec/enable_firebug_spec.rb
|
130
|
+
- spec/spec_helper.rb
|