History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: WTR-146
Type: Improvement Improvement
Status: Open Open
Priority: Major Major
Assignee: Unassigned
Reporter: Ethan Jewett
Votes: 0
Watchers: 2
Operations

If you were logged in you would be able to see more operations.
Watir

Framework for allowing fine-grained, method-level control of Wait and other behaviors

Created: 08/Mar/07 06:06 PM   Updated: 04/Jun/07 02:16 PM
Component/s: Modal Web Dialog, "Wait"
Affects Version/s: 2.0, 1.5.4, Future, 1.6
Fix Version/s: Future

Original Estimate: 336h Remaining Estimate: 336h Time Spent: Unknown
File Attachments: 1. Text File watir 1.5.1163 - no_wait and triggers_modal optional arguments as relevant on goto, file_field.set, and click methods, plus modifying click_no_wait to use arguments.patch (3 kb)
2. Text File watir 1.5.1163 - no_wait option in file_field.set and click, triggers_modal option in click, modified click_no_wait to use triggers_modal option.patch (2 kb)

Environment: Cross-platform
Issue Links:
Dependency
This issue Depends on:
WTR-144 Needs fire_event_no_wait() method Major Open
 
Relationship
 
This issue Relates to:
WTR-144 Needs fire_event_no_wait() method Major Open


 Description  « Hide
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.

 All   Comments   Work Log   Change History      Sort Order:
Ethan Jewett - 08/Mar/07 06:06 PM
Patch to the 1.5.1163 version

Ethan Jewett - 09/Mar/07 08:13 AM
Meant to write that all *core* tests pass.

Ethan Jewett - 09/Mar/07 01:34 PM
Patch with same functionality as previous patch, plus allows control of "wait" behavior in "goto" method of the IE object.

Also factors out the argument handling code to a method in the Container module that takes the arguments array and returns a hash object.

Bret Pettichord - 04/Jun/07 01:55 PM
I just noticed this suggestion. Thanks for making it. I think this must have been reported at a time when i was transitioning between jobs and somewhat distracted. I apologize for missing this and will review the patch. Thanks.

Bret Pettichord - 04/Jun/07 01:59 PM
> 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)

At one point, it did lead to errors. They occurred in the spawned process so they could not cause unit tests to fail and they only resulted in benign, but scary error messages showing up in the console (if you had a console open).