[ARVADOS] updated: c2bd59c55177f431d91c21521196f421d5ffb88f

git at public.curoverse.com git at public.curoverse.com
Wed Apr 9 13:57:31 EDT 2014


Summary of changes:
 apps/workbench/Gemfile                        |    2 +-
 apps/workbench/Gemfile.lock                   |    6 +---
 apps/workbench/test/integration/users_test.rb |   27 ++++++++++++++++++++++--
 3 files changed, 27 insertions(+), 8 deletions(-)

       via  c2bd59c55177f431d91c21521196f421d5ffb88f (commit)
      from  e9ee7a48d3f95d41f5b17d4c1c5c65471ff0b598 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit c2bd59c55177f431d91c21521196f421d5ffb88f
Author: radhika chippada <radhika at curoverse.com>
Date:   Wed Apr 9 13:56:34 2014 -0400

    Use selenium driver with headless for testing.

diff --git a/apps/workbench/Gemfile b/apps/workbench/Gemfile
index 1e43d1c..ee43a89 100644
--- a/apps/workbench/Gemfile
+++ b/apps/workbench/Gemfile
@@ -28,7 +28,7 @@ group :test do
   gem 'selenium-webdriver'
   gem 'capybara'
   gem 'poltergeist'
-  gem 'capybara-webkit'
+  gem 'headless'
 end
 
 gem 'jquery-rails'
diff --git a/apps/workbench/Gemfile.lock b/apps/workbench/Gemfile.lock
index 0795f75..e1e2b81 100644
--- a/apps/workbench/Gemfile.lock
+++ b/apps/workbench/Gemfile.lock
@@ -48,9 +48,6 @@ GEM
       rack (>= 1.0.0)
       rack-test (>= 0.5.4)
       xpath (~> 2.0)
-    capybara-webkit (1.1.0)
-      capybara (~> 2.0, >= 2.0.2)
-      json
     childprocess (0.5.1)
       ffi (~> 1.0, >= 1.0.11)
     cliver (0.3.2)
@@ -67,6 +64,7 @@ GEM
     erubis (2.7.0)
     execjs (2.0.2)
     ffi (1.9.3)
+    headless (1.0.1)
     highline (1.6.20)
     hike (1.2.3)
     httpclient (2.3.4.1)
@@ -185,9 +183,9 @@ DEPENDENCIES
   bootstrap-sass (~> 3.1.0)
   bootstrap-x-editable-rails
   capybara
-  capybara-webkit
   coffee-rails (~> 3.2.0)
   deep_merge
+  headless
   httpclient
   jquery-rails
   less
diff --git a/apps/workbench/test/integration/users_test.rb b/apps/workbench/test/integration/users_test.rb
index 9ee12d8..8dda438 100644
--- a/apps/workbench/test/integration/users_test.rb
+++ b/apps/workbench/test/integration/users_test.rb
@@ -1,6 +1,9 @@
 require 'integration_helper'
+require 'selenium-webdriver'
+require 'headless'
 
 class UsersTest < ActionDispatch::IntegrationTest
+
   test "login as active user but not admin" do
     Capybara.current_driver = Capybara.javascript_driver
     visit page_with_token('active_trustedclient')
@@ -38,7 +41,11 @@ class UsersTest < ActionDispatch::IntegrationTest
   end
 
   test "create a new user" do
-    Capybara.current_driver = :webkit
+    headless = Headless.new
+    headless.start
+
+    Capybara.current_driver = :selenium
+
     visit page_with_token('admin_trustedclient')
 
     click_link 'Users'
@@ -77,10 +84,15 @@ class UsersTest < ActionDispatch::IntegrationTest
     click_link 'Metadata'
     assert page.has_text? '(Repository: test_repo)'
     assert !(page.has_text? '(VirtualMachine:)')
+
+    headless.stop
   end
 
   test "setup the active user" do
-    Capybara.current_driver = :webkit
+    headless = Headless.new
+    headless.start
+
+    Capybara.current_driver = :selenium
     visit page_with_token('admin_trustedclient')
 
     click_link 'Users'
@@ -97,6 +109,7 @@ class UsersTest < ActionDispatch::IntegrationTest
     click_link 'Setup Active User'
 
     sleep(0.1)
+
     popup = page.driver.browser.window_handles.last
     page.within_window popup do
       assert has_text? 'Virtual Machine'
@@ -129,10 +142,15 @@ class UsersTest < ActionDispatch::IntegrationTest
     click_link 'Metadata'
     assert page.has_text? '(Repository: second_test_repo)'
     assert page.has_text? '(VirtualMachine: testvm.shell)'
+
+    headless.stop
   end
 
   test "unsetup active user" do
-    Capybara.current_driver = :webkit
+    headless = Headless.new
+    headless.start
+
+    Capybara.current_driver = :selenium
 
     visit page_with_token('admin_trustedclient')
 
@@ -160,6 +178,7 @@ class UsersTest < ActionDispatch::IntegrationTest
     sleep(0.1)
 
     # Should now be back in the Attributes tab for the user
+    page.driver.browser.switch_to.alert.accept
     assert page.has_text? 'modified_by_user_uuid'
     page.within(:xpath, '//a[@data-name="is_active"]') do
       assert_equal "false", text, "Expected user's is_active to be false after unsetup"
@@ -188,6 +207,8 @@ class UsersTest < ActionDispatch::IntegrationTest
     click_link 'Metadata'
     assert page.has_text? '(Repository: second_test_repo)'
     assert page.has_text? '(VirtualMachine: testvm.shell)'
+
+    headless.stop
   end
 
 end

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list