workbench: Use Poltergeist for integration tests.
authorBrett Smith <brett@curoverse.com>
Wed, 19 Mar 2014 16:09:51 +0000 (12:09 -0400)
committerBrett Smith <brett@curoverse.com>
Wed, 19 Mar 2014 16:25:27 +0000 (12:25 -0400)
This is faster and will enable us to run integration tests on the
build server.

PhantomJS (http://phantomjs.org/) has to be installed in the $PATH for
this to work.

apps/workbench/Gemfile
apps/workbench/Gemfile.lock
apps/workbench/test/integration_helper.rb

index 488a355e8e0b6f1b7eb2842413832ec6c500800a..b273d9191c875417a9edd5cf90f8ffdf305a007a 100644 (file)
@@ -27,6 +27,7 @@ group :test do
   gem 'rvm-capistrano'
   gem 'selenium-webdriver'
   gem 'capybara'
+  gem 'poltergeist'
 end
 
 gem 'jquery-rails'
index 463fa7d3dcdd396f0f52bf4fbaec815ac8ebc253..0c65ca80ffb3d764d6446d4ce714e551a90eb3b1 100644 (file)
@@ -50,6 +50,7 @@ GEM
       xpath (~> 2.0)
     childprocess (0.5.1)
       ffi (~> 1.0, >= 1.0.11)
+    cliver (0.3.2)
     coffee-rails (3.2.2)
       coffee-script (>= 2.2.0)
       railties (~> 3.2.0)
@@ -102,6 +103,11 @@ GEM
       actionpack
       activesupport
       rails (>= 3.0.0)
+    poltergeist (1.5.0)
+      capybara (~> 2.1)
+      cliver (~> 0.3.1)
+      multi_json (~> 1.0)
+      websocket-driver (>= 0.2.0)
     polyglot (0.3.3)
     rack (1.4.5)
     rack-cache (1.2)
@@ -163,6 +169,7 @@ GEM
       execjs (>= 0.3.0)
       json (>= 1.8.0)
     websocket (1.0.7)
+    websocket-driver (0.3.2)
     xpath (2.0.0)
       nokogiri (~> 1.3)
 
@@ -185,6 +192,7 @@ DEPENDENCIES
   oj
   passenger
   piwik_analytics
+  poltergeist
   rails (~> 3.2.0)
   rvm-capistrano
   sass
index b6467b5649696ff9551a5321d127c0dd8fdf066e..b3d9f01444d649ffbff9025d0d676165b9403920 100644 (file)
@@ -1,5 +1,6 @@
 require 'test_helper'
 require 'capybara/rails'
+require 'capybara/poltergeist'
 require 'uri'
 require 'yaml'
 
@@ -42,6 +43,7 @@ class IntegrationTestRunner < MiniTest::Unit
   end
 
   def _run(args=[])
+    Capybara.javascript_driver = :poltergeist
     server_pid = Dir.chdir($ARV_API_SERVER_DIR) do |apidir|
       _system('bundle', 'exec', 'rake', 'db:test:load')
       _system('bundle', 'exec', 'rake', 'db:fixtures:load')