- page.within(:xpath, '//tr[@data-object-uuid][1]') do
- assert (text.include? 'foo@example.com false'), 'Expected email'
- new_user_uuid = text.split[0]
-
- # go to the new user's page
- click_link new_user_uuid
+ new_user_uuid = nil
+ all("tr").each do |elem|
+ if elem.text.include? 'foo@example.com'
+ new_user_uuid = elem.text.split[0]
+ break
+ end