Allow fine-grained control of sometimes problematic behaviors like "wait" built into most action methods.
Examples, with "click" (to the best of my knowledge):
element.click - results in a click event, and an @container.wait
element.click! - results in a click event (no wait)
element.click_no_wait - results in a click event in a separate process and also no wait (though the lack of a wait doesn't seem central to the functionality, and no unit tests appear to fail when an @container.wait event is triggered after the separate process is launched)
Proposed behavior:
element.click - results in a click event and an @container.wait
element.click(:wait => false) - results in a click event (no wait)
element.click(:triggers_modal => true) - results in a click event spawned in a separate process, with a wait event
element.click(:triggers_modal => true, :wait => false) - same as click_no_wait above
Backwards compatibility:
element.click - behavior is backwards compatible
element.click_no_wait - simply calls click(:triggers_modal => true, :wait => false)
element.click! - triggers click(:wait => false)
Also included in the patch:
file_field.set(path) - same as behavior before the patch
file_field.set(path, :wait => false) - equivalent to replacing "click" in "set" method with "click(:wait => false)"
The file_field.set modifications are the motivation for the patch, but I think this sort of capability would be useful if distributed through all the 'action' methods in Watir, including "goto", other "set"s, etc. Also note the extra flexibility in the element.click(:triggers_modal => true) method, which allows for a "wait" and modal handling at the same time.
Admittedly, the code in the patch could be prettier, but in my tests, all unit tests do pass.
Original estimate is a naive estimate of time to rewrite and build out to the rest of the action methods in Watir.