UNPKG

perfrunner

Version:

Command-line-interface for the perfrunner - automated UI performance test tool

33 lines (32 loc) 1.88 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.parseUserInput = void 0; const command_line_args_1 = __importDefault(require("command-line-args")); const cmd_utility_1 = require("../../cmd-utility"); const config_1 = require("../../config"); const options = { url: { type: cmd_utility_1.UrlBasedString, defaultOption: true }, timeout: { type: Number, defaultValue: config_1.DEFAULT_TIMEOUT }, cache: { type: cmd_utility_1.Bool, multiple: true, defaultValue: [false], alias: 'C' }, throttling: { type: Number, defaultValue: config_1.DEFAULT_THROTTLING_RATE, alias: 'T' }, network: { type: cmd_utility_1.Network, defaultValue: [config_1.Original, config_1.HSPA_Plus], multiple: true }, output: { type: String, defaultValue: config_1.DEFAULT_OUTPUT_FOLDER }, purge: { type: Boolean, defaultValue: false }, reporter: { type: String, multiple: true, defaultValue: [config_1.DEFAULT_REPORTER] }, runs: { type: Number, defaultValue: config_1.DEFAULT_NUMBER_RUNS, alias: 'R' }, noHeadless: { type: Boolean, defaultValue: false }, comment: { type: String }, testName: { type: String }, reportOnly: { type: Boolean }, chromeArgs: { type: cmd_utility_1.ArgsLikeString, multiple: true }, ignoreDefaultArgs: { type: Boolean }, waitFor: { type: cmd_utility_1.StringOrNumber, alias: 'W' }, logLevel: { type: cmd_utility_1.LogLevel, defaultValue: undefined }, executablePath: { type: String, alias: 'E' }, }; const definitions = (0, cmd_utility_1.toCmdDefinitions)(options); const parseUserInput = () => (0, command_line_args_1.default)(definitions, { camelCase: true }); exports.parseUserInput = parseUserInput;