cucumber_off_rails 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.document +5 -0
- data/Gemfile +21 -0
- data/Gemfile.lock +78 -0
- data/LICENSE.txt +20 -0
- data/README.rdoc +37 -0
- data/Rakefile +55 -0
- data/VERSION +1 -0
- data/bin/cucumber_off_rails +1 -0
- data/lib/cucumber_off_rails.rb +0 -0
- data/lib/generators/cucumber_off_rails/install_generator.rb +1 -0
- data/lib/generators/cucumber_off_rails/templates/Gemfile +9 -0
- data/lib/generators/cucumber_off_rails/templates/Rakefile +38 -0
- data/lib/generators/cucumber_off_rails/templates/features/.htaccess +4 -0
- data/lib/generators/cucumber_off_rails/templates/features/sample.feature +13 -0
- data/lib/generators/cucumber_off_rails/templates/features/step_definitions/debugging_steps.rb +11 -0
- data/lib/generators/cucumber_off_rails/templates/features/step_definitions/linking_steps.rb +46 -0
- data/lib/generators/cucumber_off_rails/templates/features/step_definitions/login_steps.rb +5 -0
- data/lib/generators/cucumber_off_rails/templates/features/step_definitions/selector_steps.rb +18 -0
- data/lib/generators/cucumber_off_rails/templates/features/step_definitions/validations_steps.rb +43 -0
- data/lib/generators/cucumber_off_rails/templates/features/support/env.rb +20 -0
- data/lib/generators/cucumber_off_rails/templates/features/support/hooks.rb +17 -0
- data/lib/generators/cucumber_off_rails/templates/features/support/paths.rb +19 -0
- data/lib/generators/cucumber_off_rails/templates/features/support/selectors.rb +39 -0
- data/lib/generators/cucumber_off_rails/update_generator.rb +0 -0
- data/spec/cucumber_off_rails_spec.rb +0 -0
- data/spec/spec_helper.rb +12 -0
- metadata +181 -0
data/.document
ADDED
data/Gemfile
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
source "http://rubygems.org"
|
2
|
+
# Add dependencies required to use your gem here.
|
3
|
+
# Example:
|
4
|
+
# gem "activesupport", ">= 2.3.5"
|
5
|
+
|
6
|
+
# Add dependencies to develop your gem here.
|
7
|
+
# Include everything needed to run rake, tests, features, etc.
|
8
|
+
group :development do
|
9
|
+
gem "shoulda", ">= 0"
|
10
|
+
gem "bundler", "~> 1.0.0"
|
11
|
+
gem "jeweler", "~> 1.6.3"
|
12
|
+
gem "rcov", ">= 0"
|
13
|
+
|
14
|
+
# gems used by the generated files
|
15
|
+
gem "cucumber"
|
16
|
+
gem "mechanize", "~>1.0.0"
|
17
|
+
gem "rspec"
|
18
|
+
gem "capybara", "~>0.4.0"
|
19
|
+
gem "capybara-mechanize", "~>0.2.7"
|
20
|
+
end
|
21
|
+
|
data/Gemfile.lock
ADDED
@@ -0,0 +1,78 @@
|
|
1
|
+
GEM
|
2
|
+
remote: http://rubygems.org/
|
3
|
+
specs:
|
4
|
+
builder (3.0.0)
|
5
|
+
capybara (0.4.1.2)
|
6
|
+
celerity (>= 0.7.9)
|
7
|
+
culerity (>= 0.2.4)
|
8
|
+
mime-types (>= 1.16)
|
9
|
+
nokogiri (>= 1.3.3)
|
10
|
+
rack (>= 1.0.0)
|
11
|
+
rack-test (>= 0.5.4)
|
12
|
+
selenium-webdriver (>= 0.0.27)
|
13
|
+
xpath (~> 0.1.3)
|
14
|
+
capybara-mechanize (0.2.7)
|
15
|
+
capybara (~> 0.4.0)
|
16
|
+
mechanize (~> 1.0.0)
|
17
|
+
celerity (0.8.9)
|
18
|
+
childprocess (0.1.9)
|
19
|
+
ffi (~> 1.0.6)
|
20
|
+
cucumber (1.0.1)
|
21
|
+
builder (>= 2.1.2)
|
22
|
+
diff-lcs (>= 1.1.2)
|
23
|
+
gherkin (~> 2.4.5)
|
24
|
+
json (>= 1.4.6)
|
25
|
+
term-ansicolor (>= 1.0.5)
|
26
|
+
culerity (0.2.15)
|
27
|
+
diff-lcs (1.1.2)
|
28
|
+
ffi (1.0.9)
|
29
|
+
gherkin (2.4.5)
|
30
|
+
json (>= 1.4.6)
|
31
|
+
git (1.2.5)
|
32
|
+
jeweler (1.6.3)
|
33
|
+
bundler (~> 1.0)
|
34
|
+
git (>= 1.2.5)
|
35
|
+
rake
|
36
|
+
json (1.5.3)
|
37
|
+
json_pure (1.5.3)
|
38
|
+
mechanize (1.0.0)
|
39
|
+
nokogiri (>= 1.2.1)
|
40
|
+
mime-types (1.16)
|
41
|
+
nokogiri (1.5.0)
|
42
|
+
rack (1.3.1)
|
43
|
+
rack-test (0.6.0)
|
44
|
+
rack (>= 1.0)
|
45
|
+
rake (0.9.2)
|
46
|
+
rcov (0.9.9)
|
47
|
+
rspec (2.6.0)
|
48
|
+
rspec-core (~> 2.6.0)
|
49
|
+
rspec-expectations (~> 2.6.0)
|
50
|
+
rspec-mocks (~> 2.6.0)
|
51
|
+
rspec-core (2.6.4)
|
52
|
+
rspec-expectations (2.6.0)
|
53
|
+
diff-lcs (~> 1.1.2)
|
54
|
+
rspec-mocks (2.6.0)
|
55
|
+
rubyzip (0.9.4)
|
56
|
+
selenium-webdriver (2.0.1)
|
57
|
+
childprocess (>= 0.1.9)
|
58
|
+
ffi (>= 1.0.7)
|
59
|
+
json_pure
|
60
|
+
rubyzip
|
61
|
+
shoulda (2.11.3)
|
62
|
+
term-ansicolor (1.0.5)
|
63
|
+
xpath (0.1.4)
|
64
|
+
nokogiri (~> 1.3)
|
65
|
+
|
66
|
+
PLATFORMS
|
67
|
+
ruby
|
68
|
+
|
69
|
+
DEPENDENCIES
|
70
|
+
bundler (~> 1.0.0)
|
71
|
+
capybara (~> 0.4.0)
|
72
|
+
capybara-mechanize (~> 0.2.7)
|
73
|
+
cucumber
|
74
|
+
jeweler (~> 1.6.3)
|
75
|
+
mechanize (~> 1.0.0)
|
76
|
+
rcov
|
77
|
+
rspec
|
78
|
+
shoulda
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2011 Jeremiah Hemphill
|
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.
|
data/README.rdoc
ADDED
@@ -0,0 +1,37 @@
|
|
1
|
+
= cucumber_off_rails
|
2
|
+
|
3
|
+
Nondestructive cucumber testing without the rails stack. Setup to work with the hudson/jenkins ci system to run regular tests on your project. The capybara-mechanize gem is used to fetch remote sites and capybara bathcers are used to verify the data.
|
4
|
+
|
5
|
+
= install
|
6
|
+
|
7
|
+
Run the installation generator
|
8
|
+
|
9
|
+
cucumber_off_rails install --site http://yoursitehere.com
|
10
|
+
|
11
|
+
This will generate a basic cucumber environment.
|
12
|
+
|
13
|
+
= future work
|
14
|
+
|
15
|
+
* Fix the cucumber rake tasks
|
16
|
+
* Add login support
|
17
|
+
* Version the gems
|
18
|
+
* Add support to specify the site in the generator
|
19
|
+
* Write the generators
|
20
|
+
* Setup javascript tests
|
21
|
+
* Setup hudson support
|
22
|
+
|
23
|
+
== Contributing to cucumber_off_rails
|
24
|
+
|
25
|
+
* Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
|
26
|
+
* Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
|
27
|
+
* Fork the project
|
28
|
+
* Start a feature/bugfix branch
|
29
|
+
* Commit and push until you are happy with your contribution
|
30
|
+
* Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
|
31
|
+
* Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
|
32
|
+
|
33
|
+
== Copyright
|
34
|
+
|
35
|
+
Copyright (c) 2011 Jeremiah Hemphill. See LICENSE.txt for
|
36
|
+
further details.
|
37
|
+
|
data/Rakefile
ADDED
@@ -0,0 +1,55 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
require 'rubygems'
|
4
|
+
require 'bundler'
|
5
|
+
begin
|
6
|
+
Bundler.setup(:default, :development)
|
7
|
+
rescue Bundler::BundlerError => e
|
8
|
+
$stderr.puts e.message
|
9
|
+
$stderr.puts "Run `bundle install` to install missing gems"
|
10
|
+
exit e.status_code
|
11
|
+
end
|
12
|
+
require 'rake'
|
13
|
+
|
14
|
+
require 'jeweler'
|
15
|
+
Jeweler::Tasks.new do |gem|
|
16
|
+
# gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
|
17
|
+
gem.name = "cucumber_off_rails"
|
18
|
+
gem.homepage = "http://github.com/jeremiahishere/cucumber_off_rails"
|
19
|
+
gem.license = "MIT"
|
20
|
+
gem.summary = %Q{Nondestructive Cucumber Testing}
|
21
|
+
gem.description = %Q{Nondestructive cucumber testing without using the rails stack setup for Hudson/Jenkins integration}
|
22
|
+
gem.email = "jeremiah@cloudspace.com"
|
23
|
+
gem.authors = ["Jeremiah Hemphill"]
|
24
|
+
gem.bindir = 'bin'
|
25
|
+
gem.executables = ['cucumber_off_rails']
|
26
|
+
# dependencies defined in Gemfile
|
27
|
+
end
|
28
|
+
Jeweler::RubygemsDotOrgTasks.new
|
29
|
+
|
30
|
+
require 'rake/testtask'
|
31
|
+
Rake::TestTask.new(:test) do |test|
|
32
|
+
test.libs << 'lib' << 'test'
|
33
|
+
test.pattern = 'test/**/test_*.rb'
|
34
|
+
test.verbose = true
|
35
|
+
end
|
36
|
+
|
37
|
+
require 'rcov/rcovtask'
|
38
|
+
Rcov::RcovTask.new do |test|
|
39
|
+
test.libs << 'test'
|
40
|
+
test.pattern = 'test/**/test_*.rb'
|
41
|
+
test.verbose = true
|
42
|
+
test.rcov_opts << '--exclude "gems/*"'
|
43
|
+
end
|
44
|
+
|
45
|
+
task :default => :test
|
46
|
+
|
47
|
+
require 'rake/rdoctask'
|
48
|
+
Rake::RDocTask.new do |rdoc|
|
49
|
+
version = File.exist?('VERSION') ? File.read('VERSION') : ""
|
50
|
+
|
51
|
+
rdoc.rdoc_dir = 'rdoc'
|
52
|
+
rdoc.title = "cucumber_off_rails #{version}"
|
53
|
+
rdoc.rdoc_files.include('README*')
|
54
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
55
|
+
end
|
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
0.0.1
|
@@ -0,0 +1 @@
|
|
1
|
+
require "lib/generators/install_generator"
|
File without changes
|
@@ -0,0 +1 @@
|
|
1
|
+
puts "hello"
|
@@ -0,0 +1,38 @@
|
|
1
|
+
begin
|
2
|
+
require 'cucumber/rake/task'
|
3
|
+
|
4
|
+
namespace :cucumber do
|
5
|
+
|
6
|
+
task :ok do
|
7
|
+
%x{cucumber --format progress --strict --tags ~@wip features 1>&2}
|
8
|
+
end
|
9
|
+
|
10
|
+
task :wip do
|
11
|
+
%x{cucumber --format progress --strict --tags @wip:3 --wip features 1>&2}
|
12
|
+
end
|
13
|
+
|
14
|
+
task :hudson_format do
|
15
|
+
report_path = 'features/reports/'
|
16
|
+
rm_rf report_path
|
17
|
+
mkdir_p report_path
|
18
|
+
%x{cucumber --format junit --out #{report_path}}
|
19
|
+
end
|
20
|
+
|
21
|
+
desc 'Run all features'
|
22
|
+
task :all => [:ok, :wip]
|
23
|
+
|
24
|
+
task :hudson => [:hudson_format]
|
25
|
+
end
|
26
|
+
|
27
|
+
desc 'Alias for cucumber:ok'
|
28
|
+
task :cucumber => ['cucumber:ok']
|
29
|
+
|
30
|
+
task :default => :cucumber
|
31
|
+
|
32
|
+
rescue LoadError
|
33
|
+
desc 'cucumber rake task not available (cucumber not installed)'
|
34
|
+
task :cucumber do
|
35
|
+
abort 'Cucumber rake task is not available. Be sure to install cucumber as a gem or plugin'
|
36
|
+
end
|
37
|
+
end
|
38
|
+
require 'rake'
|
@@ -0,0 +1,13 @@
|
|
1
|
+
Feature: Testing feature system
|
2
|
+
|
3
|
+
Scenario: Homepage test
|
4
|
+
Given I am on the home page
|
5
|
+
Then I should see "Privacy"
|
6
|
+
And I should see "Business Solutions"
|
7
|
+
And I should see "About Google"
|
8
|
+
|
9
|
+
Scenario: Feeling luck test
|
10
|
+
Given I am on the home page
|
11
|
+
When I press "I'm Feeling Lucky"
|
12
|
+
Then I should be on path "/search"
|
13
|
+
|
@@ -0,0 +1,46 @@
|
|
1
|
+
require 'uri'
|
2
|
+
require 'cgi'
|
3
|
+
require File.expand_path(File.join(File.dirname(__FILE__), "..", "support", "paths"))
|
4
|
+
|
5
|
+
Given(/^(?:|I )am on (.+)$/) do |page_name|
|
6
|
+
visit path_to(page_name)
|
7
|
+
end
|
8
|
+
|
9
|
+
When( /^(?:|I )go to (.+)$/) do |page_name|
|
10
|
+
visit path_to(page_name)
|
11
|
+
end
|
12
|
+
|
13
|
+
When(/^(?:|I )press "([^"]*)"(?: within "([^"]*)")?$/) do |button, selector|
|
14
|
+
with_scope(selector) do
|
15
|
+
click_button(button)
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
When(/^(?:|I )follow "([^"]*)"(?: within "([^"]*)")?$/) do |link, selector|
|
20
|
+
with_scope(selector) do
|
21
|
+
click_link(link)
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
Then(/^(?:|I )should be on (.+)$/) do |page_name|
|
26
|
+
# given method
|
27
|
+
current_path = URI.parse(current_url).path
|
28
|
+
if current_path.respond_to? :should
|
29
|
+
current_path.should == path_to(page_name)
|
30
|
+
else
|
31
|
+
assert_equal path_to(page_name), current_path
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
Then(/^(?:|I )should have the following query string:$/) do |expected_pairs|
|
36
|
+
query = URI.parse(current_url).query
|
37
|
+
actual_params = query ? CGI.parse(query) : {}
|
38
|
+
expected_params = {}
|
39
|
+
expected_pairs.rows_hash.each_pair{|k,v| expected_params[k] = v.split(',')}
|
40
|
+
|
41
|
+
if actual_params.respond_to? :should
|
42
|
+
actual_params.should == expected_params
|
43
|
+
else
|
44
|
+
assert_equal expected_params, actual_params
|
45
|
+
end
|
46
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
require File.expand_path(File.join(File.dirname(__FILE__), "..", "support", "selectors"))
|
2
|
+
|
3
|
+
module WithinHelpers
|
4
|
+
def with_scope(locator)
|
5
|
+
locator ? within(*selector_for(locator)) { yield } : yield
|
6
|
+
end
|
7
|
+
end
|
8
|
+
World(WithinHelpers)
|
9
|
+
|
10
|
+
# Single-line step scoper
|
11
|
+
When /^(.*) within (.*[^:])$/ do |step, parent|
|
12
|
+
with_scope(parent) { When step }
|
13
|
+
end
|
14
|
+
|
15
|
+
# Multi-line step scoper
|
16
|
+
When /^(.*) within (.*[^:]):$/ do |step, parent, table_or_string|
|
17
|
+
with_scope(parent) { When "#{step}:", table_or_string }
|
18
|
+
end
|
data/lib/generators/cucumber_off_rails/templates/features/step_definitions/validations_steps.rb
ADDED
@@ -0,0 +1,43 @@
|
|
1
|
+
Then(/^(?:|I )should see "([^"]*)"(?: within "([^"]*)")?$/) do |text, selector|
|
2
|
+
with_scope(selector) do
|
3
|
+
if page.respond_to? :should
|
4
|
+
page.should have_content(text)
|
5
|
+
else
|
6
|
+
assert page.has_content?(text)
|
7
|
+
end
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
Then(/^(?:|I )should see \/([^\/]*)\/(?: within "([^"]*)")?$/) do |regexp, selector|
|
12
|
+
regexp = Regexp.new(regexp)
|
13
|
+
with_scope(selector) do
|
14
|
+
if page.respond_to? :should
|
15
|
+
page.should have_xpath('//*', :text => regexp)
|
16
|
+
else
|
17
|
+
assert page.has_xpath?('//*', :text => regexp)
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
Then(/^(?:|I )should not see "([^"]*)"(?: within "([^"]*)")?$/) do |text, selector|
|
23
|
+
with_scope(selector) do
|
24
|
+
if page.respond_to? :should
|
25
|
+
page.should have_no_content(text)
|
26
|
+
else
|
27
|
+
assert page.has_no_content?(text)
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
Then(/^(?:|I )should not see \/([^\/]*)\/(?: within "([^"]*)")?$/) do |regexp, selector|
|
33
|
+
regexp = Regexp.new(regexp)
|
34
|
+
with_scope(selector) do
|
35
|
+
if page.respond_to? :should
|
36
|
+
page.should have_no_xpath('//*', :text => regexp)
|
37
|
+
else
|
38
|
+
assert page.has_no_xpath?('//*', :text => regexp)
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# debugger
|
2
|
+
# require 'ruby-debug19'
|
3
|
+
|
4
|
+
# RSpec
|
5
|
+
require 'rspec/expectations'
|
6
|
+
|
7
|
+
# Cucumber setup
|
8
|
+
require 'capybara/cucumber'
|
9
|
+
require 'capybara/session'
|
10
|
+
require 'capybara/mechanize'
|
11
|
+
require 'cucumber/formatter/unicode'
|
12
|
+
|
13
|
+
Capybara.run_server = false
|
14
|
+
Capybara.app_host = 'http://www.google.com'
|
15
|
+
Capybara.default_selector = :css
|
16
|
+
Capybara.default_driver = :mechanize
|
17
|
+
# no selenium support for now
|
18
|
+
# Capybara.javascript_driver = :selenium
|
19
|
+
|
20
|
+
@@user = { :email => "userlogin@yoursitehere.com", :password => "password" }
|
@@ -0,0 +1,17 @@
|
|
1
|
+
AfterStep('@debug') do |scenario|
|
2
|
+
puts current_url
|
3
|
+
end
|
4
|
+
|
5
|
+
Before('@login') do |scenario|
|
6
|
+
Given %{I am on the Login page}
|
7
|
+
When %{I fill in "#{@@user[:email]}" for "Email"}
|
8
|
+
And %{I fill in "#{@@user[:password]}" for "Password"}
|
9
|
+
And %{I press "Login"}
|
10
|
+
Then %{I should be on the Homepage}
|
11
|
+
And %{I should see "Login successful!"}
|
12
|
+
end
|
13
|
+
|
14
|
+
After('@login') do |scenario|
|
15
|
+
Given %{I am on the Logout page}
|
16
|
+
Then %{I should see "Logout successful"}
|
17
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module NavigationHelpers
|
2
|
+
def path_to(page_name)
|
3
|
+
case page_name
|
4
|
+
|
5
|
+
when /home page/
|
6
|
+
'/'
|
7
|
+
when /login page/
|
8
|
+
'/'
|
9
|
+
when /path "(.+)"/
|
10
|
+
$1
|
11
|
+
|
12
|
+
else
|
13
|
+
raise "Can't find mapping from \"#{page_name}\" to a path.\n" +
|
14
|
+
"Now, go and add a mapping in #{__FILE__}"
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
World(NavigationHelpers)
|
@@ -0,0 +1,39 @@
|
|
1
|
+
module HtmlSelectorsHelpers
|
2
|
+
# Maps a name to a selector. Used primarily by the
|
3
|
+
#
|
4
|
+
# When /^(.+) within (.+)$/ do |step, scope|
|
5
|
+
#
|
6
|
+
# step definitions in web_steps.rb
|
7
|
+
#
|
8
|
+
def selector_for(locator)
|
9
|
+
case locator
|
10
|
+
|
11
|
+
when "the page"
|
12
|
+
"html > body"
|
13
|
+
|
14
|
+
# Add more mappings here.
|
15
|
+
# Here is an example that pulls values out of the Regexp:
|
16
|
+
#
|
17
|
+
# when /^the (notice|error|info) flash$/
|
18
|
+
# ".flash.#{$1}"
|
19
|
+
|
20
|
+
# You can also return an array to use a different selector
|
21
|
+
# type, like:
|
22
|
+
#
|
23
|
+
# when /the header/
|
24
|
+
# [:xpath, "//header"]
|
25
|
+
|
26
|
+
# This allows you to provide a quoted selector as the scope
|
27
|
+
# for "within" steps as was previously the default for the
|
28
|
+
# web steps:
|
29
|
+
when /^"(.+)"$/
|
30
|
+
$1
|
31
|
+
|
32
|
+
else
|
33
|
+
raise "Can't find mapping from \"#{locator}\" to a selector.\n" +
|
34
|
+
"Now, go and add a mapping in #{__FILE__}"
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
World(HtmlSelectorsHelpers)
|
File without changes
|
File without changes
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
# Load support files
|
2
|
+
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
|
3
|
+
|
4
|
+
RSpec.configure do |config|
|
5
|
+
# Remove this line if you don't want RSpec's should and should_not
|
6
|
+
# methods or matchers
|
7
|
+
require 'rspec/expectations'
|
8
|
+
config.include RSpec::Matchers
|
9
|
+
|
10
|
+
# == Mock Framework
|
11
|
+
config.mock_with :rspec
|
12
|
+
end
|
metadata
ADDED
@@ -0,0 +1,181 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: cucumber_off_rails
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
prerelease:
|
5
|
+
version: 0.0.1
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Jeremiah Hemphill
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
|
13
|
+
date: 2011-07-14 00:00:00 Z
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: shoulda
|
17
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
18
|
+
none: false
|
19
|
+
requirements:
|
20
|
+
- - ">="
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: "0"
|
23
|
+
type: :development
|
24
|
+
prerelease: false
|
25
|
+
version_requirements: *id001
|
26
|
+
- !ruby/object:Gem::Dependency
|
27
|
+
name: bundler
|
28
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
29
|
+
none: false
|
30
|
+
requirements:
|
31
|
+
- - ~>
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 1.0.0
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: *id002
|
37
|
+
- !ruby/object:Gem::Dependency
|
38
|
+
name: jeweler
|
39
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
40
|
+
none: false
|
41
|
+
requirements:
|
42
|
+
- - ~>
|
43
|
+
- !ruby/object:Gem::Version
|
44
|
+
version: 1.6.3
|
45
|
+
type: :development
|
46
|
+
prerelease: false
|
47
|
+
version_requirements: *id003
|
48
|
+
- !ruby/object:Gem::Dependency
|
49
|
+
name: rcov
|
50
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
51
|
+
none: false
|
52
|
+
requirements:
|
53
|
+
- - ">="
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
version: "0"
|
56
|
+
type: :development
|
57
|
+
prerelease: false
|
58
|
+
version_requirements: *id004
|
59
|
+
- !ruby/object:Gem::Dependency
|
60
|
+
name: cucumber
|
61
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
62
|
+
none: false
|
63
|
+
requirements:
|
64
|
+
- - ">="
|
65
|
+
- !ruby/object:Gem::Version
|
66
|
+
version: "0"
|
67
|
+
type: :development
|
68
|
+
prerelease: false
|
69
|
+
version_requirements: *id005
|
70
|
+
- !ruby/object:Gem::Dependency
|
71
|
+
name: mechanize
|
72
|
+
requirement: &id006 !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
74
|
+
requirements:
|
75
|
+
- - ~>
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: 1.0.0
|
78
|
+
type: :development
|
79
|
+
prerelease: false
|
80
|
+
version_requirements: *id006
|
81
|
+
- !ruby/object:Gem::Dependency
|
82
|
+
name: rspec
|
83
|
+
requirement: &id007 !ruby/object:Gem::Requirement
|
84
|
+
none: false
|
85
|
+
requirements:
|
86
|
+
- - ">="
|
87
|
+
- !ruby/object:Gem::Version
|
88
|
+
version: "0"
|
89
|
+
type: :development
|
90
|
+
prerelease: false
|
91
|
+
version_requirements: *id007
|
92
|
+
- !ruby/object:Gem::Dependency
|
93
|
+
name: capybara
|
94
|
+
requirement: &id008 !ruby/object:Gem::Requirement
|
95
|
+
none: false
|
96
|
+
requirements:
|
97
|
+
- - ~>
|
98
|
+
- !ruby/object:Gem::Version
|
99
|
+
version: 0.4.0
|
100
|
+
type: :development
|
101
|
+
prerelease: false
|
102
|
+
version_requirements: *id008
|
103
|
+
- !ruby/object:Gem::Dependency
|
104
|
+
name: capybara-mechanize
|
105
|
+
requirement: &id009 !ruby/object:Gem::Requirement
|
106
|
+
none: false
|
107
|
+
requirements:
|
108
|
+
- - ~>
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: 0.2.7
|
111
|
+
type: :development
|
112
|
+
prerelease: false
|
113
|
+
version_requirements: *id009
|
114
|
+
description: Nondestructive cucumber testing without using the rails stack setup for Hudson/Jenkins integration
|
115
|
+
email: jeremiah@cloudspace.com
|
116
|
+
executables:
|
117
|
+
- cucumber_off_rails
|
118
|
+
extensions: []
|
119
|
+
|
120
|
+
extra_rdoc_files:
|
121
|
+
- LICENSE.txt
|
122
|
+
- README.rdoc
|
123
|
+
files:
|
124
|
+
- .document
|
125
|
+
- Gemfile
|
126
|
+
- Gemfile.lock
|
127
|
+
- LICENSE.txt
|
128
|
+
- README.rdoc
|
129
|
+
- Rakefile
|
130
|
+
- VERSION
|
131
|
+
- bin/cucumber_off_rails
|
132
|
+
- lib/cucumber_off_rails.rb
|
133
|
+
- lib/generators/cucumber_off_rails/install_generator.rb
|
134
|
+
- lib/generators/cucumber_off_rails/templates/Gemfile
|
135
|
+
- lib/generators/cucumber_off_rails/templates/Rakefile
|
136
|
+
- lib/generators/cucumber_off_rails/templates/features/.htaccess
|
137
|
+
- lib/generators/cucumber_off_rails/templates/features/sample.feature
|
138
|
+
- lib/generators/cucumber_off_rails/templates/features/step_definitions/debugging_steps.rb
|
139
|
+
- lib/generators/cucumber_off_rails/templates/features/step_definitions/linking_steps.rb
|
140
|
+
- lib/generators/cucumber_off_rails/templates/features/step_definitions/login_steps.rb
|
141
|
+
- lib/generators/cucumber_off_rails/templates/features/step_definitions/selector_steps.rb
|
142
|
+
- lib/generators/cucumber_off_rails/templates/features/step_definitions/validations_steps.rb
|
143
|
+
- lib/generators/cucumber_off_rails/templates/features/support/env.rb
|
144
|
+
- lib/generators/cucumber_off_rails/templates/features/support/hooks.rb
|
145
|
+
- lib/generators/cucumber_off_rails/templates/features/support/paths.rb
|
146
|
+
- lib/generators/cucumber_off_rails/templates/features/support/selectors.rb
|
147
|
+
- lib/generators/cucumber_off_rails/update_generator.rb
|
148
|
+
- spec/cucumber_off_rails_spec.rb
|
149
|
+
- spec/spec_helper.rb
|
150
|
+
homepage: http://github.com/jeremiahishere/cucumber_off_rails
|
151
|
+
licenses:
|
152
|
+
- MIT
|
153
|
+
post_install_message:
|
154
|
+
rdoc_options: []
|
155
|
+
|
156
|
+
require_paths:
|
157
|
+
- lib
|
158
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
159
|
+
none: false
|
160
|
+
requirements:
|
161
|
+
- - ">="
|
162
|
+
- !ruby/object:Gem::Version
|
163
|
+
hash: 4147910063496360604
|
164
|
+
segments:
|
165
|
+
- 0
|
166
|
+
version: "0"
|
167
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
168
|
+
none: false
|
169
|
+
requirements:
|
170
|
+
- - ">="
|
171
|
+
- !ruby/object:Gem::Version
|
172
|
+
version: "0"
|
173
|
+
requirements: []
|
174
|
+
|
175
|
+
rubyforge_project:
|
176
|
+
rubygems_version: 1.8.5
|
177
|
+
signing_key:
|
178
|
+
specification_version: 3
|
179
|
+
summary: Nondestructive Cucumber Testing
|
180
|
+
test_files: []
|
181
|
+
|