From e588907ac732e58e1a319da3d4e5635ecd8e8414 Mon Sep 17 00:00:00 2001 From: Alexander Sorokin Date: Sat, 13 Aug 2016 16:58:33 +0300 Subject: [PATCH] CB-11631 Appium tests: A fix for a flaky "selection cancelled" failure --- appium-tests/android/android.spec.js | 4 +++- appium-tests/helpers/cameraHelper.js | 1 - 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/appium-tests/android/android.spec.js b/appium-tests/android/android.spec.js index 733c18a..7be0359 100644 --- a/appium-tests/android/android.spec.js +++ b/appium-tests/android/android.spec.js @@ -398,7 +398,9 @@ describe('Camera tests Android.', function () { .then(function () { // success means we're still in native app return driver - .deviceKeyEvent(BACK_BUTTON); + .deviceKeyEvent(BACK_BUTTON) + // give native app some time to close + .sleep(2000); }, function () { // error means we're already in webview return driver; diff --git a/appium-tests/helpers/cameraHelper.js b/appium-tests/helpers/cameraHelper.js index 00578a9..cb22ec5 100644 --- a/appium-tests/helpers/cameraHelper.js +++ b/appium-tests/helpers/cameraHelper.js @@ -125,7 +125,6 @@ module.exports.checkPicture = function (pid, options, cb) { // Skip image type check if destination is NATIVE_URI and source - device's photoalbum // https://github.com/apache/cordova-plugin-camera/#ios-quirks-1 - // TODO: correct link above var skipFileTypeCheckiOS = isIos && options.destinationType === Camera.DestinationType.NATIVE_URI && (options.sourceType === Camera.PictureSourceType.PHOTOLIBRARY || options.sourceType === Camera.PictureSourceType.SAVEDPHOTOALBUM);