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 2017/06/01 07:27:11 UTC
cordova-paramedic git commit: Actually fix the bug instead of shady
blacklisting workarounds
Repository: cordova-paramedic
Updated Branches:
refs/heads/master ec0903381 -> cff76544b
Actually fix the bug instead of shady blacklisting workarounds
Project: http://git-wip-us.apache.org/repos/asf/cordova-paramedic/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-paramedic/commit/cff76544
Tree: http://git-wip-us.apache.org/repos/asf/cordova-paramedic/tree/cff76544
Diff: http://git-wip-us.apache.org/repos/asf/cordova-paramedic/diff/cff76544
Branch: refs/heads/master
Commit: cff76544b41ea3e7dfa2a7c691ca72798f77693f
Parents: ec09033
Author: Alexander Sorokin <al...@akvelon.com>
Authored: Thu Jun 1 09:35:18 2017 +0300
Committer: Alexander Sorokin <al...@akvelon.com>
Committed: Thu Jun 1 09:38:20 2017 +0300
----------------------------------------------------------------------
lib/appium/helpers/wdHelper.js | 18 ++----------------
1 file changed, 2 insertions(+), 16 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-paramedic/blob/cff76544/lib/appium/helpers/wdHelper.js
----------------------------------------------------------------------
diff --git a/lib/appium/helpers/wdHelper.js b/lib/appium/helpers/wdHelper.js
index 95b74e0..1115af7 100644
--- a/lib/appium/helpers/wdHelper.js
+++ b/lib/appium/helpers/wdHelper.js
@@ -34,8 +34,6 @@ var path = require('path');
var wd = global.WD || require('wd');
var util = require('../../utils').utilities;
-var windowBlacklist = [];
-
module.exports.getDriver = function (platform) {
var normalizedPlatform;
var driverConfig = {};
@@ -185,7 +183,6 @@ module.exports.tapElementByXPath = function (xpath, driver) {
module.exports.pollForEvents = function (driver, platform, skipBuster, windowOffset) {
var isAndroid = platform === 'android';
var isIOS = platform === 'ios';
- var currentHandle = '';
if (!windowOffset) {
windowOffset = 0;
}
@@ -208,19 +205,10 @@ module.exports.pollForEvents = function (driver, platform, skipBuster, windowOff
return driver
.windowHandles()
.then(function (windowHandles) {
- if (windowBlacklist.indexOf(windowHandles[windowOffset]) >= 0) {
- windowOffset += 1;
- }
if (windowOffset >= windowHandles.length) {
throw new Error('Cannot find a window with the event cache.');
}
- currentHandle = windowHandles[windowOffset];
- // Android 7 workaround:
- // add current window to the blacklist
- // because "execute" can just not work on one of the windows
- // so we're not trying the same window twice
- windowBlacklist.push(currentHandle);
- return driver.window(currentHandle);
+ return driver.window(windowHandles[windowOffset]);
});
})
.execute(function () {
@@ -234,8 +222,6 @@ module.exports.pollForEvents = function (driver, platform, skipBuster, windowOff
return result;
}, [])
.then(function (result) {
- // do not blacklist the right window!
- windowBlacklist.splice(windowBlacklist.indexOf(currentHandle), 1);
if (Object.prototype.toString.call(result) === '[object Array]') {
return result;
}
@@ -243,7 +229,7 @@ module.exports.pollForEvents = function (driver, platform, skipBuster, windowOff
throw new Error('Cannot get the event cache: it doesn\'t exist in the app.');
}
// no luck finding the event cache in this window, let's try next
- return module.exports.pollForEvents(driver, platform, windowOffset + 1);
+ return module.exports.pollForEvents(driver, platform, skipBuster, windowOffset + 1);
});
};
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org