update cucumber and capybara. one failing cuke.
This commit is contained in:
parent
f40ed9bb25
commit
f4c9b548f9
7 changed files with 48 additions and 39 deletions
4
Gemfile
4
Gemfile
|
|
@ -120,8 +120,8 @@ group :test, :development do
|
|||
end
|
||||
|
||||
group :test do
|
||||
gem 'capybara', '~> 0.3.9'
|
||||
gem 'cucumber-rails', '0.3.2'
|
||||
gem 'capybara', '~> 1.1.2'
|
||||
gem 'cucumber-rails', '1.2.1'
|
||||
gem 'cucumber-api-steps', '0.6', :require => false
|
||||
gem 'database_cleaner', '0.7.0'
|
||||
gem 'diaspora-client', :git => 'git://github.com/diaspora/diaspora-client.git'
|
||||
|
|
|
|||
19
Gemfile.lock
19
Gemfile.lock
|
|
@ -100,13 +100,13 @@ GEM
|
|||
capistrano-ext (1.2.1)
|
||||
capistrano (>= 1.0.0)
|
||||
capistrano_colors (0.5.5)
|
||||
capybara (0.3.9)
|
||||
culerity (>= 0.2.4)
|
||||
capybara (1.1.2)
|
||||
mime-types (>= 1.16)
|
||||
nokogiri (>= 1.3.3)
|
||||
rack (>= 1.0.0)
|
||||
rack-test (>= 0.5.4)
|
||||
selenium-webdriver (>= 0.0.3)
|
||||
selenium-webdriver (~> 2.0)
|
||||
xpath (~> 0.1.4)
|
||||
carrierwave (0.5.8)
|
||||
activesupport (~> 3.0)
|
||||
cgi_multipart_eof_fix (2.5.0)
|
||||
|
|
@ -140,9 +140,10 @@ GEM
|
|||
cucumber-api-steps (0.6)
|
||||
cucumber (>= 0.8.3)
|
||||
jsonpath (>= 0.1.2)
|
||||
cucumber-rails (0.3.2)
|
||||
cucumber (>= 0.8.0)
|
||||
culerity (0.2.15)
|
||||
cucumber-rails (1.2.1)
|
||||
capybara (>= 1.1.2)
|
||||
cucumber (>= 1.1.3)
|
||||
nokogiri (>= 1.5.0)
|
||||
daemons (1.1.4)
|
||||
database_cleaner (0.7.0)
|
||||
devise (1.3.4)
|
||||
|
|
@ -418,6 +419,8 @@ GEM
|
|||
addressable (>= 2.2.2)
|
||||
crack (>= 0.1.7)
|
||||
will_paginate (3.0.pre2)
|
||||
xpath (0.1.4)
|
||||
nokogiri (~> 1.3)
|
||||
yard (0.7.4)
|
||||
yui-compressor (0.9.6)
|
||||
POpen4 (>= 0.1.4)
|
||||
|
|
@ -434,13 +437,13 @@ DEPENDENCIES
|
|||
capistrano (= 2.5.19)
|
||||
capistrano-ext (= 1.2.1)
|
||||
capistrano_colors
|
||||
capybara (~> 0.3.9)
|
||||
capybara (~> 1.1.2)
|
||||
carrierwave (= 0.5.8)
|
||||
chef (= 0.9.12)
|
||||
client_side_validations
|
||||
cloudfiles (= 1.4.10)
|
||||
cucumber-api-steps (= 0.6)
|
||||
cucumber-rails (= 0.3.2)
|
||||
cucumber-rails (= 1.2.1)
|
||||
database_cleaner (= 0.7.0)
|
||||
devise (~> 1.3.1)
|
||||
devise_invitable (= 0.5.0)
|
||||
|
|
|
|||
|
|
@ -15,10 +15,10 @@ Feature: private messages
|
|||
Then I should see "Greetings" within "#conversation_inbox"
|
||||
And I should see "Greetings" within "#conversation_show"
|
||||
And "Alice Awesome" should be part of active conversation
|
||||
And I should see "hello, alice!" within ".stream"
|
||||
And I should see "hello, alice!" within ".stream_container"
|
||||
When I sign in as "alice@alice.alice"
|
||||
And I reply with "hey, how you doing?"
|
||||
Then I should see "hey, how you doing?" within ".stream"
|
||||
Then I should see "hey, how you doing?" within ".stream_container"
|
||||
|
||||
Scenario: send an empty message
|
||||
When I send a message with subject "Empty Greetings" and text " " to "Alice Awesome"
|
||||
|
|
|
|||
|
|
@ -39,5 +39,5 @@ Feature: editing your profile
|
|||
Then I should be on my edit profile page
|
||||
And I should see "Profile updated"
|
||||
And the "profile_date_year" field should be filled with "1986"
|
||||
And the "profile_date_month" field should be filled with "November"
|
||||
And the "profile_date_month" field should be filled with "11"
|
||||
And the "profile_date_day" field should be filled with "30"
|
||||
|
|
|
|||
|
|
@ -10,11 +10,11 @@ Then /^I should see an uploaded image within the photo drop zone$/ do
|
|||
end
|
||||
|
||||
Then /^I should not see an uploaded image within the photo drop zone$/ do
|
||||
find("#photodropzone img").should be_nil
|
||||
all("#photodropzone img").should be_empty
|
||||
end
|
||||
|
||||
Then /^I should not see any posts in my stream$/ do
|
||||
find(".stream_element").should be_nil
|
||||
all(".stream_element").should be_empty
|
||||
end
|
||||
|
||||
Given /^"([^"]*)" has a public post with text "([^"]*)"$/ do |email, text|
|
||||
|
|
|
|||
|
|
@ -5,17 +5,12 @@
|
|||
# files.
|
||||
|
||||
ENV["RAILS_ENV"] ||= "test"
|
||||
require File.expand_path(File.dirname(__FILE__) + '/../../config/environment') unless defined?(Rails)
|
||||
|
||||
require 'cucumber/formatter/unicode' # Remove this line if you don't want Cucumber Unicode support
|
||||
require 'cucumber/rails/rspec'
|
||||
require 'cucumber/rails/world'
|
||||
require 'cucumber/web/tableish'
|
||||
require 'cucumber/rails'
|
||||
|
||||
require 'capybara/rails'
|
||||
require 'capybara/cucumber'
|
||||
require 'capybara/session'
|
||||
require 'cucumber/rails/capybara_javascript_emulation' # Lets you click links with onclick javascript handlers without using @culerity or @javascript
|
||||
#require 'cucumber/rails/capybara_javascript_emulation' # Lets you click links with onclick javascript handlers without using @culerity or @javascript
|
||||
require 'cucumber/api_steps'
|
||||
|
||||
# Capybara defaults to XPath selectors rather than Webrat's default of CSS3. In
|
||||
|
|
@ -67,7 +62,8 @@ end
|
|||
After do
|
||||
AppConfig[:no_follow_diasporahq] = @no_follow_diaspora_hq_setting
|
||||
if Capybara.current_session.driver.respond_to?(:browser)
|
||||
Capybara.current_session.driver.browser.manage.delete_all_cookies
|
||||
Capybara.reset_sessions!
|
||||
# Capybara.current_session.driver.browser.manage.delete_all_cookies
|
||||
end
|
||||
end
|
||||
|
||||
|
|
@ -101,20 +97,20 @@ After('@localserver') do
|
|||
CapybaraSettings.instance.restore
|
||||
end
|
||||
|
||||
class Capybara::Driver::Selenium < Capybara::Driver::Base
|
||||
class Node < Capybara::Node
|
||||
def [](name)
|
||||
node.attribute(name.to_s)
|
||||
rescue Selenium::WebDriver::Error::WebDriverError
|
||||
nil
|
||||
end
|
||||
# class Capybara::Driver::Selenium < Capybara::Driver::Base
|
||||
# class Node < Capybara::Node
|
||||
# def [](name)
|
||||
# node.attribute(name.to_s)
|
||||
# rescue Selenium::WebDriver::Error::WebDriverError
|
||||
# nil
|
||||
# end
|
||||
|
||||
def select(option)
|
||||
option_node = node.find_element(:xpath, ".//option[normalize-space(text())=#{Capybara::XPath.escape(option)}]") || node.find_element(:xpath, ".//option[contains(.,#{Capybara::XPath.escape(option)})]")
|
||||
option_node.click
|
||||
rescue
|
||||
options = node.find_elements(:xpath, "//option").map { |o| "'#{o.text}'" }.join(', ')
|
||||
raise Capybara::OptionNotFound, "No such option '#{option}' in this select box. Available options: #{options}"
|
||||
end
|
||||
end
|
||||
end
|
||||
# def select(option)
|
||||
# option_node = node.find_element(:xpath, ".//option[normalize-space(text())=#{Capybara::XPath.escape(option)}]") || node.find_element(:xpath, ".//option[contains(.,#{Capybara::XPath.escape(option)})]")
|
||||
# option_node.click
|
||||
# rescue
|
||||
# options = node.find_elements(:xpath, "//option").map { |o| "'#{o.text}'" }.join(', ')
|
||||
# raise Capybara::OptionNotFound, "No such option '#{option}' in this select box. Available options: #{options}"
|
||||
# end
|
||||
# end
|
||||
# end
|
||||
|
|
|
|||
10
script/cucumber
Executable file
10
script/cucumber
Executable file
|
|
@ -0,0 +1,10 @@
|
|||
#!/usr/bin/env ruby
|
||||
|
||||
vendored_cucumber_bin = Dir["#{File.dirname(__FILE__)}/../vendor/{gems,plugins}/cucumber*/bin/cucumber"].first
|
||||
if vendored_cucumber_bin
|
||||
load File.expand_path(vendored_cucumber_bin)
|
||||
else
|
||||
require 'rubygems' unless ENV['NO_RUBYGEMS']
|
||||
require 'cucumber'
|
||||
load Cucumber::BINARY
|
||||
end
|
||||
Loading…
Reference in a new issue