Calabash 0.9.163

0.9.163 changelog

Primary reason for this release is to speed up test execution on iOS7 by avoiding dependency on performTaskWithPathArgumentsTimeout which is well-known to execute only once per second. Although some clever folks at Facebook have been able to patch UIAutomation on the simulator to avoid this delay, we would refrain from using that technique since it is limited to simulator execution. A core principle of calabash is that on-device execution should be supported.

From 0.9.163 UIA commands are sent via the http server which communicates them to the external UIA script via preferences as was previously done with the __calabash preference. This doesn't suffer from the 1 second delay.

There are no significant API level changes and this release should be fully backwards compatible except that tests running under instruments using UIAutomation should run significantly (30-50%) faster depending on the test suite.

Deprecated

These functions, methods, or cucumber steps have been deprecated and will now generate warning messages.

To suppress deprecated warnings set ENV['CALABASH_NO_DEPRECATION']=1 (not recommend).

  • since 0.9.131 query_all - use query("view all") - see Query Syntax
  • since 0.9.145 set_text - use keyboard_enter_text or (sparingly) clear_text
  • since 0.9.151 When I clear "some text field" - no replacement
  • since 0.9.163 await_keyboard - use wait_for_keyboard
  • since 0.9.163 keyboard_enter_char second arg should_screenshot has been replaced by an options hash. Use the :should_screenshot key instead
  • since 0.9.163 send_uia_command - use uia("...javascript..", options) instead. This has not been formally deprecated (no warnings will be generated) yet, but it will be in a future version.

iOS 7 WebViews

Fix webView issue for some iOS7 webView apps discussed on the forum.

Privacy Settings

Support for setting the state of Privacy settings (access to photos, contacts, calendar) on the Simulator only - fixes #264 https://github.com/calabash/calabash-ios/issues/264 - see https://github.com/calabash/calabash-ios/blob/0.9.x/calabash-cucumber/lib/calabash-cucumber/launcher.rb#L9

Add the following to your hooks (features/support/01_launch.rb)

@calabash_launcher.relaunch(privacy_settings: {photos: {allow: true}})

Improved keyboard interactions on the iPad and email compose views

Thanks to:

  • @nkammah, @avanderberg, @jmoody, Riley Marsh, and Raj Udapudi for reporting
  • Niels Frydenholm for reporting and testing
  • (pull 258) fixes keyboard_enter_text cannot enter all characters on iPad simulator and iPad device
    • thanks @ivanandriollo
    • https://github.com/calabash/calabash-ios/pull/258

Can now use the iPad keyboard mode key to dock, undock, and split the keyboard (issue 265). Thanks to @nkammah.

  • ensure_docked_keyboard
  • ensure_undocked_keyboard
  • ensure_split_keyboard

Resolves skipped keys and capitalization problems. If you experience problems on iOS < 7 you can control the rate of key board entry using:

  • POST_ENTER_KEYBOARD time to wait after touching a key - defaults to 0.05
  • KEYPLANE_SEARCH_STEP_PAUSE time to wait after changing key planes - defaults to 0.2

Can now detect MFMailComposeViewController (email compose) keyboards with:

  • uia_keyboard_visible?
  • uia_wait_for_keyboard

Can now dismiss the iPad keyboard:

  • dismiss_ipad_keyboard

Analyzed problems with uia_type_string

uia_type_string raises an exception instead when it detects a error status - issue 260.

During testing we discovered a bug in Apple's UIAutomation bug that causes characters to be skipped or input with the incorrect case: https://github.com/calabash/calabash-ios/issues/269.

Please file bug reports at http://bugreport.apple.com - every report counts.

Detecting the test environment

  • uia_available? and uia_not_available? - was the app launched with Instruments?
  • xamarin_test_cloud?
  • default_device returns the device (Calabash::Cucumber::Device) attribute of the current launcher
  • ipad?, iphone?, simulator?
  • iphone_5?, iphone_4in
  • ios5?, ios6?, ios7? - if the OS env is set, returns that value. if not, queries the test device for iOS version
  • iphone_app_emulated_on_ipad? detecting iPhone apps emulated on the iPad. Partial fix for #185.
  • landscape? and portrait? for detecting the orientation of the app

Other Fixes

  • (pull 29) server_version now indicates the remote origin of the calabash server git repo

    • https://github.com/calabash/calabash-ios-server/pull/29
  • (pull 27) server_version now indicates if the app is an iPhone only app emulated on an iPad

    • https://github.com/calabash/calabash-ios-server/pull/27
  • (pull 263) fixed the linked_with_calabash method to properly find the right binary linked with calabash

    • thanks @rpranata
    • https://github.com/calabash/calabash-ios/pull/263
  • (issue 240) Simulator can't be found

    • thanks @mposchen
    • https://github.com/calabash/calabash-ios/issues/240

Xamarin Workbook

If it's not already installed, install the Xamarin Workbooks app first. The workbook file should download automatically, but if it doesn't, just click to start the workbook download manually.