X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/181b57c695c23d140a8a5b2f772515cc63248ceb..964350f4132788e07a7ce1b159179a152e9cfcdc:/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..b5bf2415c2 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" @@ -115,14 +113,10 @@ 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 assert page.has_text? 'modified_by_client_uuid' @@ -136,16 +130,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 - assert page.has_text? 'modified_by_client_uuid' + find '#Attributes', text: 'modified_by_client_uuid' click_link 'Advanced' click_link 'Metadata' @@ -189,6 +180,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,13 +196,10 @@ 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'