UNPKG

playwright-fluent

Version:
25 lines (24 loc) 1.21 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getEdgePath = void 0; const tslib_1 = require("tslib"); const os = tslib_1.__importStar(require("os")); const which = tslib_1.__importStar(require("which")); const currentPlatformType = os.type(); function getEdgePath() { switch (currentPlatformType) { case 'Darwin': return '/Applications/Microsoft Edge.app/Contents/MacOS/Microsoft Edge'; case 'Windows_NT': return 'C:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe'; case 'Linux': if (which.sync('microsoft-edge', { nothrow: true })) { return which.sync('microsoft-edge'); } throw new Error('Cannot find install path for Microsoft Edge. Either you can install it by running the command' + " 'npx playwright install msedge', or you should provide the path to the Edge App in the launch options."); default: throw new Error(`Platform '${currentPlatformType}' is not yet supported in playwright-fluent. You should supply the path to the Edge App in the launch options.`); } } exports.getEdgePath = getEdgePath;