appium-xcuitest-driver
Version:
Appium driver for iOS using XCUITest for backend
86 lines • 3.57 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.optionalFfmpegCheck = exports.OptionalFfmpegCheck = exports.optionalApplesimutilsCheck = exports.OptionalApplesimutilsCommandCheck = exports.optionalIdbCheck = exports.OptionalIdbCommandCheck = void 0;
const utils_1 = require("./utils");
const support_1 = require("appium/support");
require("@colors/colors");
/** @satisfies {import('@appium/types').IDoctorCheck} */
class OptionalIdbCommandCheck {
constructor() {
this.IDB_README_URL = 'https://git.io/JnxQc';
}
async diagnose() {
const fbIdbPath = await (0, utils_1.resolveExecutablePath)('idb');
const fbCompanionIdbPath = await (0, utils_1.resolveExecutablePath)('idb_companion');
if (fbIdbPath && fbCompanionIdbPath) {
return support_1.doctor.okOptional('idb and idb_companion are installed');
}
if (!fbIdbPath && fbCompanionIdbPath) {
return support_1.doctor.nokOptional('idb is not installed');
}
else if (fbIdbPath && !fbCompanionIdbPath) {
return support_1.doctor.nokOptional('idb_companion is not installed');
}
return support_1.doctor.nokOptional('idb and idb_companion are not installed');
}
async fix() {
return `Why ${'idb'.bold} is needed and how to install it: ${this.IDB_README_URL}`;
}
hasAutofix() {
return false;
}
isOptional() {
return true;
}
}
exports.OptionalIdbCommandCheck = OptionalIdbCommandCheck;
exports.optionalIdbCheck = new OptionalIdbCommandCheck();
/** @satisfies {import('@appium/types').IDoctorCheck} */
class OptionalApplesimutilsCommandCheck {
constructor() {
this.README_LINK = 'https://github.com/appium/appium-xcuitest-driver/blob/master/docs/reference/execute-methods.md#mobile-setpermission';
}
async diagnose() {
const applesimutilsPath = await (0, utils_1.resolveExecutablePath)('applesimutils');
return applesimutilsPath
? support_1.doctor.okOptional(`applesimutils is installed at: ${applesimutilsPath}`)
: support_1.doctor.nokOptional('applesimutils are not installed');
}
async fix() {
return `Why ${'applesimutils'.bold} is needed and how to install it: ${this.README_LINK}`;
}
hasAutofix() {
return false;
}
isOptional() {
return true;
}
}
exports.OptionalApplesimutilsCommandCheck = OptionalApplesimutilsCommandCheck;
exports.optionalApplesimutilsCheck = new OptionalApplesimutilsCommandCheck();
/** @satisfies {import('@appium/types').IDoctorCheck} */
class OptionalFfmpegCheck {
constructor() {
this.FFMPEG_BINARY = 'ffmpeg';
this.FFMPEG_INSTALL_LINK = 'https://www.ffmpeg.org/download.html';
}
async diagnose() {
const ffmpegPath = await (0, utils_1.resolveExecutablePath)(this.FFMPEG_BINARY);
return ffmpegPath
? support_1.doctor.okOptional(`${this.FFMPEG_BINARY} exists at '${ffmpegPath}'`)
: support_1.doctor.nokOptional(`${this.FFMPEG_BINARY} cannot be found`);
}
async fix() {
return (`${`${this.FFMPEG_BINARY}`.bold} is used to capture screen recordings from the device under test. ` +
`Please read ${this.FFMPEG_INSTALL_LINK}.`);
}
hasAutofix() {
return false;
}
isOptional() {
return true;
}
}
exports.OptionalFfmpegCheck = OptionalFfmpegCheck;
exports.optionalFfmpegCheck = new OptionalFfmpegCheck();
//# sourceMappingURL=optional-checks.js.map