mirror of
https://github.com/appium/appium.git
synced 2026-02-11 12:29:48 -06:00
Merge pull request #2012 from jlipps/master
don't delete /Applications unless we're doing fullReset
This commit is contained in:
@@ -940,25 +940,23 @@ IOS.prototype.cleanupAppState = function (cb) {
|
||||
cb(err);
|
||||
} else {
|
||||
var filesExamined = 0;
|
||||
var maybeNext = function () {
|
||||
var doneWithFile = function () {
|
||||
filesExamined++;
|
||||
if (filesExamined === files.length) {
|
||||
if (this.args.keepKeyChains) {
|
||||
// files[0] is always the Applications dir
|
||||
// we want to keep it around so --keep-keychains logic will work
|
||||
mkdirp.sync(files[0]);
|
||||
}
|
||||
cb();
|
||||
}
|
||||
}.bind(this);
|
||||
if (files.length) {
|
||||
_.each(files, function (file) {
|
||||
rimraf(file, function () {
|
||||
logger.info("Deleted " + file);
|
||||
filesExamined++;
|
||||
maybeNext();
|
||||
}.bind(this));
|
||||
for (var i = 0; i < files.length; i++) {
|
||||
if (this.args.fullReset) {
|
||||
rimraf.sync(files[i]);
|
||||
logger.info("Deleted " + files[i]);
|
||||
if (i === 0 && this.args.keepKeyChains) {
|
||||
mkdirp.sync(files[i]);
|
||||
}
|
||||
}
|
||||
|
||||
var root = path.dirname(file);
|
||||
var root = path.dirname(files[i]);
|
||||
var tcc = path.join(root, 'Library/TCC');
|
||||
if (fs.existsSync(tcc)) {
|
||||
rimraf.sync(tcc);
|
||||
@@ -982,7 +980,8 @@ IOS.prototype.cleanupAppState = function (cb) {
|
||||
rimraf.sync(keychain);
|
||||
logger.info("Deleted " + keychain);
|
||||
}
|
||||
}.bind(this));
|
||||
doneWithFile();
|
||||
}
|
||||
} else {
|
||||
logger.info("No folders found to remove");
|
||||
if (this.realDevice && this.args.bundleId) {
|
||||
|
||||
@@ -22,8 +22,9 @@ module.exports = function (app) {
|
||||
|
||||
var setup = function (context) {
|
||||
return setupBase(context, {
|
||||
nonSyntheticWebClick: false,
|
||||
app: app
|
||||
nonSyntheticWebClick: true,
|
||||
app: app,
|
||||
safariIgnoreFraudWarning: true
|
||||
});
|
||||
};
|
||||
|
||||
@@ -273,6 +274,15 @@ module.exports = function (app) {
|
||||
driver.refresh()
|
||||
.nodeify(done);
|
||||
});
|
||||
it('should not display a phishing warning with safariIgnoreFraudWarning', function (done) {
|
||||
if (isChrome) return _skip(
|
||||
"Chrome doesn't test safariIgnoreFraudWarning", done);
|
||||
driver
|
||||
.get("http://foo:bar@google.com")
|
||||
.title()
|
||||
.should.eventually.contain("Google")
|
||||
.nodeify(done);
|
||||
});
|
||||
});
|
||||
|
||||
describe('implicit wait', function () {
|
||||
|
||||
Reference in New Issue
Block a user