capybara-firebug 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore ADDED
@@ -0,0 +1,4 @@
1
+ *.gem
2
+ .bundle
3
+ Gemfile.lock
4
+ pkg/*
data/Gemfile ADDED
@@ -0,0 +1,6 @@
1
+ source "http://rubygems.org"
2
+
3
+ gemspec
4
+
5
+ gem 'ruby-debug', :platforms => :mri_18
6
+ gem 'ruby-debug19', :platforms => :mri_19
data/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2011 John Firebaugh
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21
+
22
+ Firebug is BSD licensed, see lib/capybara-firebug/firebug-license.txt
data/README.md ADDED
@@ -0,0 +1,13 @@
1
+ capybara-firebug provides a dead-simple way to run scenarios with Firebug
2
+ enabled under the selenium driver.
3
+
4
+ 1. Install the gem
5
+ 2. `require 'capybara/firebug'` in env.rb
6
+ 3. Tag a scenario with `@firebug`
7
+ 4. Run it
8
+
9
+ Firebug will be set up so that all features are fully enabled on every page.
10
+
11
+ You'll want to be able to pause the scenario at some point to inspect things
12
+ in Firebug. A step definition for `Then stop and let me debug` is provided
13
+ for this purpose. When executed, it breaks in the Ruby debugger.
data/Rakefile ADDED
@@ -0,0 +1,7 @@
1
+ require 'bundler'
2
+ require 'cucumber/rake/task'
3
+
4
+ Bundler::GemHelper.install_tasks
5
+ Cucumber::Rake::Task.new
6
+
7
+ task :default => :cucumber
@@ -0,0 +1,25 @@
1
+ # -*- encoding: utf-8 -*-
2
+
3
+ Gem::Specification.new do |s|
4
+ s.name = "capybara-firebug"
5
+ s.version = "0.0.1"
6
+ s.platform = Gem::Platform::RUBY
7
+ s.authors = ["John Firebaugh"]
8
+ s.email = ["john.firebaugh@gmail.com"]
9
+ s.homepage = "https://github.com/jfirebaugh/capybara-firebug"
10
+ s.summary = %q{Run selenium with Firebug enabled}
11
+ s.description = %q{Provides a dead-simple way to run scenarios with Firebug
12
+ enabled under the selenium driver.}
13
+
14
+ s.rubyforge_project = "capybara-firebug"
15
+
16
+ s.files = `git ls-files`.split("\n")
17
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
18
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
19
+ s.require_paths = ["lib"]
20
+
21
+ s.add_dependency "cucumber", "~> 0.10.0"
22
+ s.add_dependency "capybara", "~> 0.4.1.2"
23
+
24
+ s.add_development_dependency "rspec", "~> 2.0"
25
+ end
@@ -0,0 +1,11 @@
1
+ Feature: @firebug tag
2
+ As a developer
3
+ I want to tag my scenarios with @firebug
4
+ So I can use Firebug to debug failures
5
+
6
+ @firebug
7
+ Scenario: A scenario with the @firebug tag
8
+ When I visit "http://rubygems.org/"
9
+ Then I should be on "http://rubygems.org/"
10
+ And Firebug should be active
11
+ Then stop and let me debug
@@ -0,0 +1,11 @@
1
+ When /^I visit "([^"]+)"$/ do |page|
2
+ visit(page)
3
+ end
4
+
5
+ Then /^I should be on "([^"]+)"$/ do |page|
6
+ current_url.should == page
7
+ end
8
+
9
+ Then /^Firebug should be active$/ do
10
+ evaluate_script('window.console.firebug').should_not be_nil
11
+ end
@@ -0,0 +1,5 @@
1
+ require 'bundler'
2
+ Bundler.require
3
+
4
+ require 'capybara/cucumber'
5
+ require 'capybara/firebug'
@@ -0,0 +1,6 @@
1
+ # Nothing is required by default, so you can specify `gem 'capybara-firebug'` in
2
+ # your Gemfile without actually loading any code (which requires the cucumber
3
+ # environment established by the 'cucumber' command).
4
+
5
+ # To load the firebug, require 'capybara-firebug/cucumber' within a file in
6
+ # features/support/ or features/step_definitions/.
Binary file
@@ -0,0 +1,30 @@
1
+ Software License Agreement (BSD License)
2
+
3
+ Copyright (c) 2007, Parakey Inc.
4
+ All rights reserved.
5
+
6
+ Redistribution and use of this software in source and binary forms, with or without modification,
7
+ are permitted provided that the following conditions are met:
8
+
9
+ * Redistributions of source code must retain the above
10
+ copyright notice, this list of conditions and the
11
+ following disclaimer.
12
+
13
+ * Redistributions in binary form must reproduce the above
14
+ copyright notice, this list of conditions and the
15
+ following disclaimer in the documentation and/or other
16
+ materials provided with the distribution.
17
+
18
+ * Neither the name of Parakey Inc. nor the names of its
19
+ contributors may be used to endorse or promote products
20
+ derived from this software without specific prior
21
+ written permission of Parakey Inc.
22
+
23
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
24
+ IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
25
+ FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
26
+ CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
29
+ IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
30
+ OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -0,0 +1,31 @@
1
+ require 'selenium/webdriver'
2
+
3
+ Capybara.register_driver :selenium_with_firebug do |app|
4
+ profile = Selenium::WebDriver::Firefox::Profile.new
5
+ profile.add_extension(File.expand_path("../firebug-1.6.2.xpi", __FILE__))
6
+
7
+ # Prevent "Welcome!" tab
8
+ profile["extensions.firebug.currentVersion"] = "999"
9
+
10
+ # Enable for all sites.
11
+ profile["extensions.firebug.allPagesActivation"] = "on"
12
+
13
+ # Enable all features.
14
+ ['console', 'net', 'script'].each do |feature|
15
+ profile["extensions.firebug.#{feature}.enableSites"] = true
16
+ end
17
+
18
+ # Closed by default.
19
+ profile["extensions.firebug.previousPlacement"] = 3
20
+
21
+ Capybara::Driver::Selenium.new(app, :browser => :firefox, :profile => profile)
22
+ end
23
+
24
+ Before '@firebug' do
25
+ Capybara.current_driver = :selenium_with_firebug
26
+ end
27
+
28
+ Then /^stop and let me debug$/ do
29
+ require 'ruby-debug'
30
+ debugger
31
+ end
metadata ADDED
@@ -0,0 +1,125 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: capybara-firebug
3
+ version: !ruby/object:Gem::Version
4
+ prerelease: false
5
+ segments:
6
+ - 0
7
+ - 0
8
+ - 1
9
+ version: 0.0.1
10
+ platform: ruby
11
+ authors:
12
+ - John Firebaugh
13
+ autorequire:
14
+ bindir: bin
15
+ cert_chain: []
16
+
17
+ date: 2011-03-06 00:00:00 -08:00
18
+ default_executable:
19
+ dependencies:
20
+ - !ruby/object:Gem::Dependency
21
+ name: cucumber
22
+ prerelease: false
23
+ requirement: &id001 !ruby/object:Gem::Requirement
24
+ none: false
25
+ requirements:
26
+ - - ~>
27
+ - !ruby/object:Gem::Version
28
+ segments:
29
+ - 0
30
+ - 10
31
+ - 0
32
+ version: 0.10.0
33
+ type: :runtime
34
+ version_requirements: *id001
35
+ - !ruby/object:Gem::Dependency
36
+ name: capybara
37
+ prerelease: false
38
+ requirement: &id002 !ruby/object:Gem::Requirement
39
+ none: false
40
+ requirements:
41
+ - - ~>
42
+ - !ruby/object:Gem::Version
43
+ segments:
44
+ - 0
45
+ - 4
46
+ - 1
47
+ - 2
48
+ version: 0.4.1.2
49
+ type: :runtime
50
+ version_requirements: *id002
51
+ - !ruby/object:Gem::Dependency
52
+ name: rspec
53
+ prerelease: false
54
+ requirement: &id003 !ruby/object:Gem::Requirement
55
+ none: false
56
+ requirements:
57
+ - - ~>
58
+ - !ruby/object:Gem::Version
59
+ segments:
60
+ - 2
61
+ - 0
62
+ version: "2.0"
63
+ type: :development
64
+ version_requirements: *id003
65
+ description: |-
66
+ Provides a dead-simple way to run scenarios with Firebug
67
+ enabled under the selenium driver.
68
+ email:
69
+ - john.firebaugh@gmail.com
70
+ executables: []
71
+
72
+ extensions: []
73
+
74
+ extra_rdoc_files: []
75
+
76
+ files:
77
+ - .gitignore
78
+ - Gemfile
79
+ - LICENSE
80
+ - README.md
81
+ - Rakefile
82
+ - capybara-firebug.gemspec
83
+ - features/firebug.feature
84
+ - features/step_definitions/web_steps.rb
85
+ - features/support/env.rb
86
+ - lib/capybara-firebug.rb
87
+ - lib/capybara/firebug-1.6.2.xpi
88
+ - lib/capybara/firebug-license.txt
89
+ - lib/capybara/firebug.rb
90
+ has_rdoc: true
91
+ homepage: https://github.com/jfirebaugh/capybara-firebug
92
+ licenses: []
93
+
94
+ post_install_message:
95
+ rdoc_options: []
96
+
97
+ require_paths:
98
+ - lib
99
+ required_ruby_version: !ruby/object:Gem::Requirement
100
+ none: false
101
+ requirements:
102
+ - - ">="
103
+ - !ruby/object:Gem::Version
104
+ segments:
105
+ - 0
106
+ version: "0"
107
+ required_rubygems_version: !ruby/object:Gem::Requirement
108
+ none: false
109
+ requirements:
110
+ - - ">="
111
+ - !ruby/object:Gem::Version
112
+ segments:
113
+ - 0
114
+ version: "0"
115
+ requirements: []
116
+
117
+ rubyforge_project: capybara-firebug
118
+ rubygems_version: 1.3.7
119
+ signing_key:
120
+ specification_version: 3
121
+ summary: Run selenium with Firebug enabled
122
+ test_files:
123
+ - features/firebug.feature
124
+ - features/step_definitions/web_steps.rb
125
+ - features/support/env.rb