jarib / celerity

This project is no longer maintained.
http://celerity.rubyforge.org/
GNU General Public License v2.0
206 stars 38 forks source link

Optional argument on Browser#wait #50

Closed jondruse closed 13 years ago

jondruse commented 13 years ago

In sites that use javascript very heavily, the Browser#wait method will cause celerity to wait for upto 10 seconds before becoming available. This is only useful if what you need to interact with is controlled by javascript. If not, then you're waiting for nothing. 10 seconds is a long time and should be configurable to be shorter. In any case, when you absolutely need to wait for javascript, you could pass a custom timeout to Browser#wait.

The relavent changes are in a43e5c2b but I couldn't figure out how to create a pull request for just that one. Thanks!

jondruse commented 13 years ago

Sorry I got that commit wrong. Here it is.

https://github.com/centraldesktop/celerity/commit/a43e5c2bee3a7fc8beead486403f202aaf96c64b

jarib commented 13 years ago

Could you add a test in spec/browser_spec.rb as well? Just browser.webclient.should_receive(:waitForBackgroundJavaScript) with the right args (for both the default and the explicit timeout).

jondruse commented 13 years ago

I will make those changes. Thanks!

jondruse commented 13 years ago

Jari, Please look over these and let me know if there's any issues. Thanks!