mirror of
https://github.com/teamcapybara/capybara.git
synced 2022-11-09 12:08:07 -05:00
Added a feature for cucumber integration
This commit is contained in:
parent
2adf7c6638
commit
50775ab787
5 changed files with 52 additions and 0 deletions
15
Gemfile.lock
15
Gemfile.lock
|
@ -20,10 +20,17 @@ PATH
|
|||
GEM
|
||||
remote: http://rubygems.org/
|
||||
specs:
|
||||
builder (3.0.0)
|
||||
celerity (0.8.7)
|
||||
childprocess (0.1.6)
|
||||
ffi (~> 0.6.3)
|
||||
configuration (1.2.0)
|
||||
cucumber (0.10.0)
|
||||
builder (>= 2.1.2)
|
||||
diff-lcs (~> 1.1.2)
|
||||
gherkin (~> 2.3.2)
|
||||
json (~> 1.4.6)
|
||||
term-ansicolor (~> 1.0.5)
|
||||
culerity (0.2.15)
|
||||
diff-lcs (1.1.2)
|
||||
ffi (0.6.3)
|
||||
|
@ -33,6 +40,12 @@ GEM
|
|||
rspec (~> 2.0)
|
||||
rspec-instafail (~> 0.1.4)
|
||||
ruby-progressbar (~> 0.0.9)
|
||||
gherkin (2.3.3)
|
||||
json (~> 1.4.6)
|
||||
gherkin (2.3.3-java)
|
||||
json (~> 1.4.6)
|
||||
json (1.4.6)
|
||||
json (1.4.6-java)
|
||||
json_pure (1.4.6)
|
||||
launchy (0.3.7)
|
||||
configuration (>= 0.0.5)
|
||||
|
@ -64,6 +77,7 @@ GEM
|
|||
sinatra (1.1.2)
|
||||
rack (~> 1.1)
|
||||
tilt (~> 1.2)
|
||||
term-ansicolor (1.0.5)
|
||||
tilt (1.2.2)
|
||||
weakling (0.0.4-java)
|
||||
yard (0.6.4)
|
||||
|
@ -76,6 +90,7 @@ DEPENDENCIES
|
|||
bundler (~> 1.0)
|
||||
capybara!
|
||||
celerity (>= 0.7.9)
|
||||
cucumber (>= 0.10)
|
||||
culerity (>= 0.2.4)
|
||||
fuubar (>= 0.0.1)
|
||||
launchy (>= 0.3.5)
|
||||
|
|
|
@ -36,4 +36,5 @@ Gem::Specification.new do |s|
|
|||
s.add_development_dependency("launchy", [">= 0.3.5"])
|
||||
s.add_development_dependency("yard", [">= 0.5.8"])
|
||||
s.add_development_dependency("fuubar", [">= 0.0.1"])
|
||||
s.add_development_dependency("cucumber", [">= 0.10"])
|
||||
end
|
||||
|
|
18
features/capybara.feature
Normal file
18
features/capybara.feature
Normal file
|
@ -0,0 +1,18 @@
|
|||
Feature: Capybara's cucumber integration
|
||||
In order to integrate with the lovely plain text testing framework
|
||||
As Capybara
|
||||
I want to integrate successfully with Cucumber
|
||||
|
||||
Scenario: hello world
|
||||
When I visit the root page
|
||||
Then I should see "Hello world!"
|
||||
|
||||
@javascript
|
||||
Scenario: javascript tag
|
||||
When I visit the root page
|
||||
Then Capybara should use the "selenium" driver
|
||||
|
||||
@selenium
|
||||
Scenario: selenium tag
|
||||
When I visit the root page
|
||||
Then Capybara should use the "selenium" driver
|
11
features/step_definitions/capybara_steps.rb
Normal file
11
features/step_definitions/capybara_steps.rb
Normal file
|
@ -0,0 +1,11 @@
|
|||
When /^I visit the root page$/ do
|
||||
visit('/')
|
||||
end
|
||||
|
||||
Then /^I should see "([^"]*)"$/ do |text|
|
||||
page.should have_content(text)
|
||||
end
|
||||
|
||||
Then /^Capybara should use the "([^"]*)" driver$/ do |driver|
|
||||
Capybara.current_driver.should == driver.to_sym
|
||||
end
|
7
features/support/env.rb
Normal file
7
features/support/env.rb
Normal file
|
@ -0,0 +1,7 @@
|
|||
require 'rubygems'
|
||||
require 'bundler/setup'
|
||||
|
||||
require 'capybara/cucumber'
|
||||
require 'capybara/spec/test_app'
|
||||
|
||||
Capybara.app = TestApp
|
Loading…
Reference in a new issue