Commit ba25b2dc84cc25e66d6fa1450fee39c9bac002c5
1 parent
ece56329
Exists in
master
and in
4 other branches
Use poltergeist instaead of capybara-webkit
Showing
5 changed files
with
38 additions
and
21 deletions
Show diff stats
Gemfile
... | ... | @@ -123,8 +123,6 @@ group :development, :test do |
123 | 123 | gem 'spinach-rails' |
124 | 124 | gem "rspec-rails" |
125 | 125 | gem "capybara" |
126 | - gem "capybara-webkit" | |
127 | - gem "headless" | |
128 | 126 | gem "pry" |
129 | 127 | gem "awesome_print" |
130 | 128 | gem "database_cleaner" |
... | ... | @@ -139,6 +137,9 @@ group :development, :test do |
139 | 137 | gem 'rb-fsevent', require: darwin_only('rb-fsevent') |
140 | 138 | gem 'growl', require: darwin_only('growl') |
141 | 139 | gem 'rb-inotify', require: linux_only('rb-inotify') |
140 | + | |
141 | + # PhantomJS driver for Capybara | |
142 | + gem 'poltergeist' | |
142 | 143 | end |
143 | 144 | |
144 | 145 | group :test do | ... | ... |
Gemfile.lock
... | ... | @@ -94,9 +94,6 @@ GEM |
94 | 94 | rack-test (>= 0.5.4) |
95 | 95 | selenium-webdriver (~> 2.0) |
96 | 96 | xpath (~> 0.1.4) |
97 | - capybara-webkit (0.12.1) | |
98 | - capybara (>= 1.0.0, < 1.2) | |
99 | - json | |
100 | 97 | carrierwave (0.6.2) |
101 | 98 | activemodel (>= 3.2.0) |
102 | 99 | activesupport (>= 3.2.0) |
... | ... | @@ -143,6 +140,8 @@ GEM |
143 | 140 | railties (>= 3.0.0) |
144 | 141 | faraday (0.8.4) |
145 | 142 | multipart-post (~> 1.1) |
143 | + faye-websocket (0.4.6) | |
144 | + eventmachine (>= 0.12.0) | |
146 | 145 | ffaker (1.14.0) |
147 | 146 | ffi (1.0.11) |
148 | 147 | font-awesome-sass-rails (2.0.0.0) |
... | ... | @@ -189,8 +188,8 @@ GEM |
189 | 188 | hashery (1.5.0) |
190 | 189 | blankslate |
191 | 190 | hashie (1.2.0) |
192 | - headless (0.3.1) | |
193 | 191 | hike (1.2.1) |
192 | + http_parser.rb (0.5.3) | |
194 | 193 | httparty (0.8.3) |
195 | 194 | multi_json (~> 1.0) |
196 | 195 | multi_xml |
... | ... | @@ -260,6 +259,12 @@ GEM |
260 | 259 | omniauth-oauth (~> 1.0) |
261 | 260 | orm_adapter (0.3.0) |
262 | 261 | pg (0.14.0) |
262 | + poltergeist (1.0.2) | |
263 | + capybara (~> 1.1) | |
264 | + childprocess (~> 0.3) | |
265 | + faye-websocket (~> 0.4, >= 0.4.4) | |
266 | + http_parser.rb (~> 0.5.3) | |
267 | + multi_json (~> 1.0) | |
263 | 268 | polyglot (0.3.3) |
264 | 269 | posix-spawn (0.3.6) |
265 | 270 | pry (0.9.9.6) |
... | ... | @@ -422,7 +427,6 @@ DEPENDENCIES |
422 | 427 | awesome_print |
423 | 428 | bootstrap-sass (= 2.0.4) |
424 | 429 | capybara |
425 | - capybara-webkit | |
426 | 430 | carrierwave |
427 | 431 | chosen-rails |
428 | 432 | coffee-rails (= 3.2.2) |
... | ... | @@ -449,7 +453,6 @@ DEPENDENCIES |
449 | 453 | guard-rspec |
450 | 454 | guard-spinach |
451 | 455 | haml-rails |
452 | - headless | |
453 | 456 | httparty |
454 | 457 | jquery-atwho-rails (= 0.1.6) |
455 | 458 | jquery-rails (= 2.0.2) |
... | ... | @@ -465,6 +468,7 @@ DEPENDENCIES |
465 | 468 | omniauth-ldap! |
466 | 469 | omniauth-twitter |
467 | 470 | pg |
471 | + poltergeist | |
468 | 472 | pry |
469 | 473 | pygments.rb (= 0.3.1) |
470 | 474 | quiet_assets (= 1.0.1) | ... | ... |
features/steps/project/project_issues.rb
... | ... | @@ -96,8 +96,7 @@ class ProjectIssues < Spinach::FeatureSteps |
96 | 96 | end |
97 | 97 | |
98 | 98 | Then 'I should see selected milestone with title "v3.0"' do |
99 | - issues_milestone_selector = "#issue_milestone_id_chzn/a" | |
100 | - wait_until { page.has_content?("Details") } | |
99 | + issues_milestone_selector = "#milestone_id_chzn > a" | |
101 | 100 | page.find(issues_milestone_selector).should have_content("v3.0") |
102 | 101 | end |
103 | 102 | ... | ... |
features/support/env.rb
... | ... | @@ -11,14 +11,33 @@ end |
11 | 11 | |
12 | 12 | Dir["#{Rails.root}/features/steps/shared/*.rb"].each {|file| require file} |
13 | 13 | |
14 | +# | |
15 | +# Stub gitolite | |
16 | +# | |
14 | 17 | include GitoliteStub |
15 | 18 | |
16 | 19 | WebMock.allow_net_connect! |
17 | -Capybara.javascript_driver = :webkit | |
20 | + | |
21 | +# | |
22 | +# JS driver | |
23 | +# | |
24 | +require 'capybara/poltergeist' | |
25 | +Capybara.javascript_driver = :poltergeist | |
26 | +Spinach.hooks.on_tag("javascript") do | |
27 | + ::Capybara.current_driver = ::Capybara.javascript_driver | |
28 | + ::Capybara.default_wait_time = 5 | |
29 | +end | |
30 | + | |
18 | 31 | |
19 | 32 | DatabaseCleaner.strategy = :truncation |
20 | -Spinach.hooks.before_scenario { DatabaseCleaner.start } | |
21 | -Spinach.hooks.after_scenario { DatabaseCleaner.clean } | |
33 | + | |
34 | +Spinach.hooks.before_scenario do | |
35 | + DatabaseCleaner.start | |
36 | +end | |
37 | + | |
38 | +Spinach.hooks.after_scenario do | |
39 | + DatabaseCleaner.clean | |
40 | +end | |
22 | 41 | |
23 | 42 | Spinach.hooks.before_run do |
24 | 43 | RSpec::Mocks::setup self | ... | ... |
spec/spec_helper.rb
... | ... | @@ -11,14 +11,13 @@ require 'capybara/rails' |
11 | 11 | require 'capybara/rspec' |
12 | 12 | require 'webmock/rspec' |
13 | 13 | require 'email_spec' |
14 | -require 'headless' | |
15 | 14 | |
16 | 15 | # Requires supporting ruby files with custom matchers and macros, etc, |
17 | 16 | # in spec/support/ and its subdirectories. |
18 | 17 | Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f} |
19 | 18 | |
20 | -# Use capybara-webkit | |
21 | -Capybara.javascript_driver = :webkit | |
19 | +require 'capybara/poltergeist' | |
20 | +Capybara.javascript_driver = :poltergeist | |
22 | 21 | |
23 | 22 | WebMock.disable_net_connect!(allow_localhost: true) |
24 | 23 | |
... | ... | @@ -35,11 +34,6 @@ RSpec.configure do |config| |
35 | 34 | # instead of true. |
36 | 35 | config.use_transactional_fixtures = false |
37 | 36 | |
38 | - config.before :all do | |
39 | - headless = Headless.new | |
40 | - headless.start | |
41 | - end | |
42 | - | |
43 | 37 | config.before do |
44 | 38 | stub_gitolite! |
45 | 39 | ... | ... |