[ARVADOS] updated: eee5ba33c484bc2ac212f42cdb758a963dcba31f

Git user git at public.curoverse.com
Tue Apr 11 13:22:32 EDT 2017


Summary of changes:
 apps/workbench/test/integration/collection_upload_test.rb |  6 +++---
 apps/workbench/test/integration/collections_test.rb       | 10 +++++-----
 apps/workbench/test/integration_helper.rb                 | 15 +++++++++++++++
 3 files changed, 23 insertions(+), 8 deletions(-)

       via  eee5ba33c484bc2ac212f42cdb758a963dcba31f (commit)
      from  cb8407c0cc09b4ad6ac8b0d9e808d14fb8da3084 (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 eee5ba33c484bc2ac212f42cdb758a963dcba31f
Author: radhika <radhika at curoverse.com>
Date:   Tue Apr 11 12:34:18 2017 -0400

    11365: accept alert in tests with some wait time

diff --git a/apps/workbench/test/integration/collection_upload_test.rb b/apps/workbench/test/integration/collection_upload_test.rb
index 84e3286..1a8dd72 100644
--- a/apps/workbench/test/integration/collection_upload_test.rb
+++ b/apps/workbench/test/integration/collection_upload_test.rb
@@ -44,7 +44,7 @@ class CollectionUploadTest < ActionDispatch::IntegrationTest
 
     # unlock before uploading files
     first('.lock-collection-btn').click
-    page.driver.browser.switch_to.alert.accept
+    accept_alert
 
     find('.nav-tabs a', text: 'Upload').click
     attach_file 'file_selector', testfile_path('empty.txt')
@@ -63,7 +63,7 @@ class CollectionUploadTest < ActionDispatch::IntegrationTest
 
     # unlock before uploading files
     first('.lock-collection-btn').click
-    page.driver.browser.switch_to.alert.accept
+    accept_alert
 
     find('.nav-tabs a', text: 'Upload').click
     attach_file 'file_selector', testfile_path('a')
@@ -106,7 +106,7 @@ class CollectionUploadTest < ActionDispatch::IntegrationTest
 
     # unlock before uploading a file
     first('.lock-collection-btn').click
-    page.driver.browser.switch_to.alert.accept
+    accept_alert
 
     find('.nav-tabs a', text: 'Upload').click
     attach_file 'file_selector', testfile_path('foo.txt')
diff --git a/apps/workbench/test/integration/collections_test.rb b/apps/workbench/test/integration/collections_test.rb
index 5d253e8..0fc1f44 100644
--- a/apps/workbench/test/integration/collections_test.rb
+++ b/apps/workbench/test/integration/collections_test.rb
@@ -307,7 +307,7 @@ class CollectionsTest < ActionDispatch::IntegrationTest
 
     # unlock before removing a file
     first('.lock-collection-btn').click
-    page.driver.browser.switch_to.alert.accept
+    accept_alert
 
     # remove first file
     input_files = page.all('input[type=checkbox]')
@@ -330,10 +330,10 @@ class CollectionsTest < ActionDispatch::IntegrationTest
 
     # unlock before removing a file
     first('.lock-collection-btn').click
-    page.driver.browser.switch_to.alert.accept
+    accept_alert
 
     first('.fa-trash-o').click
-    page.driver.browser.switch_to.alert.accept
+    accept_alert
 
     assert(page.has_no_text?('file1'), 'file found - file')
     assert(page.has_text?('file2'), 'file not found - file2')
@@ -346,7 +346,7 @@ class CollectionsTest < ActionDispatch::IntegrationTest
 
     # unlock before renaming a file
     first('.lock-collection-btn').click
-    page.driver.browser.switch_to.alert.accept
+    accept_alert
 
     within('.collection_files') do
       first('.fa-pencil').click
@@ -400,7 +400,7 @@ class CollectionsTest < ActionDispatch::IntegrationTest
 
     # Unlock and verify the file modification controls are enabled
     first('.lock-collection-btn').click
-    page.driver.browser.switch_to.alert.accept
+    accept_alert
 
     assert_no_selector 'a[data-toggle="disabled"]', text: 'Upload'
     assert_selector 'a', text: 'Upload'
diff --git a/apps/workbench/test/integration_helper.rb b/apps/workbench/test/integration_helper.rb
index 3d92585..067a1bd 100644
--- a/apps/workbench/test/integration_helper.rb
+++ b/apps/workbench/test/integration_helper.rb
@@ -221,4 +221,19 @@ class ActionDispatch::IntegrationTest
     end
     Capybara.reset_sessions!
   end
+
+  def accept_alert
+    if Capybara.current_driver == :selenium
+      (0..9).each do
+        begin
+          page.driver.browser.switch_to.alert.accept
+          break
+        rescue Selenium::WebDriver::Error::NoSuchAlertError
+         sleep 0.1
+        end
+      end
+    else
+      # poltergeist returns true for confirm, so no need to accept
+    end
+  end
 end

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list