Skip to content

Commit

Permalink
fix: Make sure the app is not reinstalled if noReset is requested
Browse files Browse the repository at this point in the history
  • Loading branch information
mykola-mokhnach committed Mar 12, 2023
1 parent 07fbd3f commit 4e8ccba
Showing 1 changed file with 10 additions and 13 deletions.
23 changes: 10 additions & 13 deletions lib/driver.js
Original file line number Diff line number Diff line change
Expand Up @@ -1279,7 +1279,16 @@ class XCUITestDriver extends BaseDriver {
} = this.opts;

const wasAppInstalled = await device.isAppInstalled(bundleId);
if (!wasAppInstalled) {
if (wasAppInstalled) {
this.log.info(`App '${bundleId}' is already installed`);
if (noReset) {
this.log.info('noReset is requested. The app will not be be (re)installed');
return {
install: false,
skipUninstall: true,
};
}
} else {
this.log.info(`App '${bundleId}' is not installed on the device yet`);
}
if (enforceAppInstall !== false || fullReset) {
Expand All @@ -1288,18 +1297,6 @@ class XCUITestDriver extends BaseDriver {
skipUninstall: !wasAppInstalled,
};
}
if (!wasAppInstalled) {
return {
install: true,
skipUninstall: true,
};
} else if (noReset) {
this.log.info(`App '${bundleId}' is already installed and noReset is requested`);
return {
install: false,
skipUninstall: true,
};
}

const candidateBundleVersion = await extractBundleVersion.bind(this)(app);
this.log.debug(`CFBundleVersion from Info.plist: ${candidateBundleVersion}`);
Expand Down

0 comments on commit 4e8ccba

Please sign in to comment.