lib/briar/bars/navbar.rb in briar-0.0.6 vs lib/briar/bars/navbar.rb in briar-0.0.7

- old
+ new

@@ -4,10 +4,22 @@ module Bars def navbar_visible? !query('navigationBar').empty? end + def should_see_navbar + unless navbar_visible? + screenshot_and_raise 'should see the nav bar' + end + end + + def should_not_see_navbar + if navbar_visible? + screenshot_and_raise 'should not see the nav bar' + end + end + def navbar_has_back_button? !query('navigationItemButtonView').empty? end def should_see_navbar_back_button @@ -64,12 +76,15 @@ {:timeout=>TOUCH_TRANSITION_TIMEOUT, :retry_frequency=>TOUCH_TRANSITION_RETRY_FREQ}) end def touch_navbar_item(name) + wait_for(:timeout => 1.0, + :retry_frequency => 0.4) do + index_of_navbar_button(name) != nil + end wait_for_animation idx = index_of_navbar_button name - #puts "index of nav bar button: #{idx}" if idx touch("navigationButton index:#{idx}") step_pause else screenshot_and_raise "could not find navbar item '#{name}'"