mirror of
https://github.com/appium/appium.git
synced 2026-02-11 04:20:00 -06:00
Fix null tap
This commit is contained in:
@@ -752,7 +752,7 @@ IOS.prototype.click = function(elementId, cb) {
|
||||
this.executeAtom('tap', [atomsElement], cb);
|
||||
}, this));
|
||||
} else {
|
||||
var command = ["au.getElement('", elementId, "').tap()"].join('');
|
||||
var command = ["au.tapById('", elementId, "')"].join('');
|
||||
this.proxy(command, cb);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -13,10 +13,25 @@ $.extend(au, {
|
||||
, mainWindow: UIATarget.localTarget().frontMostApp().mainWindow()
|
||||
, mainApp: UIATarget.localTarget().frontMostApp()
|
||||
, keyboard: function() { return UIATarget.localTarget().frontMostApp().keyboard(); }
|
||||
, tapById: function(elementId, cb) {
|
||||
var element = this.getElement(elementId);
|
||||
if (element) {
|
||||
element.tap();
|
||||
return {
|
||||
status: codes.Success.code,
|
||||
value: null
|
||||
};
|
||||
} else {
|
||||
return {
|
||||
status: codes.UnknownError.code,
|
||||
value: 'elementId ' + elementId + ' is null and can\'t be tapped.'
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
// Screen-related functions
|
||||
|
||||
, getScreenOrientation: function () {
|
||||
, getScreenOrientation: function() {
|
||||
var orientation = $.orientation()
|
||||
, value = null;
|
||||
switch (orientation) {
|
||||
|
||||
Reference in New Issue
Block a user