Hi.
I am looking to convert the existing NSProtocol API browser_tests [1] to the new ax_inspect scripting language [2]. In particular, the test [3] could be rewritten this way:
text_range: textarea.AXTextMarkerRangeForUIElement(textarea)
marker_0: text_range.start
marker_1: textarea.AXNextWordEndTextMarkerForTextMarker(marker_0)
marker_2: textarea.AXNextWordEndTextMarkerForTextMarker(marker_1)
marker_3: textarea.AXNextWordEndTextMarkerForTextMarker(marker_2)
marker_4: textarea.AXPreviousWordStartTextMarkerForTextMarker(marker_3)
target_selected_marker_range: textarea.AXTextMarkerRangeForUnorderedTextMarkers([marker_3, marker_4])
textarea.AXSelectedTextMarkerRange(target_selected_marker_range)
waitfor AXSelectedTextChanged
textarea.AXSelectedText
The only thing not yet implemented is `waitfor` instruction to stop test execution until an event is fired. So, before doing this I was wondering whether this approach looks good in general and whether it'd be better (if it'd be possible) to transform the test into a bunch of smaller ax_dump_tree/ax_dump_events instead.
Thanks!
Alexander.