each Platform Automation Tools Calabash droid Calabash iOS Watir Different UI actions touch click Locators Navigation Patterns Nav Drawer Menu Bar Tab Bar
Identify each page uniquely on the device { :web => "//div[@id='payment_info']", :ios => "all webView css:'#payment_info'", :droid => "all webView css:'#payment_info'" }
Check if locator specified by id exists on the UI Calabash Android and IOS: query(locator).empty? Mobile Web (Watir): Browser.element(:css => locator).present?
each Platform Automation Tools Calabash droid Calabash iOS Watir Different UI actions touch click Locators Navigation Patterns Nav Drawer Menu Bar Tab Bar
Element.new({ :web => ‘#save_and_continue_button’, :ios => "navigationButton marked:'DONE'", :droid => "* marked:'Done'" } Element Id: Map click () 20 def click case platform when ANDROID touch(query(locator)) when IOS touch(query(locator)) when WEB Browser.element(:css => locator).click() end end
each Platform Automation Tools Calabash droid Calabash iOS Watir Different UI actions touch click Locators Navigation Patterns Nav Drawer Menu Bar Tab Bar
for UI interaction. ๏ Driver should not know about higher level abstraction Page. 2. element.click ๏ It will not be applicable to all elements. 3. Transition Aware Element ➡ An element that understands page transitions. 26
a bug in code, app transitions to wrong page from list of multiple transitions. ➡ Tests should take care for assertions of correct page, not the framework.
false, false begin wait_for_element(timeout: 30) do found_next_page = next_pages.any? { |page| page.current_page?} has_error = error_page.has_error? if error_page found_next_page or has_error end has_error ? error_page : next_pages.find { |page| page.current_page?} rescue WaitTimeoutError raise WaitTimeoutError, "None of the next page transitions were found. Checked for: => #{next_page_transitions.join(' ,')}" end end
each Platform Automation Tools Calabash droid Calabash iOS Watir Different UI actions touch click Locators Navigation Patterns Nav Drawer Menu Bar Tab Bar
execution. ‣ Page registry, can be queried for page object instances. ‣ PageRegistry.get "Login Page” ‣ Rspec Unit Tests ‣ Rake task to create new page classes. 36