Innovenergy_trunk/frontend/node_modules/testcafe-browser-tools/lib/binaries.js

64 lines
9.2 KiB
JavaScript
Raw Normal View History

"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const path_1 = require("path");
const os_1 = require("os");
const os_family_1 = __importDefault(require("os-family"));
const read_file_relative_1 = require("read-file-relative");
const linux_platform_info_1 = require("linux-platform-info");
const package_json_1 = require("../package.json");
const HIDDEN_DIR_PREFIX = '.';
const MAC_APP_NAME = 'TestCafe Browser Tools.app';
const MAC_APP_DIR = path_1.join(os_1.homedir(), HIDDEN_DIR_PREFIX + package_json_1.name, MAC_APP_NAME);
const MAC_APP_LOCAL_DIR = path_1.join(__dirname, `../bin/mac/${MAC_APP_NAME}`);
const MAC_BINARY_PATH = binary => path_1.join(MAC_APP_DIR, `Contents/MacOS/${binary}`);
var BINARIES = void 0;
if (os_family_1.default.win) {
BINARIES = {
findWindow: read_file_relative_1.toAbsPath('../bin/win/find-window.exe'),
getWindowSize: read_file_relative_1.toAbsPath('../bin/win/get-window-size.exe'),
close: read_file_relative_1.toAbsPath('../bin/win/close.exe'),
screenshot: read_file_relative_1.toAbsPath('../bin/win/screenshot.exe'),
generateThumbnail: read_file_relative_1.toAbsPath('../bin/win/generate-thumbnail.exe'),
resize: read_file_relative_1.toAbsPath('../bin/win/resize.exe'),
maximize: read_file_relative_1.toAbsPath('../bin/win/maximize.exe'),
bringToFront: read_file_relative_1.toAbsPath('../bin/win/bring-to-front.exe')
};
}
else if (os_family_1.default.mac) {
BINARIES = {
app: MAC_BINARY_PATH(package_json_1.name),
appDir: MAC_APP_DIR,
appLocalDir: MAC_APP_LOCAL_DIR,
main: read_file_relative_1.toAbsPath('../bin/mac/main'),
open: 'open',
findWindow: 'find-window',
getWindowSize: 'get-window-size',
getWindowBounds: 'get-window-bounds',
getWindowMaxBounds: 'get-window-max-bounds',
setWindowBounds: 'set-window-bounds',
close: 'close',
screenshot: 'screenshot',
resize: 'resize',
generateThumbnail: 'generate-thumbnail',
bringToFront: 'bring-to-front'
};
}
else if (os_family_1.default.linux) {
BINARIES = {
findWindow: read_file_relative_1.toAbsPath(`../bin/linux/${linux_platform_info_1.platform}/find-window`),
close: read_file_relative_1.toAbsPath(`../bin/linux/${linux_platform_info_1.platform}/close`),
getWindowSize: read_file_relative_1.toAbsPath(`../bin/linux/${linux_platform_info_1.platform}/get-window-size`),
resize: read_file_relative_1.toAbsPath(`../bin/linux/${linux_platform_info_1.platform}/resize`),
maximize: read_file_relative_1.toAbsPath(`../bin/linux/${linux_platform_info_1.platform}/maximize`),
screenshot: read_file_relative_1.toAbsPath(`../bin/linux/${linux_platform_info_1.platform}/screenshot`),
generateThumbnail: read_file_relative_1.toAbsPath(`../bin/linux/${linux_platform_info_1.platform}/generate-thumbnail`),
bringToFront: read_file_relative_1.toAbsPath(`../bin/linux/${linux_platform_info_1.platform}/bring-to-front`)
};
}
else
BINARIES = {};
exports.default = BINARIES;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYmluYXJpZXMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvYmluYXJpZXMuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7QUFBQSwrQkFBNEI7QUFDNUIsMkJBQTZCO0FBQzdCLDBEQUEyQjtBQUMzQiwyREFBK0M7QUFDL0MsNkRBQStDO0FBQy9DLGtEQUFzRDtBQUd0RCxNQUFNLGlCQUFpQixHQUFHLEdBQUcsQ0FBQztBQUM5QixNQUFNLFlBQVksR0FBUSw0QkFBNEIsQ0FBQztBQUN2RCxNQUFNLFdBQVcsR0FBUyxXQUFJLENBQUMsWUFBTyxFQUFFLEVBQUUsaUJBQWlCLEdBQUcsbUJBQVcsRUFBRSxZQUFZLENBQUMsQ0FBQztBQUN6RixNQUFNLGlCQUFpQixHQUFHLFdBQUksQ0FBQyx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