1 require 'integration_helper'
3 class AllProcessesTest < ActionDispatch::IntegrationTest
10 ['/pipeline_instances/zzzzz-d1hrv-1yfj61234abcdk3',
11 '/pipeline_instances/zzzzz-d1hrv-jobspeccomponts',
12 '/jobs/zzzzz-8i9sb-grx15v5mjnsyxk7',
13 '/jobs/zzzzz-8i9sb-n7omg50bvt0m1nf',
14 '/container_requests/zzzzz-xvhdp-cr4completedcr2',
15 '/container_requests/zzzzz-xvhdp-cr4requestercn2'],
16 ['/pipeline_instances/zzzzz-d1hrv-scarxiyajtshq3l',
17 '/container_requests/zzzzz-xvhdp-oneof60crs00001']],
19 ['/pipeline_instances/zzzzz-d1hrv-1xfj6xkicf2muk2',
20 '/pipeline_instances/zzzzz-d1hrv-jobspeccomponts',
21 '/jobs/zzzzz-8i9sb-grx15v5mjnsyxk7'],
22 ['/pipeline_instances/zzzzz-d1hrv-1yfj61234abcdk3',
23 '/jobs/zzzzz-8i9sb-n7omg50bvt0m1nf',
24 '/container_requests/zzzzz-xvhdp-cr4completedcr2']],
25 ['pipeline_with_tagged_collection_input', 1, 1,
26 ['/pipeline_instances/zzzzz-d1hrv-1yfj61234abcdk3'],
27 ['/pipeline_instances/zzzzz-d1hrv-jobspeccomponts',
28 '/jobs/zzzzz-8i9sb-pshmckwoma9plh7',
29 '/jobs/zzzzz-8i9sb-n7omg50bvt0m1nf',
30 '/container_requests/zzzzz-xvhdp-cr4completedcr2']],
31 ['no_such_match', 0, 0,
33 ['/pipeline_instances/zzzzz-d1hrv-jobspeccomponts',
34 '/jobs/zzzzz-8i9sb-pshmckwoma9plh7',
35 '/jobs/zzzzz-8i9sb-n7omg50bvt0m1nf',
36 '/container_requests/zzzzz-xvhdp-cr4completedcr2']],
37 ].each do |search_filter, expected_min, expected_max, expected, not_expected|
38 test "scroll all_processes page for search filter '#{search_filter}'" do
39 visit page_with_token('active', "/all_processes")
42 find('.recent-all-processes-filterable-control').set(search_filter)
47 page_scrolls = expected_max/20 + 2
48 within('.arv-recent-all-processes') do
49 (0..page_scrolls).each do |i|
50 page.driver.scroll_to 0, 999000
58 # Verify that expected number of processes are found
59 found_items = page.all('tr[data-object-uuid]')
60 found_count = found_items.count
61 if expected_min == expected_max
62 assert_equal(true, found_count == expected_min,
63 "Not found expected number of items. Expected #{expected_min} and found #{found_count}")
64 assert page.has_no_text? 'request failed'
66 assert_equal(true, found_count>=expected_min,
67 "Found too few items. Expected at least #{expected_min} and found #{found_count}")
68 assert_equal(true, found_count<=expected_max,
69 "Found too many items. Expected at most #{expected_max} and found #{found_count}")
72 # verify that all expected uuid links are found
73 expected.each do |link|
74 assert_selector "a[href=\"#{link}\"]"
77 # verify that none of the not_expected uuid links are found
78 not_expected.each do |link|
79 assert_no_selector "a[href=\"#{link}\"]"