calabash/calabash-ios — pull request #274 by jmoody (2014-01-06 14:57:10+00:00)
Title: resolves several keyboard related problems and creates a uniform way to ask questions about the test environment

## Motivation

This pull resolves several keyboard related problems and extends calabash by providing a uniform way to get information about the test environment.

### Known Issues

`uia_type_string` fails to input the correct case or incorrectly touches the wrong character on _devices_.

https://github.com/calabash/calabash-ios/issues/269

### status_bar_helpers.rb

* `landscape?` and `portrait?` for detecting the orientation of the app

### environment_helpers.rb

* `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](https://github.com/calabash/calabash-ios/issues/185).

### keyboard_helpers

* documented functions
* renamed internal (private) functions with `_`
* functions for dealing with iPad docked, undocked, and split keyboards
* `keyboard_enter_char` now has a slight pause after every keystroke and a longer pause after switching keyplanes to avoid skipping characters
* `done` function renamed to `tap_keyboard_action_key` for clarity - `done` function has been retained for backward compat
* `uia_keyboard_visible?` and `uia_await_keyboard` for interacting with keyboards that are not normally visible to calabash e.g. email compose view controllers
* can now dismiss the iPad keyboard

### calabash_steps/calabash_steps.rb

* replaced usages of await_keyboard with wait_for_keyboard

### device.rb

* removed jmoody attribution - no need for the attribution
* added `iphone_app_emulated_on_ipad?` for detecting emulated apps

## Testing

* [briar 0.1.3](https://github.com/jmoody/briar/tree/0.1.3)
* [briar-ios-example 1.1.4](https://github.com/jmoody/briar-ios-example/tree/1.1.4-splitkeyboard)

#### Manually Launching ==> `NO_LAUNCH=1` ==> no Instruments

- [x] iPhone 4S iOS 6
- [x] iPad 1 iOS 5.1.1 (some flickering tests around split/undocked keyboards + orientations)
- [x] iPhone Simulator iOS 6.1
- [x] iPad Simulator iOS 6.1

#### Launching with Instruments ==> `NO_LAUNCH=0` ==> UIA available
- [ ] iPhone 4S iOS 6
- [x] iPhone 5C iOS 7.0.2
- [x] iPad 4 iOS 7.0.3
- [ ] iPhone Simulator iOS 6.1
- [ ] iPhone Simulator iOS 7
- [ ] iPad Simulator iOS 6.1
- [ ] iPad Simulator iOS 7