From 5574490bc3c9ebe907a94ee06b94ea9b46d5fdae Mon Sep 17 00:00:00 2001 From: Alexander Sorokin Date: Mon, 10 Jul 2017 12:07:38 +0300 Subject: [PATCH] CB-13002: (Android, iOS) Fix occasional Appium tests failures --- appium-tests/android/android.spec.js | 10 ++++++++++ appium-tests/ios/ios.spec.js | 10 ++++++++++ 2 files changed, 20 insertions(+) diff --git a/appium-tests/android/android.spec.js b/appium-tests/android/android.spec.js index ad448a3..d21959f 100644 --- a/appium-tests/android/android.spec.js +++ b/appium-tests/android/android.spec.js @@ -115,6 +115,16 @@ describe('Camera tests Android.', function () { if (!options) { options = {}; } + // assign default values + if (!options.hasOwnProperty('allowEdit')) { + options.allowEdit = true; + } + if (!options.hasOwnProperty('destinationType')) { + options.destinationType = cameraConstants.DestinationType.FILE_URI; + } + if (!options.hasOwnProperty('sourceType')) { + options.destinationType = cameraConstants.PictureSourceType.CAMERA; + } return driver .context(webviewContext) diff --git a/appium-tests/ios/ios.spec.js b/appium-tests/ios/ios.spec.js index 9e7c3e1..1c5f65d 100644 --- a/appium-tests/ios/ios.spec.js +++ b/appium-tests/ios/ios.spec.js @@ -128,6 +128,16 @@ describe('Camera tests iOS.', function () { if (!options) { options = {}; } + // assign defaults + if (!options.hasOwnProperty('allowEdit')) { + options.allowEdit = true; + } + if (!options.hasOwnProperty('destinationType')) { + options.destinationType = cameraConstants.DestinationType.FILE_URI; + } + if (!options.hasOwnProperty('sourceType')) { + options.destinationType = cameraConstants.PictureSourceType.CAMERA; + } return driver .context(webviewContext)