appium-xcuitest-driver
Version:
Appium driver for iOS using XCUITest for backend
33 lines • 1.2 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.stop = stop;
const cleanup_1 = require("./cleanup");
/**
* Stops the active WebDriverAgent session, optionally quits the WDA process, and cleans up system files.
*/
async function stop() {
try {
if (!this._wda?.fullyStarted) {
return;
}
if (this.wda.jwproxy) {
try {
await this.proxyCommand(`/session/${this.sessionId}`, 'DELETE');
}
catch (err) {
const message = err instanceof Error ? err.message : String(err);
this.log.debug(`Unable to DELETE session on WDA: '${message}'. Continuing shutdown.`);
}
}
// The former could cache the xcodebuild, so should not quit the process.
// If the session skipped the xcodebuild (driver.wda.canSkipXcodebuild), the WDA instance
// should quit properly.
if ((!this.wda.webDriverAgentUrl && this.opts.useNewWDA) || this.wda.canSkipXcodebuild) {
await this.wda.quit();
}
}
finally {
await (0, cleanup_1.cleanup)(this);
}
}
//# sourceMappingURL=stop.js.map