Use poltergeist instaead of capybara-webkit

This commit is contained in:
Dmitriy Zaporozhets 2012-11-16 12:27:39 +02:00
parent ece563296b
commit ba25b2dc84
5 changed files with 38 additions and 21 deletions

View file

@ -123,8 +123,6 @@ group :development, :test do
gem 'spinach-rails'
gem "rspec-rails"
gem "capybara"
gem "capybara-webkit"
gem "headless"
gem "pry"
gem "awesome_print"
gem "database_cleaner"
@ -139,6 +137,9 @@ group :development, :test do
gem 'rb-fsevent', require: darwin_only('rb-fsevent')
gem 'growl', require: darwin_only('growl')
gem 'rb-inotify', require: linux_only('rb-inotify')
# PhantomJS driver for Capybara
gem 'poltergeist'
end
group :test do

View file

@ -94,9 +94,6 @@ GEM
rack-test (>= 0.5.4)
selenium-webdriver (~> 2.0)
xpath (~> 0.1.4)
capybara-webkit (0.12.1)
capybara (>= 1.0.0, < 1.2)
json
carrierwave (0.6.2)
activemodel (>= 3.2.0)
activesupport (>= 3.2.0)
@ -143,6 +140,8 @@ GEM
railties (>= 3.0.0)
faraday (0.8.4)
multipart-post (~> 1.1)
faye-websocket (0.4.6)
eventmachine (>= 0.12.0)
ffaker (1.14.0)
ffi (1.0.11)
font-awesome-sass-rails (2.0.0.0)
@ -189,8 +188,8 @@ GEM
hashery (1.5.0)
blankslate
hashie (1.2.0)
headless (0.3.1)
hike (1.2.1)
http_parser.rb (0.5.3)
httparty (0.8.3)
multi_json (~> 1.0)
multi_xml
@ -260,6 +259,12 @@ GEM
omniauth-oauth (~> 1.0)
orm_adapter (0.3.0)
pg (0.14.0)
poltergeist (1.0.2)
capybara (~> 1.1)
childprocess (~> 0.3)
faye-websocket (~> 0.4, >= 0.4.4)
http_parser.rb (~> 0.5.3)
multi_json (~> 1.0)
polyglot (0.3.3)
posix-spawn (0.3.6)
pry (0.9.9.6)
@ -422,7 +427,6 @@ DEPENDENCIES
awesome_print
bootstrap-sass (= 2.0.4)
capybara
capybara-webkit
carrierwave
chosen-rails
coffee-rails (= 3.2.2)
@ -449,7 +453,6 @@ DEPENDENCIES
guard-rspec
guard-spinach
haml-rails
headless
httparty
jquery-atwho-rails (= 0.1.6)
jquery-rails (= 2.0.2)
@ -465,6 +468,7 @@ DEPENDENCIES
omniauth-ldap!
omniauth-twitter
pg
poltergeist
pry
pygments.rb (= 0.3.1)
quiet_assets (= 1.0.1)

View file

@ -96,8 +96,7 @@ class ProjectIssues < Spinach::FeatureSteps
end
Then 'I should see selected milestone with title "v3.0"' do
issues_milestone_selector = "#issue_milestone_id_chzn/a"
wait_until { page.has_content?("Details") }
issues_milestone_selector = "#milestone_id_chzn > a"
page.find(issues_milestone_selector).should have_content("v3.0")
end

View file

@ -11,14 +11,33 @@ end
Dir["#{Rails.root}/features/steps/shared/*.rb"].each {|file| require file}
#
# Stub gitolite
#
include GitoliteStub
WebMock.allow_net_connect!
Capybara.javascript_driver = :webkit
#
# JS driver
#
require 'capybara/poltergeist'
Capybara.javascript_driver = :poltergeist
Spinach.hooks.on_tag("javascript") do
::Capybara.current_driver = ::Capybara.javascript_driver
::Capybara.default_wait_time = 5
end
DatabaseCleaner.strategy = :truncation
Spinach.hooks.before_scenario { DatabaseCleaner.start }
Spinach.hooks.after_scenario { DatabaseCleaner.clean }
Spinach.hooks.before_scenario do
DatabaseCleaner.start
end
Spinach.hooks.after_scenario do
DatabaseCleaner.clean
end
Spinach.hooks.before_run do
RSpec::Mocks::setup self

View file

@ -11,14 +11,13 @@ require 'capybara/rails'
require 'capybara/rspec'
require 'webmock/rspec'
require 'email_spec'
require 'headless'
# Requires supporting ruby files with custom matchers and macros, etc,
# in spec/support/ and its subdirectories.
Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f}
# Use capybara-webkit
Capybara.javascript_driver = :webkit
require 'capybara/poltergeist'
Capybara.javascript_driver = :poltergeist
WebMock.disable_net_connect!(allow_localhost: true)
@ -35,11 +34,6 @@ RSpec.configure do |config|
# instead of true.
config.use_transactional_fixtures = false
config.before :all do
headless = Headless.new
headless.start
end
config.before do
stub_gitolite!