lib/briar/bars/toolbar.rb in briar-0.0.7 vs lib/briar/bars/toolbar.rb in briar-0.0.8
- old
+ new
@@ -18,19 +18,32 @@
query("toolbar descendant view marked:#{name_or_id}")
## look for text button
#text_button_arr = query("toolbar child toolbarTextButton child button child buttonLabel", :text)
#has_text_button = text_button_arr.index(name_or_id) != nil
## look for non_text button
- #toolbar_button_arr = query("toolbar child toolbarButton", :accessibilityLabel)
+ #toolbar_button_arr = query("toolbar child toolbarButton", AL)
#has_toolbar_button = toolbar_button_arr.index(name_or_id) != nil
#
#has_text_button or has_toolbar_button
end
def should_see_toolbar_button (name_or_id)
res = toolbar_button_exists? name_or_id
unless res
screenshot_and_raise "could not see toolbar button with name '#{name_or_id}'"
end
+ end
+
+ def touch_toolbar_button(button_name, and_wait_for_view_id=nil)
+ should_see_toolbar_button button_name
+ if and_wait_for_view_id.nil?
+ touch("toolbar descendant view marked:'#{button_name}'")
+ else
+ touch_transition("toolbar descendant view marked:'#{button_name}'",
+ "view marked:'#{and_wait_for_view_id}'",
+ {:timeout=>TOUCH_TRANSITION_TIMEOUT,
+ :retry_frequency=>TOUCH_TRANSITION_RETRY_FREQ})
+ end
+ step_pause
end
end
end