appium-uiauto
Advanced tools
Comparing version 1.6.2 to 1.6.3
{ | ||
"name": "appium-uiauto", | ||
"version": "1.6.2", | ||
"version": "1.6.3", | ||
"description": "appium uiauto ios driver", | ||
@@ -5,0 +5,0 @@ "main": "lib/main.js", |
@@ -17,3 +17,19 @@ /* globals $ */ | ||
} else { | ||
$.sendKeysToActiveElement(newValue); | ||
/* | ||
* Sending large chunks of text, especially with capital letters, | ||
* often muddles the input causing errors where keys are not | ||
* found. Breaking into individual letters, while slower, fixes | ||
* the problem. | ||
*/ | ||
for (i = 0; i < newValue.length; i++) { | ||
var c = newValue.charAt(i); | ||
try { | ||
$.sendKeysToActiveElement(c); | ||
} catch (e) { | ||
// retry once | ||
$.debug("Error typing '" + c + "': " + e); | ||
$.debug("Retrying..."); | ||
$.sendKeysToActiveElement(c); | ||
} | ||
} | ||
} | ||
@@ -20,0 +36,0 @@ } else if (type === "UIAPickerWheel") { |
@@ -5,2 +5,45 @@ /* globals $ */ | ||
// return all elements of type contained in typeArray | ||
UIAElement.prototype._elementOrElementsByType = function (typeArray, onlyFirst, onlyVisible) { | ||
if (!typeArray) throw new Error("Must provide typeArray when calling _elementOrElementsByType"); | ||
var numTypes = typeArray.length; | ||
onlyFirst = onlyFirst === true; | ||
onlyVisible = onlyVisible !== false; | ||
var target = $.target(); | ||
target.pushTimeout(0); | ||
var getTree = function (element) { | ||
var elems = []; | ||
// process element | ||
var visible = element.isVisible() === 1; | ||
var elType = element.type(); | ||
for (var i = 0; i < numTypes; i++) { | ||
if (elType === typeArray[i]) { | ||
if (!onlyVisible || visible) { | ||
elems.push(element); | ||
if (onlyFirst && elems.length === 1) return elems; | ||
break; | ||
} | ||
} | ||
} | ||
if (element.hasChildren()) { | ||
var children = element.elements(); | ||
var numChildren = children.length; | ||
for (var i = 0; i < numChildren; i++) { | ||
if (onlyFirst && elems.length === 1) return elems; | ||
elems = elems.concat(getTree(children[i])); | ||
} | ||
} | ||
return elems; | ||
}; | ||
var foundElements = getTree(this); | ||
target.popTimeout(); | ||
return $.smartWrap(foundElements).dedup(); | ||
}; | ||
UIAElement.prototype.getFirstWithPredicateWeighted = function (predicate) { | ||
@@ -91,2 +134,2 @@ var weighting = [ | ||
})(); | ||
})(); |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
13360774
3437