X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/0eb72b526bf8bbb011551ecf019f604e17a534f1..fd5d197916b117386fbe872790ff6493326c4ea2:/apps/workbench/test/integration/work_units_test.rb diff --git a/apps/workbench/test/integration/work_units_test.rb b/apps/workbench/test/integration/work_units_test.rb index ed214d62cc..e5cc6e4dc0 100644 --- a/apps/workbench/test/integration/work_units_test.rb +++ b/apps/workbench/test/integration/work_units_test.rb @@ -12,21 +12,34 @@ class WorkUnitsTest < ActionDispatch::IntegrationTest need_javascript end - test "scroll all_processes page" do - expected_min, expected_max, expected, not_expected = [ - 25, 100, - ['/pipeline_instances/zzzzz-d1hrv-1yfj61234abcdk3', - '/pipeline_instances/zzzzz-d1hrv-jobspeccomponts', - '/jobs/zzzzz-8i9sb-grx15v5mjnsyxk7', - '/jobs/zzzzz-8i9sb-n7omg50bvt0m1nf', - '/container_requests/zzzzz-xvhdp-cr4completedcr2', - '/container_requests/zzzzz-xvhdp-cr4requestercn2'], - ['/pipeline_instances/zzzzz-d1hrv-scarxiyajtshq3l', - '/container_requests/zzzzz-xvhdp-oneof60crs00001'] - ] - + [[true, 25, 100, + ['/pipeline_instances/zzzzz-d1hrv-1yfj61234abcdk3', + '/pipeline_instances/zzzzz-d1hrv-jobspeccomponts', + '/jobs/zzzzz-8i9sb-grx15v5mjnsyxk7', + '/jobs/zzzzz-8i9sb-n7omg50bvt0m1nf', + '/container_requests/zzzzz-xvhdp-cr4completedcr2', + '/container_requests/zzzzz-xvhdp-cr4requestercn2'], + ['/pipeline_instances/zzzzz-d1hrv-scarxiyajtshq3l', + '/container_requests/zzzzz-xvhdp-oneof60crs00001']], + [false, 25, 100, + ['/pipeline_instances/zzzzz-d1hrv-1yfj61234abcdk3', + '/pipeline_instances/zzzzz-d1hrv-jobspeccomponts', + '/container_requests/zzzzz-xvhdp-cr4completedcr2'], + ['/pipeline_instances/zzzzz-d1hrv-scarxiyajtshq3l', + '/container_requests/zzzzz-xvhdp-oneof60crs00001', + '/jobs/zzzzz-8i9sb-grx15v5mjnsyxk7', + '/jobs/zzzzz-8i9sb-n7omg50bvt0m1nf', + '/container_requests/zzzzz-xvhdp-cr4requestercn2' + ]] + ].each do |show_children, expected_min, expected_max, expected, not_expected| + test "scroll all_processes page with show_children=#{show_children}" do visit page_with_token('active', "/all_processes") + if show_children + find('#IncludeChildProcs').click + wait_for_ajax + end + page_scrolls = expected_max/20 + 2 within('.arv-recent-all-processes') do (0..page_scrolls).each do |i| @@ -43,13 +56,13 @@ class WorkUnitsTest < ActionDispatch::IntegrationTest found_count = found_items.count if expected_min == expected_max assert_equal(true, found_count == expected_min, - "Not found expected number of items. Expected #{expected_min} and found #{found_count}") + "Not found expected number of items. Expected #{expected_min} and found #{found_count}") assert page.has_no_text? 'request failed' else assert_equal(true, found_count>=expected_min, - "Found too few items. Expected at least #{expected_min} and found #{found_count}") + "Found too few items. Expected at least #{expected_min} and found #{found_count}") assert_equal(true, found_count<=expected_max, - "Found too many items. Expected at most #{expected_max} and found #{found_count}") + "Found too many items. Expected at most #{expected_max} and found #{found_count}") end # verify that all expected uuid links are found @@ -61,6 +74,7 @@ class WorkUnitsTest < ActionDispatch::IntegrationTest not_expected.each do |link| assert_no_selector "a[href=\"#{link}\"]" end + end end [ @@ -79,7 +93,7 @@ class WorkUnitsTest < ActionDispatch::IntegrationTest assert_text 'created_at' if cancelable - assert_text 'priority: 1' if type.include?('container') + assert_text 'priority: 501' if type.include?('container') if type.include?('pipeline') assert_selector 'a', text: 'Pause' first('a,link', text: 'Pause').click @@ -216,7 +230,7 @@ class WorkUnitsTest < ActionDispatch::IntegrationTest old_attributes: {state: 'Running'}, new_attributes: {state: 'Complete', exit_code: 1}, }, - }, "Container #{c['uuid']} finished with exit code 1 (failure)"], + }, "Container #{c['uuid']} finished"], # It's unrealistic for state to change again once it's Complete, # but the logging code doesn't care, so we do it to keep the test # simple.