Guest User

Untitled

a guest
Dec 10th, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. #my_target_page.rb
  2.  
  3. def add_and_save_notes notes
  4. fill_in("my_target_text_box", :with => notes)
  5. click_button "Save" # This makes an AJAX request and adds new row to the table upon successfully saving
  6. wait_until { has_link?("Edit note") } #<-- This is BAD, esp. when the note to be added is yet another row in a table having "Edit note" link for every corresponding row in that table
  7. #wait_until { has_text?(notes) } #<-- This is GOOD practice that enables test stability and hence faith in test results
  8. end
Add Comment
Please, Sign In to add comment