Correct use of until_element_exists wait helper?

23 views
Skip to first unread message

muranea

unread,
Jul 27, 2015, 7:04:30 PM7/27/15
to calabash-android
Hello group,

I've been unsuccessful getting this wait helper using lambdas to work consistently. 

I want to make sure I understand. I click a slider on my dashboard page object which contains a link to a new settings page object. the settings page contains a log out link. I want to click the link to the settings page until I see the logout link.

Is that the correct interpretation of this method and are these implementations correct? 

  def open_app_selector  
      #slider toggle
apps_drawer = "* marked:'MyAccessibilityLabel'"
 
#verify the element loads, just to be safe
      wait_for_element_exists(apps_drawer)

 #Click element to load a page with a sign out link. Keep clicking until the Settings page with sign out 
#link appears
until_element_exists("* marked:'Sign Out'",:action=>lambda{touch(apps_drawer)})
      
  end


Another example:
#toggle child view off if it's opened by default
  def dismiss_child_view


    child_view_header = "* marked:'LABEL'"

    #toggle for showing/hiding child view
    child_view_toggle =  "* marked:'ANOTHER_LABEL'"

    #tap the toggle switch until the child view header is no longer visible
    if element_exists(child_view_header)
      until_element_does_not_exist(child_view_header,:action=>lambda{touch(child_view_toggle)})
    end
    check_element_does_not_exist(child_view_header)

  end





Reply all
Reply to author
Forward
0 new messages