Setting Simulator up#
Classified settings#
Emcee can configure some simulator settings prior running your tests. Lets consider following exhaustive emceeplan configuration:
tests:
configurations:
- platform: ios
# ...
simulatorSettings:
simulatorLocalizationSettings:
localeIdentifier: ru_US
languages: ["ru-US", "en", "ru-RU"]
keyboards: ["ru_RU@sw=Russian;hw=Automatic", "en_US@sw=QWERTY;hw=Automatic"]
passcodeKeyboards: ["ru_RU@sw=Russian;hw=Automatic", "en_US@sw=QWERTY;hw=Automatic"]
addingEmojiKeybordHandled: false
enableKeyboardExpansion: false
didShowInternationalInfoAlert: false
didShowContinuousPathIntroduction: false
didShowGestureKeyboardIntroduction: false
simulatorKeychainSettings:
rootCerts: ["/path/to/root.cer"]
watchdogSettings:
bundleIds: ["your.bundle.id.here"]
timeout: 20
simulatorAccessibilitySettings:
enableQuickSpeak: false
Every setting record is optional
simulatorLocalizationSettings
#
localeIdentifier
: defines UI localekeyboards
: defines what keyboards are enabled and disabledpasscodeKeyboards
: defines what passcode keyboards are enabled and disabledlanguages
: defines UI language and fallback languages orderaddingEmojiKeybordHandled
: defines if emoji UI alert will appear or notenableKeyboardExpansion
: defines if keyboard is availabledidShowInternationalInfoAlert
: defines if international info alert will appear or notdidShowContinuousPathIntroduction
: defines if a keyboard banner describing gesture based text input will appear or notdidShowGestureKeyboardIntroduction
: defines if a yet another keyboard banner describing gesture based text input will appear or not
simulatorKeychainSettings
#
This object describes the settings to be applied to the keychain.
rootCerts
: these are the locations of the certificates which will be added to the trusted root store of the simulator keychain
watchdogSettings
#
This object controls iOS watchdog settings. Watchdog service monitors your app behavior and terminates it if it does not start in time.
bundleIds
: array of bundle IDs which timeout should be overridentimeout
: timeout value in seconds
simulatorAccessibilitySettings
#
enableQuickSpeak
: enables QuickSpeak universal access on simulator that may be useful for UI tests to expose someaccessibilityElements
Unclassified settings#
Emcee can run arbitrary shell script prior running your tests. In order to run script, specify beforeTestScript
like you usually do in CI systems:
tests:
configurations:
- platform: ios
# ...
simulatorSettings:
beforeTestScript:
- echo "Created simulator: $EMCEE_SIMULATOR_UDID"
If you need files on worker host to setup simulator, you may explicitly list them in configuration:
tests:
configurations:
- platform: ios
# ...
simulatorSettings:
files:
- TEST_LOGO_FILE: EmceeSample/Assets.xcassets/emcee_logo.imageset/emcee_logo.png
Emcee injects following env variables when runs scripts:
EMCEE_SIMULATOR_UDID
: udid of simulator created for a tests bucket. To be in consistent environment, keep in mind that Emcee is responsible for managing simulators and may create, clone and delete simulators.- keys from
files
option in emceeplan with values of file paths on a worker host that runs tests bucket.
Broadly used shell variables will be injected automatically: USER
, HOME
, PATH
, SHELL
, TMPDIR
(subject to how you deploy emcee workers)
Setting Simulator runbook#
Below is a list of scripts for unclassified settings approach you want to use to solve different needs.
Disable hardware keyboard#
tests:
configurations:
- platform: ios
# ...
simulatorSettings:
beforeTestScript:
- plutil -replace DevicePreferences.$EMCEE_SIMULATOR_UDID.ConnectHardwareKeyboard -bool false $HOME/Library/Preferences/com.apple.iphonesimulator.plist