[ARVADOS] created: 11d4662881250afd5883633e018e8b879427baf4
Git user
git at public.curoverse.com
Thu Sep 29 03:42:22 EDT 2016
at 11d4662881250afd5883633e018e8b879427baf4 (commit)
commit 11d4662881250afd5883633e018e8b879427baf4
Author: Tom Morris <tfmorris at gmail.com>
Date: Thu Sep 29 03:37:06 2016 -0400
Fix negative Capybara assertion/matcher
diff --git a/apps/workbench/test/integration/pipeline_instances_test.rb b/apps/workbench/test/integration/pipeline_instances_test.rb
index 7700156..d97850c 100644
--- a/apps/workbench/test/integration/pipeline_instances_test.rb
+++ b/apps/workbench/test/integration/pipeline_instances_test.rb
@@ -57,7 +57,7 @@ class PipelineInstancesTest < ActionDispatch::IntegrationTest
end
# project chooser
- within('.modal-dialog') do
+ within('.modal-dialog') do #FIXME: source of 1 test error
find('.selectable', text: 'A Project').click
find('button', text: 'Choose').click
end
@@ -226,7 +226,7 @@ class PipelineInstancesTest < ActionDispatch::IntegrationTest
template_uuid = api_fixture("pipeline_templates", template_name, "uuid")
visit page_with_token("active", "/pipeline_templates/#{template_uuid}")
click_on "Run this pipeline"
- within(".modal-dialog") do
+ within(".modal-dialog") do # FIXME: source of 3 test errors
# Set project for the new pipeline instance
find(".selectable", text: project_name).click
click_on "Choose"
@@ -453,7 +453,7 @@ class PipelineInstancesTest < ActionDispatch::IntegrationTest
page.assert_selector 'a,button', text: 'Pause'
# Since it is test env, no jobs are created to run. So, graph not visible
- assert_not page.has_text? 'Graph'
+ assert page.has_no_text? 'Graph'
end
[
commit a055ee5e42d21a99f016d87af3f8dadf9d0e68ee
Author: Tom Morris <tfmorris at gmail.com>
Date: Thu Sep 29 03:17:48 2016 -0400
Fix not present test for Capybara
diff --git a/apps/workbench/test/integration/pipeline_instances_test.rb b/apps/workbench/test/integration/pipeline_instances_test.rb
index 3d8cbf0..7700156 100644
--- a/apps/workbench/test/integration/pipeline_instances_test.rb
+++ b/apps/workbench/test/integration/pipeline_instances_test.rb
@@ -149,7 +149,7 @@ class PipelineInstancesTest < ActionDispatch::IntegrationTest
page.assert_selector 'a,button', text: 'Re-run options'
# Since it is test env, no jobs are created to run. So, graph not visible
- assert_not page.has_text? 'Graph'
+ assert page.has_no_text? 'Graph'
end
# Create a pipeline instance from within a project and run
commit 8eda004a54881427fa58b39de6c0160083a6727e
Author: Tom Morris <tfmorris at gmail.com>
Date: Thu Sep 29 03:03:30 2016 -0400
Fix long wait for Capybara test
diff --git a/apps/workbench/test/integration/users_test.rb b/apps/workbench/test/integration/users_test.rb
index 90a3eb2..140cb56 100644
--- a/apps/workbench/test/integration/users_test.rb
+++ b/apps/workbench/test/integration/users_test.rb
@@ -80,7 +80,8 @@ class UsersTest < ActionDispatch::IntegrationTest
click_link 'Advanced'
click_link 'Metadata'
- assert !(page.has_text? 'VirtualMachine:')
+ assert page.has_text? 'can_login' # make sure page is rendered / ready
+ assert page.has_no_text? 'VirtualMachine:'
end
test "setup the active user" do
commit 16f812aede9c85f0ba5d99c9786102f068751621
Author: Tom Morris <tfmorris at gmail.com>
Date: Thu Sep 29 02:17:27 2016 -0400
Restore Capybara.default_max_wait_time side effect
diff --git a/apps/workbench/test/integration_helper.rb b/apps/workbench/test/integration_helper.rb
index d5be993..424b666 100644
--- a/apps/workbench/test/integration_helper.rb
+++ b/apps/workbench/test/integration_helper.rb
@@ -71,6 +71,8 @@ Capybara.register_driver :selenium_with_download do |app|
end
module WaitForAjax
+ # FIXME: Huge side effect here
+ Capybara.default_max_wait_time = 10
def wait_for_ajax
timeout = 10
count = 0
commit 8662a2f35048adc3c75a1964fff1c68b72b9f755
Author: Tom Morris <tfmorris at gmail.com>
Date: Thu Sep 29 01:04:39 2016 -0400
Fix row selection logic to not wait
diff --git a/apps/workbench/test/helpers/share_object_helper.rb b/apps/workbench/test/helpers/share_object_helper.rb
index 0d20aac..0266388 100644
--- a/apps/workbench/test/helpers/share_object_helper.rb
+++ b/apps/workbench/test/helpers/share_object_helper.rb
@@ -31,9 +31,10 @@ module ShareObjectHelper
end
click_on "Add"
end
- using_wait_time(Capybara.default_max_wait_time * 3) do
+ # Admin case takes many times longer than normal user, but not sure why
+ using_wait_time(30) do
assert(page.has_link?(name),
- "new share was not added to sharing table")
+ "new share #{name} was not added to sharing table")
assert_equal(start_share_count + 1, share_rows.size,
"new share did not add row to sharing table")
end
@@ -41,7 +42,8 @@ module ShareObjectHelper
def modify_share_and_check(name)
start_rows = share_rows
- link_row = start_rows.select { |row| row.has_text?(name) }
+ # We assume rows have already been rendered and can be checked quickly
+ link_row = start_rows.select { |row| row.has_text?(name, wait:(0.1) ) }
assert_equal(1, link_row.size, "row with new permission not found")
within(link_row.first) do
click_on("Read")
commit e3ec18f0b1b5add51dfa8600e8bd6cf107292b18
Author: Tom Morris <tfmorris at gmail.com>
Date: Thu Sep 29 00:53:50 2016 -0400
Fix and simplify wait_for_ajax
Don't change global Capybara.default_max_wait_time
Sleep so we're not competing with thread(s) doing work
diff --git a/apps/workbench/test/integration_helper.rb b/apps/workbench/test/integration_helper.rb
index f0c811a..d5be993 100644
--- a/apps/workbench/test/integration_helper.rb
+++ b/apps/workbench/test/integration_helper.rb
@@ -71,16 +71,16 @@ Capybara.register_driver :selenium_with_download do |app|
end
module WaitForAjax
- Capybara.default_max_wait_time = 10
def wait_for_ajax
- Timeout.timeout(Capybara.default_max_wait_time) do
- loop until finished_all_ajax_requests?
+ timeout = 10
+ count = 0
+ while page.evaluate_script("jQuery.active").to_i > 0
+ count += 1
+ raise "AJAX request took more than #{timeout} seconds" if count > timeout * 10
+ sleep(0.1)
end
end
- def finished_all_ajax_requests?
- page.evaluate_script('jQuery.active').zero?
- end
end
module AssertDomEvent
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list