X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/203a0d4f3efb008ae3af6ec8fbb7b99d8a5dc757..f8991d36180bf9c2c261dee519b0c878306a35d5:/apps/workbench/test/integration/users_test.rb diff --git a/apps/workbench/test/integration/users_test.rb b/apps/workbench/test/integration/users_test.rb index 3651d33a46..58432f7d5e 100644 --- a/apps/workbench/test/integration/users_test.rb +++ b/apps/workbench/test/integration/users_test.rb @@ -58,10 +58,8 @@ class UsersTest < ActionDispatch::IntegrationTest click_link 'Add a new user' - sleep(0.1) - popup = page.driver.browser.window_handles.last - page.within_window popup do - assert has_text? 'Virtual Machine' + within '.modal-content' do + find 'label', text: 'Virtual Machine' fill_in "email", :with => "foo@example.com" fill_in "repo_name", :with => "test_repo" click_button "Submit" @@ -72,7 +70,7 @@ class UsersTest < ActionDispatch::IntegrationTest # verify that the new user showed up in the users page and find # the new user's UUID - new_user_uuid = + new_user_uuid = find('tr[data-object-uuid]', text: 'foo@example.com')['data-object-uuid'] assert new_user_uuid, "Expected new user uuid not found" @@ -108,6 +106,7 @@ class UsersTest < ActionDispatch::IntegrationTest find('tr', text: 'zzzzz-tpzed-xurymjxw79nv3jz'). find('a', text: 'Show'). click + user_url = page.current_url # Setup user click_link 'Admin' @@ -115,16 +114,13 @@ class UsersTest < ActionDispatch::IntegrationTest click_link 'Setup Active User' - sleep(0.1) - - popup = page.driver.browser.window_handles.last - page.within_window popup do - assert has_text? 'Virtual Machine' + within '.modal-content' do + find 'label', text: 'Virtual Machine' fill_in "repo_name", :with => "test_repo" click_button "Submit" - wait_for_ajax end + visit user_url assert page.has_text? 'modified_by_client_uuid' click_link 'Advanced' @@ -136,16 +132,14 @@ class UsersTest < ActionDispatch::IntegrationTest click_link 'Admin' click_link 'Setup Active User' - sleep(0.1) - popup = page.driver.browser.window_handles.last - page.within_window popup do + within '.modal-content' do fill_in "repo_name", :with => "second_test_repo" select("testvm.shell", :from => 'vm_uuid') click_button "Submit" - wait_for_ajax end - assert page.has_text? 'modified_by_client_uuid' + visit user_url + find '#Attributes', text: 'modified_by_client_uuid' click_link 'Advanced' click_link 'Metadata' @@ -170,6 +164,7 @@ class UsersTest < ActionDispatch::IntegrationTest find('tr', text: 'zzzzz-tpzed-xurymjxw79nv3jz'). find('a', text: 'Show'). click + user_url = page.current_url # Verify that is_active is set find('a,button', text: 'Attributes').click @@ -189,6 +184,7 @@ class UsersTest < ActionDispatch::IntegrationTest # Should now be back in the Attributes tab for the user page.driver.browser.switch_to.alert.accept + assert page.has_text? 'modified_by_user_uuid' page.within(:xpath, '//span[@data-name="is_active"]') do assert_equal "false", text, "Expected user's is_active to be false after unsetup" @@ -204,15 +200,13 @@ class UsersTest < ActionDispatch::IntegrationTest click_link 'Admin' click_link 'Setup Active User' - sleep(0.1) - popup = page.driver.browser.window_handles.last - page.within_window popup do + within '.modal-content' do fill_in "repo_name", :with => "second_test_repo" select("testvm.shell", :from => 'vm_uuid') click_button "Submit" - wait_for_ajax end + visit user_url assert page.has_text? 'modified_by_client_uuid' click_link 'Advanced'