New capybara and selenium version, works in FF8 now.

This commit is contained in:
Mario Visic 2011-11-27 19:29:09 +11:00
parent 5c6794d69c
commit 0f09c577d0
7 changed files with 28 additions and 29 deletions

View File

@ -53,7 +53,7 @@ GEM
bushido_stub (0.0.3) bushido_stub (0.0.3)
activesupport (>= 3.0.7) activesupport (>= 3.0.7)
cancan (1.6.5) cancan (1.6.5)
capybara (1.1.1) capybara (1.1.2)
mime-types (>= 1.16) mime-types (>= 1.16)
nokogiri (>= 1.3.3) nokogiri (>= 1.3.3)
rack (>= 1.0.0) rack (>= 1.0.0)
@ -70,15 +70,15 @@ GEM
columnize (0.3.4) columnize (0.3.4)
configuration (1.3.1) configuration (1.3.1)
crack (0.1.8) crack (0.1.8)
cucumber (1.1.0) cucumber (1.1.3)
builder (>= 2.1.2) builder (>= 2.1.2)
diff-lcs (>= 1.1.2) diff-lcs (>= 1.1.2)
gherkin (~> 2.5.0) gherkin (~> 2.6.7)
json (>= 1.4.6) json (>= 1.4.6)
term-ansicolor (>= 1.0.6) term-ansicolor (>= 1.0.6)
cucumber-rails (1.1.1) cucumber-rails (1.2.0)
capybara (>= 1.1.1) capybara (>= 1.1.1)
cucumber (>= 1.1.0) cucumber (>= 1.1.1)
nokogiri (>= 1.5.0) nokogiri (>= 1.5.0)
custom_fields (1.0.0.beta.25) custom_fields (1.0.0.beta.25)
activesupport (~> 3.0.9) activesupport (~> 3.0.9)
@ -110,7 +110,7 @@ GEM
factory_girl_rails (1.2.0) factory_girl_rails (1.2.0)
factory_girl (~> 2.1.0) factory_girl (~> 2.1.0)
railties (>= 3.0.0) railties (>= 3.0.0)
ffi (1.0.9) ffi (1.0.11)
fog (0.8.2) fog (0.8.2)
builder builder
excon (~> 0.6.1) excon (~> 0.6.1)
@ -125,7 +125,7 @@ GEM
actionpack (>= 2.3.7) actionpack (>= 2.3.7)
activesupport (>= 2.3.7) activesupport (>= 2.3.7)
i18n (~> 0.4) i18n (~> 0.4)
gherkin (2.5.2) gherkin (2.6.8)
json (>= 1.4.6) json (>= 1.4.6)
growl-glue (1.0.7) growl-glue (1.0.7)
haml (3.1.2) haml (3.1.2)
@ -166,7 +166,7 @@ GEM
i18n (>= 0.4.0) i18n (>= 0.4.0)
mime-types (~> 1.16) mime-types (~> 1.16)
treetop (~> 1.4.8) treetop (~> 1.4.8)
mime-types (1.16) mime-types (1.17.2)
mimemagic (0.1.8) mimemagic (0.1.8)
mimetype-fu (0.1.2) mimetype-fu (0.1.2)
mocha (0.9.12) mocha (0.9.12)
@ -248,15 +248,15 @@ GEM
archive-tar-minitar (>= 0.5.2) archive-tar-minitar (>= 0.5.2)
rubycas-client (2.2.1) rubycas-client (2.2.1)
activesupport activesupport
rubyzip (0.9.4) rubyzip (0.9.5)
s3 (0.3.8) s3 (0.3.8)
proxies (~> 0.2.0) proxies (~> 0.2.0)
sanitize (2.0.3) sanitize (2.0.3)
nokogiri (>= 1.4.4, < 1.6) nokogiri (>= 1.4.4, < 1.6)
sass (3.1.2) sass (3.1.2)
selenium-webdriver (2.8.0) selenium-webdriver (2.13.0)
childprocess (>= 0.2.1) childprocess (>= 0.2.1)
ffi (>= 1.0.7) ffi (~> 1.0.9)
json_pure json_pure
rubyzip rubyzip
spork (0.9.0.rc9) spork (0.9.0.rc9)

View File

