X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/9b98829c565a2aa487d21ecd7f9429c23d0cec20..d0584563200b0fe69e508b2fc5b0ddb223ebccc0:/apps/workbench/test/integration/application_layout_test.rb diff --git a/apps/workbench/test/integration/application_layout_test.rb b/apps/workbench/test/integration/application_layout_test.rb index 3edd660e3d..b3f704cdd9 100644 --- a/apps/workbench/test/integration/application_layout_test.rb +++ b/apps/workbench/test/integration/application_layout_test.rb @@ -1,3 +1,7 @@ +# Copyright (C) The Arvados Authors. All rights reserved. +# +# SPDX-License-Identifier: AGPL-3.0 + require 'integration_helper' class ApplicationLayoutTest < ActionDispatch::IntegrationTest @@ -52,7 +56,7 @@ class ApplicationLayoutTest < ActionDispatch::IntegrationTest assert_selector "a[href=\"/projects/#{user['uuid']}\"]", text: 'Home project' assert_selector "a[href=\"/users/#{user['uuid']}/virtual_machines\"]", text: 'Virtual machines' - assert_selector "a[href=\"/users/#{user['uuid']}/repositories\"]", text: 'Repositories' + assert_selector "a[href=\"/repositories\"]", text: 'Repositories' assert_selector "a[href=\"/current_token\"]", text: 'Current token' assert_selector "a[href=\"/users/#{user['uuid']}/ssh_keys\"]", text: 'SSH keys' @@ -136,6 +140,30 @@ class ApplicationLayoutTest < ActionDispatch::IntegrationTest end end + [ + [false, false], + ['http://wb2.example.org//', false], + ['ftp://wb2.example.org', false], + ['wb2.example.org', false], + ['http://wb2.example.org', true], + ['https://wb2.example.org', true], + ['http://wb2.example.org/', true], + ['https://wb2.example.org/', true], + ].each do |wb2_url_config, wb2_menu_appear| + test "workbench2_url=#{wb2_url_config} should#{wb2_menu_appear ? '' : ' not'} show WB2 menu" do + Rails.configuration.workbench2_url = wb2_url_config + assert_equal wb2_menu_appear, ConfigValidators::validate_wb2_url_config() + + visit page_with_token('active') + within('.navbar-fixed-top') do + page.find("#notifications-menu").click + within('.dropdown-menu') do + assert_equal wb2_menu_appear, page.has_text?('Go to Workbench 2') + end + end + end + end + [ ['active', true], ['active_with_prefs_profile_no_getting_started_shown', false], @@ -210,7 +238,7 @@ class ApplicationLayoutTest < ActionDispatch::IntegrationTest end [ - ['Repositories', nil, 's0uqq'], + ['Repositories', nil, 'active/crunchdispatchtest'], ['Virtual machines', nil, 'testvm.shell'], ['SSH keys', nil, 'public_key'], ['Links', nil, 'link_class'], @@ -251,14 +279,14 @@ class ApplicationLayoutTest < ActionDispatch::IntegrationTest assert_text 'Recent pipelines and processes' # seeing dashboard now within('.recent-processes-actions') do - assert page.has_link?('Run a pipeline') + assert page.has_link?('Run a process') assert page.has_link?('All processes') end within('.recent-processes') do - assert_text 'running_with_job' - within('.row-zzzzz-d1hrv-runningpipeline') do - assert_text 'foo' + + within('.row-zzzzz-xvhdp-cr4runningcntnr') do + assert_text 'running' end assert_text 'zzzzz-d1hrv-twodonepipeline' @@ -286,78 +314,4 @@ class ApplicationLayoutTest < ActionDispatch::IntegrationTest end end end - - [ - ['jobs', 'running_job_with_components', true], - ['pipeline_instances', 'components_is_jobspec', false], - ['containers', 'running', false], - ['container_requests', 'running', true], - ].each do |type, fixture, cancelable| - test "cancel button for #{type}/#{fixture}" do - if cancelable - need_selenium 'to cancel' - end - - obj = api_fixture(type)[fixture] - visit page_with_token "active", "/#{type}/#{obj['uuid']}" - - assert_text 'created_at' - if cancelable - assert page.has_button?('Cancel'), 'No Cancel button' - click_button 'Cancel' - wait_for_ajax - assert page.has_no_button?('Cancel'), 'Cancel button not expected after clicking' - else - assert page.has_no_button?('Cancel'), 'Cancel button not expected' - end - end - end - - [ - ['jobs', 'running_job_with_components'], - ['pipeline_instances', 'has_component_with_completed_jobs'], - ['container_requests', 'running'], - ['container_requests', 'completed'], - ].each do |type, fixture| - test "edit description for #{type}/#{fixture}" do - obj = api_fixture(type)[fixture] - visit page_with_token "active", "/#{type}/#{obj['uuid']}" - - within('.arv-description-as-subtitle') do - find('.fa-pencil').click - find('.editable-input textarea').set('*Textile description for object*') - find('.editable-submit').click - end - wait_for_ajax - - # verify description - assert page.has_no_text? '*Textile description for object*' - assert page.has_text? 'Textile description for object' - end - end - - [ - ['Two Part Pipeline Template', 'part-one', 'Provide a value for the following'], - ['Workflow with input specifications', 'this work has inputs specified', 'This container is uncommitted'], - ].each do |template_name, preview_txt, process_txt| - test "run a process using template #{template_name} from dashboard" do - visit page_with_token('admin') - assert_text 'Recent pipelines and processes' # seeing dashboard now - - within('.recent-processes-actions') do - assert page.has_link?('All processes') - find('a', text: 'Run a pipeline').click - end - - # in the chooser, verify preview and click Next button - within('.modal-dialog') do - find('.selectable', text: template_name).click - assert_text preview_txt - find('.btn', text: 'Next: choose inputs').click - end - - # in the process page now - assert_text process_txt - end - end end