Guest User

Untitled

a guest
Jun 17th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. # keep Watir::Wait as is
  2.  
  3.  
  4. # new module
  5.  
  6. module Watir
  7. module WaitHelper # or another name?
  8.  
  9. def wait_until(*args, &blk)
  10. Wait.until(*args, &blk)
  11. end
  12.  
  13. def wait_while(*args, &blk)
  14. Wait.while(*args, &blk)
  15. end
  16.  
  17. end
  18. end
  19.  
  20.  
  21. #
  22. # in rspec
  23. #
  24.  
  25. Spec::Runner.configure do |config|
  26. config.include(Watir::WaitHelper)
  27. end
  28.  
  29. it "should wait" do
  30. wait_until { ... }
  31. end
  32.  
  33. #
  34. # in cucumber
  35. #
  36.  
  37. World(Watir::WaitHelper)
  38.  
  39. Given /foo bar/ do
  40. wait_until { ... }
  41. end
Add Comment
Please, Sign In to add comment