You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by al...@apache.org on 2016/08/17 14:35:54 UTC
[2/2] cordova-plugin-camera git commit: CB-11631 Appium tests: A
working fix for a flaky "selection canceled" failure
CB-11631 Appium tests: A working fix for a flaky "selection canceled" failure
Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/commit/9f159d75
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/tree/9f159d75
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/diff/9f159d75
Branch: refs/heads/master
Commit: 9f159d757a505af663c5764dd4d44558d15d261d
Parents: 62d1b01
Author: Alexander Sorokin <al...@akvelon.com>
Authored: Wed Aug 17 17:35:23 2016 +0300
Committer: Alexander Sorokin <al...@akvelon.com>
Committed: Wed Aug 17 17:35:23 2016 +0300
----------------------------------------------------------------------
appium-tests/android/android.spec.js | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/blob/9f159d75/appium-tests/android/android.spec.js
----------------------------------------------------------------------
diff --git a/appium-tests/android/android.spec.js b/appium-tests/android/android.spec.js
index c8b2963..0e00bab 100644
--- a/appium-tests/android/android.spec.js
+++ b/appium-tests/android/android.spec.js
@@ -400,7 +400,18 @@ describe('Camera tests Android.', function () {
return driver
.deviceKeyEvent(BACK_BUTTON)
// give native app some time to close
- .sleep(2000);
+ .sleep(2000)
+ // try again! because every ~30th build
+ // on Sauce Labs this backbutton doesn't work
+ .elementById('action_bar_title')
+ .then(function () {
+ // success means we're still in native app
+ return driver
+ .deviceKeyEvent(BACK_BUTTON);
+ }, function () {
+ // error means we're already in webview
+ return driver;
+ });
}, function () {
// error means we're already in webview
return driver;
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org