lib/briar/bars/navbar.rb in briar-0.1.0 vs lib/briar/bars/navbar.rb in briar-0.1.1
- old
+ new
@@ -24,12 +24,12 @@
def should_see_navbar_back_button
timeout = BRIAR_WAIT_TIMEOUT * 2.0
msg = "waited for '#{timeout}' seconds but did not see navbar back button"
wait_for(:timeout => timeout,
- :retry_frequency => 0.2,
- :post_timeout => 0.1,
+ :retry_frequency => BRIAR_RETRY_FREQ,
+ :post_timeout => BRIAR_POST_TIMEOUT,
:timeout_message => msg) do
navbar_has_back_button?
end
end
@@ -50,12 +50,12 @@
if is_ui_button
qstr = "button marked:'#{name}' parent navigationBar"
timeout = BRIAR_WAIT_TIMEOUT
msg = "waited for '#{timeout}' seconds but did not see '#{name}' in navigation bar"
wait_for(:timeout => timeout,
- :retry_frequency => 0.2,
- :post_timeout => 0.1,
+ :retry_frequency => BRIAR_RETRY_FREQ,
+ :post_timeout => BRIAR_POST_TIMEOUT,
:timeout_message => msg) do
element_exists qstr
end
else
idx = index_of_navbar_button name
@@ -71,12 +71,12 @@
if is_ui_button
qstr = "button marked:'#{name}' parent navigationBar"
timeout = 1.0
msg = "waited for '#{timeout}' seconds but i still see '#{name}' in navigation bar"
wait_for(:timeout => timeout,
- :retry_frequency => 0.2,
- :post_timeout => 0.1,
+ :retry_frequency => BRIAR_RETRY_FREQ,
+ :post_timeout => BRIAR_POST_TIMEOUT,
:timeout_message => msg) do
element_does_not_exist qstr
end
else
idx = index_of_navbar_button name
@@ -95,21 +95,22 @@
def go_back_after_waiting
sleep(0.2)
wait_for(:timeout => 1.0,
- :retry_frequency => 0.2) do
+ :retry_frequency => BRIAR_RETRY_FREQ,
+ :post_timeout => BRIAR_POST_TIMEOUT) do
not query('navigationItemButtonView first').empty?
end
touch('navigationItemButtonView first')
step_pause
end
def go_back_and_wait_for_view (view)
sleep(0.2)
- wait_for(:timeout => 1.0,
- :retry_frequency => 0.2) do
+ wait_for(:timeout => BRIAR_WAIT_TIMEOUT,
+ :retry_frequency => BRIAR_RETRY_FREQ) do
not query('navigationItemButtonView first').empty?
end
touch_transition('navigationItemButtonView first',
"view marked:'#{view}'",
@@ -117,12 +118,12 @@
:retry_frequency => TOUCH_TRANSITION_RETRY_FREQ})
step_pause
end
def touch_navbar_item(item_name, wait_for_view_id=nil)
- wait_for(:timeout => 1.0,
- :retry_frequency => 0.4) do
+ wait_for(:timeout => BRIAR_WAIT_TIMEOUT,
+ :retry_frequency => BRIAR_RETRY_FREQ) do
(index_of_navbar_button(item_name) != nil) || button_exists?(item_name)
end
sleep(0.2)
idx = index_of_navbar_button item_name
@@ -152,19 +153,14 @@
end
def should_see_navbar_with_title(title, timeout=BRIAR_WAIT_TIMEOUT)
msg = "waited for '#{timeout}' seconds but i did not see #{title} in navbar"
wait_for(:timeout => timeout,
- :retry_frequency => 0.2,
- :post_timeout => 0.1,
+ :retry_frequency => BRIAR_RETRY_FREQ,
+ :post_timeout => BRIAR_POST_TIMEOUT,
:timeout_message => msg) do
navbar_has_title? title
end
- end
-
-
- def navbar_should_have_title(title)
- pending "deprecated 0.0.6 - use should_see_navbar_with_title '#{title}'"
end
end
end