projects
/
arvados.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch '2659-anonymous-share-projects' of git.curoverse.com:arvados into 2659...
[arvados.git]
/
apps
/
workbench
/
test
/
integration
/
pipeline_instances_test.rb
diff --git
a/apps/workbench/test/integration/pipeline_instances_test.rb
b/apps/workbench/test/integration/pipeline_instances_test.rb
index 0d5c747c6e089a93312b195166f28facb6dcc56c..1c8139e6c6539997c3d2322c1cf3bce460ab3dd8 100644
(file)
--- a/
apps/workbench/test/integration/pipeline_instances_test.rb
+++ b/
apps/workbench/test/integration/pipeline_instances_test.rb
@@
-1,13
+1,8
@@
require 'integration_helper'
require 'integration_helper'
-require 'selenium-webdriver'
-require 'headless'
class PipelineInstancesTest < ActionDispatch::IntegrationTest
setup do
class PipelineInstancesTest < ActionDispatch::IntegrationTest
setup do
- # Selecting collections requiresLocalStorage
- headless = Headless.new
- headless.start
- Capybara.current_driver = :selenium
+ need_javascript
end
test 'Create and run a pipeline' do
end
test 'Create and run a pipeline' do
@@
-69,8
+64,7
@@
class PipelineInstancesTest < ActionDispatch::IntegrationTest
# The input, after being specified, should still be editable (#3382)
find('div.form-group', text: 'Foo/bar pair').
# The input, after being specified, should still be editable (#3382)
find('div.form-group', text: 'Foo/bar pair').
- find('.btn', text: 'Choose').
- click
+ find('.btn', text: 'Choose').click
within('.modal-dialog') do
assert(has_text?("Foo/bar pair"),
within('.modal-dialog') do
assert(has_text?("Foo/bar pair"),
@@
-79,7
+73,6
@@
class PipelineInstancesTest < ActionDispatch::IntegrationTest
first('span', text: 'foo_tag').click
find('button', text: 'OK').click
end
first('span', text: 'foo_tag').click
find('button', text: 'OK').click
end
- wait_for_ajax
# For good measure, check one last time that the input, after being specified twice, is still be displayed (#3382)
assert find('div.form-group', text: 'Foo/bar pair')
# For good measure, check one last time that the input, after being specified twice, is still be displayed (#3382)
assert find('div.form-group', text: 'Foo/bar pair')
@@
-230,14
+223,16
@@
class PipelineInstancesTest < ActionDispatch::IntegrationTest
[true, 'Two Part Pipeline Template', 'collection_with_no_name_in_aproject', false],
].each do |in_aproject, template_name, collection, choose_file|
test "Run pipeline instance in #{in_aproject} with #{template_name} with #{collection} file #{choose_file}" do
[true, 'Two Part Pipeline Template', 'collection_with_no_name_in_aproject', false],
].each do |in_aproject, template_name, collection, choose_file|
test "Run pipeline instance in #{in_aproject} with #{template_name} with #{collection} file #{choose_file}" do
- visit page_with_token('active')
+ if in_aproject
+ visit page_with_token 'active', \
+ '/projects/'+api_fixture('groups')['aproject']['uuid']
+ else
+ visit page_with_token 'active', '/'
+ end
# need bigger modal size when choosing a file from collection
# need bigger modal size when choosing a file from collection
- Capybara.current_session.driver.browser.manage.window.resize_to(1024, 768)
-
- if in_aproject
- find("#projects-menu").click
- find('.dropdown-menu a,button', text: 'A Project').click
+ if Capybara.current_driver == :selenium
+ Capybara.current_session.driver.browser.manage.window.resize_to(1200, 800)
end
create_and_run_pipeline_in_aproject in_aproject, template_name, collection, choose_file
end
create_and_run_pipeline_in_aproject in_aproject, template_name, collection, choose_file
@@
-271,38
+266,26
@@
class PipelineInstancesTest < ActionDispatch::IntegrationTest
['project_viewer', true, true, true],
].each do |user, with_options, choose_options, in_aproject|
test "Rerun pipeline instance as #{user} using options #{with_options} #{choose_options} in #{in_aproject}" do
['project_viewer', true, true, true],
].each do |user, with_options, choose_options, in_aproject|
test "Rerun pipeline instance as #{user} using options #{with_options} #{choose_options} in #{in_aproject}" do
- visit page_with_token('active')
-
- # need bigger modal size when choosing a file from collection
- Capybara.current_session.driver.browser.manage.window.resize_to(1024, 768)
-
if in_aproject
if in_aproject
- find("#projects-menu").click
- find('.dropdown-menu a,button', text: 'A Project').click
+ path = '/pipeline_instances/'+api_fixture('pipeline_instances')['pipeline_owned_by_active_in_aproject']['uuid']
+ else
+ path = '/pipeline_instances/'+api_fixture('pipeline_instances')['pipeline_owned_by_active_in_home']['uuid']
end
end
- create_and_run_pipeline_in_aproject in_aproject, 'Two Part Pipeline Template', 'foo_collection_in_aproject'
- instance_path = current_path
+ visit page_with_token(user, path)
- # Pause the pipeline
- find('a,button', text: 'Pause').click
- assert page.has_text? 'Paused'
- page.assert_no_selector 'a.disabled,button.disabled', text: 'Resume'
page.assert_selector 'a,button', text: 'Re-run with latest'
page.assert_selector 'a,button', text: 'Re-run options'
page.assert_selector 'a,button', text: 'Re-run with latest'
page.assert_selector 'a,button', text: 'Re-run options'
- # Pipeline can be re-run now. Access it as the specified user, and re-run
- if user == 'project_viewer'
- visit page_with_token(user, instance_path)
+ if user == 'project_viewer' && in_aproject
assert page.has_text? 'A Project'
assert page.has_text? 'A Project'
- page.assert_no_selector 'a.disabled,button.disabled', text: 'Resume'
- page.assert_selector 'a,button', text: 'Re-run with latest'
- page.assert_selector 'a,button', text: 'Re-run options'
end
# Now re-run the pipeline
if with_options
end
# Now re-run the pipeline
if with_options
- find('a,button', text: 'Re-run options').click
+ assert_triggers_dom_event 'shown.bs.modal' do
+ find('a,button', text: 'Re-run options').click
+ end
within('.modal-dialog') do
page.assert_selector 'a,button', text: 'Copy and edit inputs'
page.assert_selector 'a,button', text: 'Run now'
within('.modal-dialog') do
page.assert_selector 'a,button', text: 'Copy and edit inputs'
page.assert_selector 'a,button', text: 'Run now'
@@
-316,15
+299,16
@@
class PipelineInstancesTest < ActionDispatch::IntegrationTest
find('a,button', text: 'Re-run with latest').click
end
find('a,button', text: 'Re-run with latest').click
end
- # Verify that the newly created instance is created in the right project.
- # In case of project_viewer user, since the use cannot write to the project,
- # the pipeline should have been created in the user's Home project.
- assert_not_equal instance_path, current_path, 'Rerun instance path expected to be different'
- assert page.has_text? 'Home'
+ # Verify that the newly created instance is created in the right
+ # project. In case of project_viewer user, since the user cannot
+ # write to the project, the pipeline should have been created in
+ # the user's Home project.
+ assert_not_equal path, current_path, 'Rerun instance path expected to be different'
+ assert_text 'Home'
if in_aproject && (user != 'project_viewer')
if in_aproject && (user != 'project_viewer')
- assert
page.has_text?
'A Project'
+ assert
_text
'A Project'
else
else
- assert
page.has_no_text?
'A Project'
+ assert
_no_text
'A Project'
end
end
end
end
end
end
@@
-374,7
+358,6
@@
class PipelineInstancesTest < ActionDispatch::IntegrationTest
end
find('button', text: 'OK').click
end
end
find('button', text: 'OK').click
end
- wait_for_ajax
# The input, after being specified, should still be displayed (#3382)
assert find('div.form-group', text: 'Foo/bar pair')
# The input, after being specified, should still be displayed (#3382)
assert find('div.form-group', text: 'Foo/bar pair')
@@
-383,6
+366,7
@@
class PipelineInstancesTest < ActionDispatch::IntegrationTest
# are saved in the desired places. (#4015)
click_link 'Advanced'
click_link 'API response'
# are saved in the desired places. (#4015)
click_link 'Advanced'
click_link 'API response'
+
api_response = JSON.parse(find('div#advanced_api_response pre').text)
input_params = api_response['components']['part-one']['script_parameters']['input']
assert_equal(input_params['selection_uuid'], collection['uuid'], "Not found expected input param uuid")
api_response = JSON.parse(find('div#advanced_api_response pre').text)
input_params = api_response['components']['part-one']['script_parameters']['input']
assert_equal(input_params['selection_uuid'], collection['uuid'], "Not found expected input param uuid")
@@
-443,7
+427,7
@@
class PipelineInstancesTest < ActionDispatch::IntegrationTest
['admin', nil, 40, 200],
['admin', 'FUSE project', 1, 1],
['admin', 'pipeline_10', 2, 2],
['admin', nil, 40, 200],
['admin', 'FUSE project', 1, 1],
['admin', 'pipeline_10', 2, 2],
- ['active', 'containing at least two',
0, 0], # component description is not a searchable column
+ ['active', 'containing at least two',
2, 100],
['active', nil, 10, 100],
['active', 'no such match', 0, 0],
].each do |user, search_filter, expected_min, expected_max|
['active', nil, 10, 100],
['active', 'no such match', 0, 0],
].each do |user, search_filter, expected_min, expected_max|
@@
-461,7
+445,7
@@
class PipelineInstancesTest < ActionDispatch::IntegrationTest
page_scrolls = expected_max/20 + 2 # scroll num_pages+2 times to test scrolling is disabled when it should be
within('.arv-recent-pipeline-instances') do
(0..page_scrolls).each do |i|
page_scrolls = expected_max/20 + 2 # scroll num_pages+2 times to test scrolling is disabled when it should be
within('.arv-recent-pipeline-instances') do
(0..page_scrolls).each do |i|
- page.
execute_script "window.scrollBy(0,999000)"
+ page.
driver.scroll_to 0, 999000
begin
wait_for_ajax
rescue
begin
wait_for_ajax
rescue
@@
-484,5
+468,4
@@
class PipelineInstancesTest < ActionDispatch::IntegrationTest
end
end
end
end
end
end
-
end
end