@ -7,18 +7,18 @@ end
Given /^I am an authenticated "([^"]*)"$/ do |role| Given /^I am an authenticated "([^"]*)"$/ do |role|
@member = Site.first.memberships.where(:role => role.downcase).first || FactoryGirl.create(role.downcase.to_sym, :site => Site.first) @member = Site.first.memberships.where(:role => role.downcase).first || FactoryGirl.create(role.downcase.to_sym, :site => Site.first)
Given %{I go to login} step %{I go to login}
And %{I fill in "Email" with "#{@member.account.email}"} step %{I fill in "Email" with "#{@member.account.email}"}
And %{I fill in "Password" with "easyone"} step %{I fill in "Password" with "easyone"}
And %{I press "Log in"} step %{I press "Log in"}
end end
Given /^I am an authenticated user$/ do Given /^I am an authenticated user$/ do
Given %{I am an authenticated "admin"} step %{I am an authenticated "admin"}
end end
Then /^I should see the access denied message$/ do Then /^I should see the access denied message$/ do
Then %{I should see "You are not authorized to access this page"} step %{I should see "You are not authorized to access this page"}
end end
Then /^I am redirected to "([^\"]*)"$/ do |url| Then /^I am redirected to "([^\"]*)"$/ do |url|

View File

@ -7,7 +7,7 @@ Then /^I should see the role dropdown on the "([^"]*)" without the "([^"]*)" opt
end end
Then /^I should see the role dropdown on myself$/ do Then /^I should see the role dropdown on myself$/ do
Then %{I should see the role dropdown on the "#{@member.role}"} step %{I should see the role dropdown on the "#{@member.role}"}
end end
Then /^I should not see the role dropdown on the "([^"]*)"$/ do |user| Then /^I should not see the role dropdown on the "([^"]*)"$/ do |user|
@ -15,7 +15,7 @@ Then /^I should not see the role dropdown on the "([^"]*)"$/ do |user|
end end
Then /^I should not see the role dropdown on myself$/ do Then /^I should not see the role dropdown on myself$/ do
Then %{I should not see the role dropdown on the "#{@member.role}"} step %{I should not see the role dropdown on the "#{@member.role}"}
end end
Then /^I should not see any role dropdowns$/ do Then /^I should not see any role dropdowns$/ do
@ -31,7 +31,7 @@ Then /^I should not see delete on the "([^"]*)"$/ do |role|
end end
Then /^I should not see delete on myself$/ do Then /^I should not see delete on myself$/ do
Then %{I should not see delete on the "#{@member.role}"} step %{I should not see delete on the "#{@member.role}"}
end end
Then /^I should not see any delete buttons$/ do Then /^I should not see any delete buttons$/ do
@ -39,5 +39,5 @@ Then /^I should not see any delete buttons$/ do
end end
When /^I select the "([^"]*)" role for the "author" user/ do |role| When /^I select the "([^"]*)" role for the "author" user/ do |role|
Given %{I select "#{role}" from "site[memberships_attributes][2][role]"} step %{I select "#{role}" from "site[memberships_attributes][2][role]"}
end end

View File

@ -19,7 +19,7 @@ end
Then /^I should be able to view a paginaed list of a has many association$/ do Then /^I should be able to view a paginaed list of a has many association$/ do
# Create models # Create models
Given %{I have an "Articles" model which has many "Comments"} step %{I have an "Articles" model which has many "Comments"}
# Create contents # Create contents
article = @parent_model.contents.create!(:slug => 'parent', :body => 'Parent') article = @parent_model.contents.create!(:slug => 'parent', :body => 'Parent')

View File

@ -14,7 +14,7 @@ Given /^I have the site: "([^"]*)" set up(?: with #{capture_fields})?$/ do |site
end end
Given /^I have a site set up$/ do Given /^I have a site set up$/ do
Given %{I have the site: "test site" set up} step %{I have the site: "test site" set up}
end end
Given /^I have a designer and an author$/ do Given /^I have a designer and an author$/ do

View File

@ -19,12 +19,12 @@ World(WithinHelpers)
# Single-line step scoper # Single-line step scoper
When /^(.*) within (.*[^:])$/ do |step, parent| When /^(.*) within (.*[^:])$/ do |step, parent|
with_scope(parent) { When step } with_scope(parent) { step step }
end end
# Multi-line step scoper # Multi-line step scoper
When /^(.*) within (.*[^:]):$/ do |step, parent, table_or_string| When /^(.*) within (.*[^:]):$/ do |step, parent, table_or_string|
with_scope(parent) { When "#{step}:", table_or_string } with_scope(parent) { step "#{step}:", table_or_string }
end end
Given /^(?:|I )am on (.+)$/ do |page_name| Given /^(?:|I )am on (.+)$/ do |page_name|
@ -64,7 +64,7 @@ end
# #
When /^(?:|I )fill in the following:$/ do |fields| When /^(?:|I )fill in the following:$/ do |fields|
fields.rows_hash.each do |name, value| fields.rows_hash.each do |name, value|
When %{I fill in "#{name}" with "#{value}"} step %{I fill in "#{name}" with "#{value}"}
end end
end end
@ -194,4 +194,4 @@ end
Then /^show me the page$/ do Then /^show me the page$/ do
save_and_open_page save_and_open_page
end end

View File

@ -12,7 +12,6 @@ require 'cucumber/rails'
require 'cucumber/formatter/unicode' # Remove this line if you don't want Cucumber Unicode support require 'cucumber/formatter/unicode' # Remove this line if you don't want Cucumber Unicode support
require 'cucumber/rails/rspec' require 'cucumber/rails/rspec'
require 'cucumber/rails/world' require 'cucumber/rails/world'
require 'cucumber/web/tableish'
require 'capybara' require 'capybara'
require 'capybara/rails' require 'capybara/rails'
@ -68,4 +67,4 @@ ActionController::Base.allow_rescue = false
require File.expand_path(File.dirname(__FILE__) + '/../../spec/support/carrierwave') require File.expand_path(File.dirname(__FILE__) + '/../../spec/support/carrierwave')
require File.expand_path(File.dirname(__FILE__) + '/../../spec/support/locomotive') require File.expand_path(File.dirname(__FILE__) + '/../../spec/support/locomotive')
Locomotive.configure_for_test(true) Locomotive.configure_for_test(true)