appium-uiauto
Advanced tools
Comparing version 1.4.3 to 1.4.4
{ | ||
"name": "appium-uiauto", | ||
"version": "1.4.3", | ||
"version": "1.4.4", | ||
"description": "appium uiauto ios driver", | ||
@@ -5,0 +5,0 @@ "main": "lib/main.js", |
@@ -54,22 +54,4 @@ /* globals $ */ | ||
it('getTree should not return duplicates', function () { | ||
return ctx.execFunc( | ||
function () { | ||
rootPage.clickMenuItem('Text Fields'); | ||
$.delay(2000); | ||
var cell = $('#Empty list').children('cell')[0]; | ||
return cell.getTree(); | ||
} | ||
).then(function (res) { | ||
if (process.env.VERBOSE) console.log('--->', res); | ||
res.type.should.equal('UIATableCell'); | ||
res.children.length.should.equal(1); | ||
res.children[0].type.should.equal('UIATextField'); | ||
res.children[0].children.length.should.equal(0); | ||
//res.should.have.length(1); | ||
}); | ||
}); | ||
}); | ||
}); |
@@ -54,9 +54,10 @@ /* globals $, errors */ | ||
UIAElement.prototype.isDuplicate = function () { | ||
var res = false; | ||
var type = this.type(); | ||
if (type.match(/textfield$/i)) { | ||
var elements = this.elements(); | ||
return (elements.length === 1) && elements[0].type() === type && | ||
elements[0].name() === this.name(); | ||
var parent = this.parent(); | ||
res = parent && parent.type() === type && | ||
parent.name() === this.name(); | ||
} | ||
return false; | ||
return res; | ||
}; | ||
@@ -63,0 +64,0 @@ |
@@ -49,6 +49,2 @@ /* globals $ */ | ||
var getTree = function (element) { | ||
if (element && element.isDuplicate()) { | ||
// if it is a duplicate, we just plug in the original | ||
return getTree(element.elements()[0]); | ||
} | ||
var subtree = { | ||
@@ -55,0 +51,0 @@ name: element.name() |
@@ -282,2 +282,5 @@ /* globals $, errors */ | ||
if (ret === null) { | ||
$.each(elems,function (i, elem) { | ||
$(elem).log(); | ||
}); | ||
ret = this._returnElems($(elems)); | ||
@@ -284,0 +287,0 @@ } |
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
13
13344297
3385