|
| 1 | +const Constants = require('./constants'); |
| 2 | + |
| 3 | +const usernameOptions = { |
| 4 | + 'u': { |
| 5 | + alias: 'username', |
| 6 | + describe: Constants.cliMessages.COMMON.USERNAME, |
| 7 | + type: "string", |
| 8 | + default: undefined |
| 9 | + }, |
| 10 | +} |
| 11 | + |
| 12 | +const accessKeyOptions = { |
| 13 | + 'k': { |
| 14 | + alias: 'key', |
| 15 | + describe: Constants.cliMessages.COMMON.ACCESS_KEY, |
| 16 | + type: "string", |
| 17 | + default: undefined |
| 18 | + }, |
| 19 | +} |
| 20 | + |
| 21 | +const configFileOptions = { |
| 22 | + 'cf': { |
| 23 | + alias: 'config-file', |
| 24 | + describe: Constants.cliMessages.COMMON.CONFIG_FILE_PATH, |
| 25 | + default: 'browserstack.json', |
| 26 | + type: 'string', |
| 27 | + nargs: 1, |
| 28 | + demand: true, |
| 29 | + demand: Constants.cliMessages.COMMON.CONFIG_DEMAND |
| 30 | + }, |
| 31 | +} |
| 32 | + |
| 33 | +const debugModeOptions = { |
| 34 | + 'cli-debug': { |
| 35 | + default: false, |
| 36 | + describe: Constants.cliMessages.COMMON.DEBUG, |
| 37 | + type: "boolean" |
| 38 | + }, |
| 39 | +} |
| 40 | + |
| 41 | +exports.disableUsageReportingOptions = { |
| 42 | + 'disable-usage-reporting': { |
| 43 | + default: undefined, |
| 44 | + description: Constants.cliMessages.COMMON.DISABLE_USAGE_REPORTING, |
| 45 | + type: "boolean" |
| 46 | + }, |
| 47 | +} |
| 48 | + |
| 49 | +exports.commonBuildOptions = { |
| 50 | + ...configFileOptions, |
| 51 | + ...this.disableUsageReportingOptions, |
| 52 | + ...usernameOptions, |
| 53 | + ...accessKeyOptions, |
| 54 | + ...debugModeOptions, |
| 55 | +} |
| 56 | + |
| 57 | +exports.runOptions = { |
| 58 | + ...this.commonBuildOptions, |
| 59 | + 'ccf': { |
| 60 | + alias: 'cypress-config-file', |
| 61 | + describe: Constants.cliMessages.RUN.CYPRESS_DESC, |
| 62 | + default: './cypress.json', |
| 63 | + type: 'string', |
| 64 | + nargs: 1, |
| 65 | + demand: true, |
| 66 | + demand: Constants.cliMessages.RUN.CYPRESS_CONFIG_DEMAND |
| 67 | + }, |
| 68 | + 'gl': { |
| 69 | + alias: 'geolocation', |
| 70 | + describe: Constants.cliMessages.RUN.CYPRESS_GEO_LOCATION, |
| 71 | + default: undefined, |
| 72 | + type: 'string' |
| 73 | + }, |
| 74 | + 'p': { |
| 75 | + alias: ['parallels', 'parallel'], |
| 76 | + describe: Constants.cliMessages.RUN.PARALLEL_DESC, |
| 77 | + type: "number", |
| 78 | + default: undefined |
| 79 | + }, |
| 80 | + 'b': { |
| 81 | + alias: ['build-name', 'ci-build-id'], |
| 82 | + describe: Constants.cliMessages.RUN.BUILD_NAME, |
| 83 | + type: "string", |
| 84 | + default: undefined |
| 85 | + }, |
| 86 | + 'e': { |
| 87 | + alias: 'exclude', |
| 88 | + describe: Constants.cliMessages.RUN.EXCLUDE, |
| 89 | + type: "string", |
| 90 | + default: undefined |
| 91 | + }, |
| 92 | + 's': { |
| 93 | + alias: ['specs', 'spec'], |
| 94 | + describe: Constants.cliMessages.RUN.SPECS_DESCRIPTION, |
| 95 | + type: "string", |
| 96 | + default: undefined |
| 97 | + }, |
| 98 | + 'env': { |
| 99 | + describe: Constants.cliMessages.RUN.ENV_DESCRIPTION, |
| 100 | + type: "string", |
| 101 | + default: undefined |
| 102 | + }, |
| 103 | + 't': { |
| 104 | + alias: ['specTimeout'], |
| 105 | + default: undefined, |
| 106 | + describe: Constants.cliMessages.RUN.SPEC_TIMEOUT, |
| 107 | + type: "string" |
| 108 | + }, |
| 109 | + 'disable-npm-warning': { |
| 110 | + default: false, |
| 111 | + description: Constants.cliMessages.COMMON.NO_NPM_WARNING, |
| 112 | + type: "boolean" |
| 113 | + }, |
| 114 | + 'sync': { |
| 115 | + default: true, |
| 116 | + describe: Constants.cliMessages.RUN.SYNC_DESCRIPTION, |
| 117 | + type: "boolean" |
| 118 | + }, |
| 119 | + 'async': { |
| 120 | + default: false, |
| 121 | + describe: Constants.cliMessages.RUN.ASYNC_DESCRIPTION, |
| 122 | + type: "boolean" |
| 123 | + }, |
| 124 | + 'force-upload': { |
| 125 | + default: false, |
| 126 | + describe: Constants.cliMessages.COMMON.FORCE_UPLOAD, |
| 127 | + type: "boolean" |
| 128 | + }, |
| 129 | + 'headed': { |
| 130 | + default: false, |
| 131 | + describe: Constants.cliMessages.RUN.HEADED, |
| 132 | + type: "boolean" |
| 133 | + }, |
| 134 | + 'local': { |
| 135 | + describe: Constants.cliMessages.RUN.LOCAL, |
| 136 | + type: "boolean" |
| 137 | + }, |
| 138 | + 'local-identifier': { |
| 139 | + describe: Constants.cliMessages.RUN.LOCAL_IDENTIFIER, |
| 140 | + type: "string" |
| 141 | + }, |
| 142 | + 'local-mode': { |
| 143 | + describe: Constants.cliMessages.RUN.LOCAL_MODE, |
| 144 | + type: "string" |
| 145 | + }, |
| 146 | + 'local-config-file': { |
| 147 | + describe: Constants.cliMessages.RUN.LOCAL_CONFIG_FILE, |
| 148 | + type: "string" |
| 149 | + }, |
| 150 | + 'no-wrap': { |
| 151 | + default: false, |
| 152 | + describe: Constants.cliMessages.RUN.SYNC_NO_WRAP, |
| 153 | + type: "boolean" |
| 154 | + }, |
| 155 | + 'browser': { |
| 156 | + describe: Constants.cliMessages.RUN.BROWSER_DESCRIPTION, |
| 157 | + type: "string", |
| 158 | + default: undefined |
| 159 | + }, |
| 160 | + 'c': { |
| 161 | + alias: 'config', |
| 162 | + describe: Constants.cliMessages.RUN.CONFIG_DESCRIPTION, |
| 163 | + type: "string", |
| 164 | + default: undefined |
| 165 | + }, |
| 166 | + 'r': { |
| 167 | + alias: 'reporter', |
| 168 | + default: undefined, |
| 169 | + describe: Constants.cliMessages.RUN.REPORTER, |
| 170 | + type: "string" |
| 171 | + }, |
| 172 | + 'o': { |
| 173 | + alias: 'reporter-options', |
| 174 | + default: undefined, |
| 175 | + describe: Constants.cliMessages.RUN.REPORTER_OPTIONS, |
| 176 | + type: "string" |
| 177 | + }, |
| 178 | + 'record': { |
| 179 | + describe: Constants.cliMessages.RUN.RECORD, |
| 180 | + type: "boolean" |
| 181 | + }, |
| 182 | + 'record-key': { |
| 183 | + default: undefined, |
| 184 | + describe: Constants.cliMessages.RUN.RECORD_KEY, |
| 185 | + type: "string" |
| 186 | + }, |
| 187 | + 'projectId': { |
| 188 | + default: undefined, |
| 189 | + describe: Constants.cliMessages.RUN.PROJECT_ID, |
| 190 | + type: "string" |
| 191 | + }, |
| 192 | + 'nv': { |
| 193 | + alias: ['node-version', 'nodeVersion'], |
| 194 | + default: undefined, |
| 195 | + describe: Constants.cliMessages.RUN.NODE_VERSION, |
| 196 | + type: "string" |
| 197 | + }, |
| 198 | + 'build-tag': { |
| 199 | + default: undefined, |
| 200 | + describe: Constants.cliMessages.RUN.BUILD_TAG, |
| 201 | + type: "string" |
| 202 | + } |
| 203 | +} |
0 commit comments