X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/1060cff7480331bcad2b4564e270922b2b3b1f94..6a7271ad8b9c145c6fb6bbc9e0914f32bcaa225d:/apps/workbench/test/integration/user_profile_test.rb diff --git a/apps/workbench/test/integration/user_profile_test.rb b/apps/workbench/test/integration/user_profile_test.rb index accc6a7963..3aac6a0ea0 100644 --- a/apps/workbench/test/integration/user_profile_test.rb +++ b/apps/workbench/test/integration/user_profile_test.rb @@ -24,20 +24,31 @@ class UserProfileTest < ActionDispatch::IntegrationTest assert page.has_no_text?('Save profile'), 'Found text - Save profile' end elsif invited - assert page.has_text?('Please check the box below to indicate that you have read and accepted the user agreement'), 'Not found text - Please check the box below . . .' + assert page.has_text?('Please check the box below to indicate that you have read and accepted the user agreement'), + 'Not found text - Please check the box below . . .' assert page.has_no_text?('Save profile'), 'Found text - Save profile' else assert page.has_text?('Your account is inactive'), 'Not found text - Your account is inactive' assert page.has_no_text?('Save profile'), 'Found text - Save profile' end + # If the user has not already seen getting_started modal, it will be shown on first visit. + if user and user['is_active'] and !user['prefs']['getting_started_shown'] + within '.modal-content' do + assert_text 'Getting Started' + assert_selector 'button', text: 'Next' + assert_selector 'button', text: 'Prev' + first('button', text: 'x').click + end + end + within('.navbar-fixed-top') do if !user assert page.has_link?('Log in'), 'Not found link - Log in' else # my account menu - assert page.has_link?("#{user['email']}"), 'Not found link - email' - find('a', text: "#{user['email']}").click + assert(page.has_link?("notifications-menu"), 'no user menu') + page.find("#notifications-menu").click within('.dropdown-menu') do if user['is_active'] assert page.has_no_link?('Not active'), 'Found link - Not active' @@ -98,7 +109,11 @@ class UserProfileTest < ActionDispatch::IntegrationTest click_button "Save profile" # profile saved and in profile page now with success assert page.has_text?('Thank you for filling in your profile'), 'No text - Thank you for filling' - click_link 'Back to work!' + if user['prefs']['getting_started_shown'] + click_link 'Back to work!' + else + click_link 'Get started' + end # profile saved and in home page now assert page.has_text?('Active pipelines'), 'No text - Active pipelines' @@ -111,7 +126,10 @@ class UserProfileTest < ActionDispatch::IntegrationTest ['active', api_fixture('users')['active'], true, true], ['admin', api_fixture('users')['admin'], true, true], ['active_no_prefs', api_fixture('users')['active_no_prefs'], true, false], - ['active_no_prefs_profile', api_fixture('users')['active_no_prefs_profile'], true, false], + ['active_no_prefs_profile_no_getting_started_shown', + api_fixture('users')['active_no_prefs_profile_no_getting_started_shown'], true, false], + ['active_no_prefs_profile_with_getting_started_shown', + api_fixture('users')['active_no_prefs_profile_with_getting_started_shown'], true, false], ].each do |token, user, invited, has_profile| test "visit home page when profile is configured for user #{token}" do