mirror of
https://github.com/appium/appium.git
synced 2026-01-28 21:28:57 -06:00
minor js fixes
This commit is contained in:
@@ -75,7 +75,7 @@ var respondError = function(req, res, statusObj, value) {
|
||||
}
|
||||
|
||||
if (typeof newValue === "object") {
|
||||
if (_.has(value, "message")) {
|
||||
if (newValue !== null && _.has(value, "message")) {
|
||||
// make sure this doesn't get obliterated
|
||||
value.origValue = value.message;
|
||||
message += " (Original error: " + value.message + ")";
|
||||
|
||||
@@ -22,26 +22,27 @@ describe('preferences app', function() {
|
||||
// have modified the plist of your preferences.app to run iphone
|
||||
// instead of ipad by default (this test is for iphone)
|
||||
it('should turn off autocomplete', function(done) {
|
||||
h.driver.elementsByTagName('tableCell', function(err, els) {
|
||||
els[1].click(function(err) {
|
||||
h.driver.elementsByTagName('tableCell', function(err, els) {
|
||||
els[1].click(function(err) {
|
||||
h.driver.elementByXPath('//switch[@name="Auto-Correction"]', function(err, switchEl) {
|
||||
switchEl.getValue(function(err, checked) {
|
||||
if (checked === 1) {
|
||||
// was checked, click it off
|
||||
switchEl.click(function(err) {
|
||||
done();
|
||||
});
|
||||
} else {
|
||||
// was unchecked, do nothing
|
||||
var p = {strategy: "tag name", selector: "tableCell", index: 1};
|
||||
h.driver.execute("mobile: findAndAct", [p], function(err) {
|
||||
should.not.exist(err);
|
||||
setTimeout(function() {
|
||||
h.driver.execute("mobile: findAndAct", [p], function(err) {
|
||||
should.not.exist(err);
|
||||
h.driver.elementByXPath('//switch[@name="Auto-Correction"]', function(err, switchEl) {
|
||||
switchEl.getValue(function(err, checked) {
|
||||
if (checked === 1) {
|
||||
// was checked, click it off
|
||||
switchEl.click(function(err) {
|
||||
done();
|
||||
}
|
||||
});
|
||||
});
|
||||
} else {
|
||||
// was unchecked, do nothing
|
||||
done();
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
}, 1000);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user