assert page.has_link? "#{user['email']}"
find('a', text: "#{user['email']}").click
within('.dropdown-menu') do
- if !invited
- page.has_no_link? ('Not active')
- else
- page.has_no_link? ('Sign agreements')
- page.has_link? ('Manage account')
+ if user['is_active']
+ assert page.has_no_link? ('Not active')
+ assert page.has_no_link? ('Sign agreements')
+
+ assert page.has_link? ('Manage account')
if profile_config
- page.has_link? ('Manage profile')
+ assert page.has_link? ('Manage profile')
else
- page.has_no_link? ('Manage profile')
+ assert page.has_no_link? ('Manage profile')
end
end
- page.has_link? ('Log out')
+ assert page.has_link? ('Log out')
end
end
end
assert page.has_link? 'Tutorials and User guide'
assert page.has_link? 'API Reference'
assert page.has_link? 'SDK Reference'
+ assert page.has_link? 'Show version / debugging info'
+ assert page.has_link? 'Report a problem'
+
+ # check show version info link
+ click_link 'Show version / debugging info'
+ end
+ end
+
+ within '.modal-content' do
+ assert page.has_text? 'Version / debugging info'
+ assert page.has_no_text? 'Report a problem'
+ assert page.has_text? 'Server version'
+ assert page.has_text? 'Server restarted at'
+ assert page.has_text? 'Workbench version'
+ assert page.has_text? 'Arvados base'
+ assert page.has_text? 'Additional info'
+ assert page.has_no_text? 'Found a problem?'
+ assert page.has_button? 'Close'
+ assert page.has_no_button? 'Report issue'
+ click_button 'Close'
+ end
+
+ # check report issue link
+ within('.navbar-fixed-top') do
+ page.find("#arv-help").click
+ within('.dropdown-menu') do
+ click_link 'Report a problem'
end
end
+
+ within '.modal-content' do
+ assert page.has_text? 'Report a problem'
+ assert page.has_no_text? 'Version / debugging info'
+ assert page.has_text? 'Server version'
+ assert page.has_text? 'Server restarted at'
+ assert page.has_text? 'Workbench version'
+ assert page.has_text? 'Arvados base'
+ assert page.has_text? 'Additional info'
+ assert page.has_text? 'Found a problem?'
+ assert page.has_no_button? 'Close'
+ assert page.has_button? 'Report issue'
+ assert page.has_button? 'Cancel'
+
+ # enter a report text and click on report
+ page.find_field('report_issue_text').set 'my test report text'
+ click_button 'Report issue'
+ end
+
+ assert page.has_no_text? 'Version / debugging info'
end
def verify_system_menu user
page.find_field('name').set 'added_in_test'
click_button 'Submit'
end
- end
- # key must be added. look for it in the refreshed page
- assert page.has_text? 'added_in_test'
+ # key must be added. look for it in the refreshed page
+ assert page.has_text? 'added_in_test'
+ end
end
# Check manage profile page and add missing profile to the user
end
end
- assert page.has_text? profile_message
+ assert page.has_text? profile_message[0,25]
assert page.has_text? required_field_title
page.find_field('user[prefs][:profile][:'+required_field_key+']').set 'value to fill required field'
# we should see 'not found' error page
assert page.has_text? 'Not Found'
+ assert page.has_link? 'Report problem'
+ click_link 'Report problem'
+ within '.modal-content' do
+ assert page.has_text? 'Report a problem'
+ assert page.has_no_text? 'Version / debugging info'
+ assert page.has_text? 'Server version'
+ assert page.has_text? 'Server restarted at'
+ assert page.has_text? 'Found a problem?'
+ assert page.has_button? 'Report issue'
+ assert page.has_button? 'Cancel'
+
+ # enter a report text and click on report
+ page.find_field('report_issue_text').set 'my test report text'
+ click_button 'Report issue'
+ end
# let's search for the anonymously accessible project
publicly_accessible_project = api_fixture('groups')['anonymously_accessible_project']
['active_no_prefs', api_fixture('users')['active_no_prefs'], true, false],
['active_no_prefs_profile', api_fixture('users')['active_no_prefs_profile'], true, false],
].each do |token, user, invited, has_profile|
- test "visit home page when profile is configured for user #{token}" do
+
+ test "visit home page when profile is configured for user #{token}" do
# Our test config enabled profile by default. So, no need to update config
if !token
visit ('/')
verify_homepage_with_profile user, invited, has_profile
end
- end
- [
- [nil, nil, false, false],
- ['inactive', api_fixture('users')['inactive'], true, false],
- ['inactive_uninvited', api_fixture('users')['inactive_uninvited'], false, false],
- ['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],
- ].each do |token, user, invited, has_profile|
test "visit home page when profile not configured for user #{token}" do
Rails.configuration.user_profile_form_fields = false
verify_homepage_with_profile user, invited, has_profile
end
- end
- [
- [nil, nil, false, false],
- ['inactive', api_fixture('users')['inactive'], true, false],
- ['inactive_uninvited', api_fixture('users')['inactive_uninvited'], false, false],
- ['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],
- ].each do |token, user, invited, has_profile|
test "check help for user #{token}" do
- Rails.configuration.user_profile_form_fields = false
-
if !token
visit ('/')
else
check_help_menu
end
+
end
[
['active', api_fixture('users')['active'], true, true],
['admin', api_fixture('users')['admin'], true, true],
].each do |token, user|
+
test "test system menu for user #{token}" do
visit page_with_token(token)
verify_system_menu user
end
- end
- [
- ['active', api_fixture('users')['active'], true, true],
- ['admin', api_fixture('users')['admin'], true, true],
- ].each do |token, user|
test "test manage account for user #{token}" do
visit page_with_token(token)
verify_manage_account user
end
- end
- [
- ['active', api_fixture('users')['active'], true, true],
- ['admin', api_fixture('users')['admin'], true, true],
- ].each do |token, user|
test "test search for user #{token}" do
visit page_with_token(token)
verify_search_box user
end
+
end
end