@testrigor/testrigor-cli 0.0.51-beta → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +452 -0
- package/dist/commands/authenticate.js +1 -1
- package/dist/commands/test-suite/config.js +1 -1
- package/dist/commands/test-suite/run.js +18 -17
- package/dist/commands/test-suite/validate-syntax.d.ts +20 -0
- package/dist/commands/test-suite/validate-syntax.js +118 -0
- package/dist/flags/chrome-extension.js +3 -2
- package/dist/types.d.ts +7 -1
- package/dist/util/appium.js +29 -25
- package/dist/util/certificate-uploader.js +5 -5
- package/dist/util/config.js +15 -15
- package/dist/util/parser.js +8 -8
- package/dist/util/request-builder.d.ts +1 -1
- package/dist/util/request-builder.js +7 -7
- package/dist/util/trtc.d.ts +2 -0
- package/dist/util/trtc.js +107 -38
- package/dist/util/tunnel.js +7 -6
- package/dist/util/type-guards.js +3 -4
- package/dist/util/utils.d.ts +3 -3
- package/dist/util/utils.js +23 -23
- package/dist/util/variable-file-uploader.js +7 -7
- package/dist/util/variables-path-parser.js +4 -4
- package/oclif.manifest.json +98 -1
- package/package.json +10 -7
package/README.md
CHANGED
|
@@ -73,3 +73,455 @@ overrideTestNodes: true
|
|
|
73
73
|
```
|
|
74
74
|
|
|
75
75
|
This overrides the device config stored in the test suite and forces mobile mode (no need for `--localhost`).
|
|
76
|
+
|
|
77
|
+
### Releasing a new version
|
|
78
|
+
|
|
79
|
+
Every push to `master` runs the CircleCI `publish` workflow. It builds the tarballs, then publishes the package to npm under the `latest` tag. npm refuses to republish an existing version, so a change is only released when it bumps the version.
|
|
80
|
+
|
|
81
|
+
1. Pick the [semver](https://semver.org) bump: `patch` for fixes, `minor` for new flags or commands, `major` for breaking changes.
|
|
82
|
+
2. Bump the version with npm (don't edit `package.json` by hand):
|
|
83
|
+
|
|
84
|
+
```
|
|
85
|
+
npm run build
|
|
86
|
+
npm version patch --no-git-tag-version
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
This updates the version in `package.json` and in both root entries of `package-lock.json` (`version` and `packages[""].version`). `--no-git-tag-version` stops npm from creating its own commit and `v*` tag. npm also runs the `version` script (`oclif readme && git add README.md`). That script loads the commands from `dist`, which is why you build first. It only rewrites README sections between oclif markers such as `<!-- commands -->
|
|
90
|
+
* [`testrigor authenticate`](#testrigor-authenticate)
|
|
91
|
+
* [`testrigor help [COMMANDS]`](#testrigor-help-commands)
|
|
92
|
+
* [`testrigor plugins`](#testrigor-plugins)
|
|
93
|
+
* [`testrigor plugins:install PLUGIN...`](#testrigor-pluginsinstall-plugin)
|
|
94
|
+
* [`testrigor plugins:inspect PLUGIN...`](#testrigor-pluginsinspect-plugin)
|
|
95
|
+
* [`testrigor plugins:install PLUGIN...`](#testrigor-pluginsinstall-plugin-1)
|
|
96
|
+
* [`testrigor plugins:link PLUGIN`](#testrigor-pluginslink-plugin)
|
|
97
|
+
* [`testrigor plugins:uninstall PLUGIN...`](#testrigor-pluginsuninstall-plugin)
|
|
98
|
+
* [`testrigor plugins:uninstall PLUGIN...`](#testrigor-pluginsuninstall-plugin-1)
|
|
99
|
+
* [`testrigor plugins:uninstall PLUGIN...`](#testrigor-pluginsuninstall-plugin-2)
|
|
100
|
+
* [`testrigor plugins update`](#testrigor-plugins-update)
|
|
101
|
+
* [`testrigor test-suite config`](#testrigor-test-suite-config)
|
|
102
|
+
* [`testrigor test-suite run [TESTSUITEID]`](#testrigor-test-suite-run-testsuiteid)
|
|
103
|
+
* [`testrigor test-suite validate-syntax [TESTSUITEID]`](#testrigor-test-suite-validate-syntax-testsuiteid)
|
|
104
|
+
|
|
105
|
+
## `testrigor authenticate`
|
|
106
|
+
|
|
107
|
+
Set your testRigor authentication token
|
|
108
|
+
|
|
109
|
+
```
|
|
110
|
+
USAGE
|
|
111
|
+
$ testrigor authenticate
|
|
112
|
+
|
|
113
|
+
DESCRIPTION
|
|
114
|
+
Set your testRigor authentication token
|
|
115
|
+
|
|
116
|
+
EXAMPLES
|
|
117
|
+
$ testrigor authenticate
|
|
118
|
+
|
|
119
|
+
Prompts for your API authentication token
|
|
120
|
+
|
|
121
|
+
Use 'testrigor test-suite config' to set default test suite ID separately
|
|
122
|
+
|
|
123
|
+
Config will be stored in ~/.testrigor/testrigor.yml
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
_See code: [src/commands/authenticate.ts](https://github.com/TestRigor/testrigor-cli/blob/v1.0.1/src/commands/authenticate.ts)_
|
|
127
|
+
|
|
128
|
+
## `testrigor help [COMMANDS]`
|
|
129
|
+
|
|
130
|
+
Display help for testrigor.
|
|
131
|
+
|
|
132
|
+
```
|
|
133
|
+
USAGE
|
|
134
|
+
$ testrigor help [COMMANDS] [-n]
|
|
135
|
+
|
|
136
|
+
ARGUMENTS
|
|
137
|
+
COMMANDS Command to show help for.
|
|
138
|
+
|
|
139
|
+
FLAGS
|
|
140
|
+
-n, --nested-commands Include all nested commands in the output.
|
|
141
|
+
|
|
142
|
+
DESCRIPTION
|
|
143
|
+
Display help for testrigor.
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
_See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v5.2.20/src/commands/help.ts)_
|
|
147
|
+
|
|
148
|
+
## `testrigor plugins`
|
|
149
|
+
|
|
150
|
+
List installed plugins.
|
|
151
|
+
|
|
152
|
+
```
|
|
153
|
+
USAGE
|
|
154
|
+
$ testrigor plugins [--json] [--core]
|
|
155
|
+
|
|
156
|
+
FLAGS
|
|
157
|
+
--core Show core plugins.
|
|
158
|
+
|
|
159
|
+
GLOBAL FLAGS
|
|
160
|
+
--json Format output as json.
|
|
161
|
+
|
|
162
|
+
DESCRIPTION
|
|
163
|
+
List installed plugins.
|
|
164
|
+
|
|
165
|
+
EXAMPLES
|
|
166
|
+
$ testrigor plugins
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v3.10.1/src/commands/plugins/index.ts)_
|
|
170
|
+
|
|
171
|
+
## `testrigor plugins:install PLUGIN...`
|
|
172
|
+
|
|
173
|
+
Installs a plugin into the CLI.
|
|
174
|
+
|
|
175
|
+
```
|
|
176
|
+
USAGE
|
|
177
|
+
$ testrigor plugins:install PLUGIN...
|
|
178
|
+
|
|
179
|
+
ARGUMENTS
|
|
180
|
+
PLUGIN Plugin to install.
|
|
181
|
+
|
|
182
|
+
FLAGS
|
|
183
|
+
-f, --force Run yarn install with force flag.
|
|
184
|
+
-h, --help Show CLI help.
|
|
185
|
+
-v, --verbose
|
|
186
|
+
|
|
187
|
+
DESCRIPTION
|
|
188
|
+
Installs a plugin into the CLI.
|
|
189
|
+
Can be installed from npm or a git url.
|
|
190
|
+
|
|
191
|
+
Installation of a user-installed plugin will override a core plugin.
|
|
192
|
+
|
|
193
|
+
e.g. If you have a core plugin that has a 'hello' command, installing a user-installed plugin with a 'hello' command
|
|
194
|
+
will override the core plugin implementation. This is useful if a user needs to update core plugin functionality in
|
|
195
|
+
the CLI without the need to patch and update the whole CLI.
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+
ALIASES
|
|
199
|
+
$ testrigor plugins add
|
|
200
|
+
|
|
201
|
+
EXAMPLES
|
|
202
|
+
$ testrigor plugins:install myplugin
|
|
203
|
+
|
|
204
|
+
$ testrigor plugins:install https://github.com/someuser/someplugin
|
|
205
|
+
|
|
206
|
+
$ testrigor plugins:install someuser/someplugin
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
## `testrigor plugins:inspect PLUGIN...`
|
|
210
|
+
|
|
211
|
+
Displays installation properties of a plugin.
|
|
212
|
+
|
|
213
|
+
```
|
|
214
|
+
USAGE
|
|
215
|
+
$ testrigor plugins:inspect PLUGIN...
|
|
216
|
+
|
|
217
|
+
ARGUMENTS
|
|
218
|
+
PLUGIN [default: .] Plugin to inspect.
|
|
219
|
+
|
|
220
|
+
FLAGS
|
|
221
|
+
-h, --help Show CLI help.
|
|
222
|
+
-v, --verbose
|
|
223
|
+
|
|
224
|
+
GLOBAL FLAGS
|
|
225
|
+
--json Format output as json.
|
|
226
|
+
|
|
227
|
+
DESCRIPTION
|
|
228
|
+
Displays installation properties of a plugin.
|
|
229
|
+
|
|
230
|
+
EXAMPLES
|
|
231
|
+
$ testrigor plugins:inspect myplugin
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v3.10.1/src/commands/plugins/inspect.ts)_
|
|
235
|
+
|
|
236
|
+
## `testrigor plugins:install PLUGIN...`
|
|
237
|
+
|
|
238
|
+
Installs a plugin into the CLI.
|
|
239
|
+
|
|
240
|
+
```
|
|
241
|
+
USAGE
|
|
242
|
+
$ testrigor plugins:install PLUGIN...
|
|
243
|
+
|
|
244
|
+
ARGUMENTS
|
|
245
|
+
PLUGIN Plugin to install.
|
|
246
|
+
|
|
247
|
+
FLAGS
|
|
248
|
+
-f, --force Run yarn install with force flag.
|
|
249
|
+
-h, --help Show CLI help.
|
|
250
|
+
-v, --verbose
|
|
251
|
+
|
|
252
|
+
DESCRIPTION
|
|
253
|
+
Installs a plugin into the CLI.
|
|
254
|
+
Can be installed from npm or a git url.
|
|
255
|
+
|
|
256
|
+
Installation of a user-installed plugin will override a core plugin.
|
|
257
|
+
|
|
258
|
+
e.g. If you have a core plugin that has a 'hello' command, installing a user-installed plugin with a 'hello' command
|
|
259
|
+
will override the core plugin implementation. This is useful if a user needs to update core plugin functionality in
|
|
260
|
+
the CLI without the need to patch and update the whole CLI.
|
|
261
|
+
|
|
262
|
+
|
|
263
|
+
ALIASES
|
|
264
|
+
$ testrigor plugins add
|
|
265
|
+
|
|
266
|
+
EXAMPLES
|
|
267
|
+
$ testrigor plugins:install myplugin
|
|
268
|
+
|
|
269
|
+
$ testrigor plugins:install https://github.com/someuser/someplugin
|
|
270
|
+
|
|
271
|
+
$ testrigor plugins:install someuser/someplugin
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v3.10.1/src/commands/plugins/install.ts)_
|
|
275
|
+
|
|
276
|
+
## `testrigor plugins:link PLUGIN`
|
|
277
|
+
|
|
278
|
+
Links a plugin into the CLI for development.
|
|
279
|
+
|
|
280
|
+
```
|
|
281
|
+
USAGE
|
|
282
|
+
$ testrigor plugins:link PLUGIN
|
|
283
|
+
|
|
284
|
+
ARGUMENTS
|
|
285
|
+
PATH [default: .] path to plugin
|
|
286
|
+
|
|
287
|
+
FLAGS
|
|
288
|
+
-h, --help Show CLI help.
|
|
289
|
+
-v, --verbose
|
|
290
|
+
--[no-]install Install dependencies after linking the plugin.
|
|
291
|
+
|
|
292
|
+
DESCRIPTION
|
|
293
|
+
Links a plugin into the CLI for development.
|
|
294
|
+
Installation of a linked plugin will override a user-installed or core plugin.
|
|
295
|
+
|
|
296
|
+
e.g. If you have a user-installed or core plugin that has a 'hello' command, installing a linked plugin with a 'hello'
|
|
297
|
+
command will override the user-installed or core plugin implementation. This is useful for development work.
|
|
298
|
+
|
|
299
|
+
|
|
300
|
+
EXAMPLES
|
|
301
|
+
$ testrigor plugins:link myplugin
|
|
302
|
+
```
|
|
303
|
+
|
|
304
|
+
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v3.10.1/src/commands/plugins/link.ts)_
|
|
305
|
+
|
|
306
|
+
## `testrigor plugins:uninstall PLUGIN...`
|
|
307
|
+
|
|
308
|
+
Removes a plugin from the CLI.
|
|
309
|
+
|
|
310
|
+
```
|
|
311
|
+
USAGE
|
|
312
|
+
$ testrigor plugins:uninstall PLUGIN...
|
|
313
|
+
|
|
314
|
+
ARGUMENTS
|
|
315
|
+
PLUGIN plugin to uninstall
|
|
316
|
+
|
|
317
|
+
FLAGS
|
|
318
|
+
-h, --help Show CLI help.
|
|
319
|
+
-v, --verbose
|
|
320
|
+
|
|
321
|
+
DESCRIPTION
|
|
322
|
+
Removes a plugin from the CLI.
|
|
323
|
+
|
|
324
|
+
ALIASES
|
|
325
|
+
$ testrigor plugins unlink
|
|
326
|
+
$ testrigor plugins remove
|
|
327
|
+
```
|
|
328
|
+
|
|
329
|
+
## `testrigor plugins:uninstall PLUGIN...`
|
|
330
|
+
|
|
331
|
+
Removes a plugin from the CLI.
|
|
332
|
+
|
|
333
|
+
```
|
|
334
|
+
USAGE
|
|
335
|
+
$ testrigor plugins:uninstall PLUGIN...
|
|
336
|
+
|
|
337
|
+
ARGUMENTS
|
|
338
|
+
PLUGIN plugin to uninstall
|
|
339
|
+
|
|
340
|
+
FLAGS
|
|
341
|
+
-h, --help Show CLI help.
|
|
342
|
+
-v, --verbose
|
|
343
|
+
|
|
344
|
+
DESCRIPTION
|
|
345
|
+
Removes a plugin from the CLI.
|
|
346
|
+
|
|
347
|
+
ALIASES
|
|
348
|
+
$ testrigor plugins unlink
|
|
349
|
+
$ testrigor plugins remove
|
|
350
|
+
```
|
|
351
|
+
|
|
352
|
+
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v3.10.1/src/commands/plugins/uninstall.ts)_
|
|
353
|
+
|
|
354
|
+
## `testrigor plugins:uninstall PLUGIN...`
|
|
355
|
+
|
|
356
|
+
Removes a plugin from the CLI.
|
|
357
|
+
|
|
358
|
+
```
|
|
359
|
+
USAGE
|
|
360
|
+
$ testrigor plugins:uninstall PLUGIN...
|
|
361
|
+
|
|
362
|
+
ARGUMENTS
|
|
363
|
+
PLUGIN plugin to uninstall
|
|
364
|
+
|
|
365
|
+
FLAGS
|
|
366
|
+
-h, --help Show CLI help.
|
|
367
|
+
-v, --verbose
|
|
368
|
+
|
|
369
|
+
DESCRIPTION
|
|
370
|
+
Removes a plugin from the CLI.
|
|
371
|
+
|
|
372
|
+
ALIASES
|
|
373
|
+
$ testrigor plugins unlink
|
|
374
|
+
$ testrigor plugins remove
|
|
375
|
+
```
|
|
376
|
+
|
|
377
|
+
## `testrigor plugins update`
|
|
378
|
+
|
|
379
|
+
Update installed plugins.
|
|
380
|
+
|
|
381
|
+
```
|
|
382
|
+
USAGE
|
|
383
|
+
$ testrigor plugins update [-h] [-v]
|
|
384
|
+
|
|
385
|
+
FLAGS
|
|
386
|
+
-h, --help Show CLI help.
|
|
387
|
+
-v, --verbose
|
|
388
|
+
|
|
389
|
+
DESCRIPTION
|
|
390
|
+
Update installed plugins.
|
|
391
|
+
```
|
|
392
|
+
|
|
393
|
+
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v3.10.1/src/commands/plugins/update.ts)_
|
|
394
|
+
|
|
395
|
+
## `testrigor test-suite config`
|
|
396
|
+
|
|
397
|
+
Configure test suite settings and default test suite ID
|
|
398
|
+
|
|
399
|
+
```
|
|
400
|
+
USAGE
|
|
401
|
+
$ testrigor test-suite config [--default <value> | --delete | --show]
|
|
402
|
+
|
|
403
|
+
FLAGS
|
|
404
|
+
--default=<value> Set the default test suite ID
|
|
405
|
+
--delete Remove the default test suite ID
|
|
406
|
+
--show Show current configuration
|
|
407
|
+
|
|
408
|
+
DESCRIPTION
|
|
409
|
+
Configure test suite settings and default test suite ID
|
|
410
|
+
|
|
411
|
+
EXAMPLES
|
|
412
|
+
$ testrigor test-suite config --default TEST-SUITE-ID
|
|
413
|
+
|
|
414
|
+
$ testrigor test-suite config --show
|
|
415
|
+
|
|
416
|
+
$ testrigor test-suite config --delete
|
|
417
|
+
```
|
|
418
|
+
|
|
419
|
+
_See code: [src/commands/test-suite/config.ts](https://github.com/TestRigor/testrigor-cli/blob/v1.0.1/src/commands/test-suite/config.ts)_
|
|
420
|
+
|
|
421
|
+
## `testrigor test-suite run [TESTSUITEID]`
|
|
422
|
+
|
|
423
|
+
Run all tests of a Test Suite
|
|
424
|
+
|
|
425
|
+
```
|
|
426
|
+
USAGE
|
|
427
|
+
$ testrigor test-suite run [TESTSUITEID] [--auth-token <value>] [-t <value>] [--min-port <value>] [--max-port
|
|
428
|
+
<value>] [--verbose] [-w] [--branch <value> --commit <value>] [--localhost] [--url <value>]
|
|
429
|
+
[--junit-report-save-path <value>] [--variables-path <value>] [--test-cases-path <value>] [--rules-path <value>]
|
|
430
|
+
[--settings-path <value>] [--local-test-nodes-path <value>] [--test-case-uuid <value>] [--auto-create-ai-rules]
|
|
431
|
+
[--explicit-mutations] [--labels <value>] [--excluded-labels <value>] [--base-url-web <value>] [--base-url-api
|
|
432
|
+
<value>] [--chrome-extension <value> | --file-path <value>] [--xray-execution-key <value>]
|
|
433
|
+
|
|
434
|
+
ARGUMENTS
|
|
435
|
+
TESTSUITEID The test suite id (optional if set in config)
|
|
436
|
+
|
|
437
|
+
FLAGS
|
|
438
|
+
-w, --async Don't wait for the test suite to finish
|
|
439
|
+
--auto-create-ai-rules Enable auto create AI based rules
|
|
440
|
+
--base-url-api=<value> Base URL for API2 (e.g., https://api2.testrigor.com)
|
|
441
|
+
--base-url-web=<value> Base URL for web interface (e.g., https://app.testrigor.com)
|
|
442
|
+
--branch=<value> The branch name
|
|
443
|
+
--chrome-extension=<value>... Chrome extension: "name=EXT_NAME file=PATH_TO_CRX"
|
|
444
|
+
--commit=<value> The commit
|
|
445
|
+
--excluded-labels=<value>... Not run tests of specific labels
|
|
446
|
+
--explicit-mutations In cases where you are always using mutations, such as storing test cases in your
|
|
447
|
+
own repository, and you always send us the set of test cases you have through our
|
|
448
|
+
API you should send "--explicit-mutations"
|
|
449
|
+
--file-path=<value> Path to the file stored locally. It will upload the new file to be used. File type
|
|
450
|
+
should be according to the file type accepted for the Test Suite type of testing. If
|
|
451
|
+
the parameter --url is used, this parameter will be ignored.
|
|
452
|
+
--junit-report-save-path=<value> JUnit report save path
|
|
453
|
+
--labels=<value>... Run tests of specific labels
|
|
454
|
+
--local-test-nodes-path=<value> Path to a YAML or JSON file with local test nodes configuration
|
|
455
|
+
--localhost Localhost run (auto-detects web vs mobile)
|
|
456
|
+
--max-port=<value> [default: 50000] Max port for tunnel
|
|
457
|
+
--min-port=<value> [default: 40000] Min port for tunnel
|
|
458
|
+
--rules-path=<value> Rules path
|
|
459
|
+
--settings-path=<value> Settings path
|
|
460
|
+
--test-case-uuid=<value>... Test case uuid (can be repeated). Requires --url (web) or --file-path (mobile app
|
|
461
|
+
upload).
|
|
462
|
+
--test-cases-path=<value> Test cases files
|
|
463
|
+
--url=<value> The url
|
|
464
|
+
--variables-path=<value> Variables path
|
|
465
|
+
--xray-execution-key=<value> Reuse an existing Xray Cloud Test Execution by key (e.g. XR-123) instead of creating
|
|
466
|
+
a new one. Optional; leave blank to create a new execution.
|
|
467
|
+
|
|
468
|
+
GLOBAL FLAGS
|
|
469
|
+
-t, --token=<value> Suite authentication token
|
|
470
|
+
--auth-token=<value> Personal authentication token
|
|
471
|
+
--verbose Verbose output
|
|
472
|
+
|
|
473
|
+
DESCRIPTION
|
|
474
|
+
Run all tests of a Test Suite
|
|
475
|
+
```
|
|
476
|
+
|
|
477
|
+
_See code: [src/commands/test-suite/run.ts](https://github.com/TestRigor/testrigor-cli/blob/v1.0.1/src/commands/test-suite/run.ts)_
|
|
478
|
+
|
|
479
|
+
## `testrigor test-suite validate-syntax [TESTSUITEID]`
|
|
480
|
+
|
|
481
|
+
Validate step syntax against a test suite's reusable rules, without running the steps
|
|
482
|
+
|
|
483
|
+
```
|
|
484
|
+
USAGE
|
|
485
|
+
$ testrigor test-suite validate-syntax [TESTSUITEID] [--auth-token <value>] [-t <value>] [--min-port <value>] [--max-port
|
|
486
|
+
<value>] [--verbose] [--steps <value> | --test-cases-path <value>] [--base-url-api <value>] [--rules-path <value>]
|
|
487
|
+
[--explicit-mutations]
|
|
488
|
+
|
|
489
|
+
ARGUMENTS
|
|
490
|
+
TESTSUITEID The test suite id (optional if set in config)
|
|
491
|
+
|
|
492
|
+
FLAGS
|
|
493
|
+
--base-url-api=<value> Base URL for API2 (e.g., https://api2.testrigor.com)
|
|
494
|
+
--explicit-mutations Validate using only the supplied rules instead of merging them with the suite's saved rules
|
|
495
|
+
--max-port=<value> [default: 50000] Max port for tunnel
|
|
496
|
+
--min-port=<value> [default: 40000] Min port for tunnel
|
|
497
|
+
--rules-path=<value> Ad hoc reusable rules to validate against, for rules not yet saved to this suite (same glob
|
|
498
|
+
format as `test-suite run --rules-path`)
|
|
499
|
+
--steps=<value> Raw step text to validate directly
|
|
500
|
+
--test-cases-path=<value> Test case files to validate (same glob format as `test-suite run --test-cases-path`)
|
|
501
|
+
|
|
502
|
+
GLOBAL FLAGS
|
|
503
|
+
-t, --token=<value> Suite authentication token
|
|
504
|
+
--auth-token=<value> Personal authentication token
|
|
505
|
+
--verbose Verbose output
|
|
506
|
+
|
|
507
|
+
DESCRIPTION
|
|
508
|
+
Validate step syntax against a test suite's reusable rules, without running the steps
|
|
509
|
+
|
|
510
|
+
EXAMPLES
|
|
511
|
+
$ testrigor test-suite validate-syntax <test-suite-id> --steps "click \"Login\""
|
|
512
|
+
|
|
513
|
+
$ testrigor test-suite validate-syntax <test-suite-id> --test-cases-path "test_cases/**/*.{yaml,txt}"
|
|
514
|
+
```
|
|
515
|
+
|
|
516
|
+
_See code: [src/commands/test-suite/validate-syntax.ts](https://github.com/TestRigor/testrigor-cli/blob/v1.0.1/src/commands/test-suite/validate-syntax.ts)_
|
|
517
|
+
<!-- commandsstop -->`, so this README currently stays unchanged.
|
|
518
|
+
3. Check that the diff only touches the version fields, then build and test from the lockfile:
|
|
519
|
+
|
|
520
|
+
```
|
|
521
|
+
git diff package.json package-lock.json
|
|
522
|
+
npm ci && npm run build && npm test
|
|
523
|
+
```
|
|
524
|
+
|
|
525
|
+
4. Commit (e.g. `Updating to version 1.0.1 #TR-XXXX`), open a PR and merge it to `master`.
|
|
526
|
+
|
|
527
|
+
If the version was edited by hand anyway, run `npm install --package-lock-only` to bring `package-lock.json` back in sync. CI installs with `npm ci`, which fails when `package.json` and `package-lock.json` don't match, so commit the lockfile along with any dependency change.
|
|
@@ -49,7 +49,6 @@ class Authenticate extends core_2.Command {
|
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
|
-
exports.default = Authenticate;
|
|
53
52
|
Authenticate.description = "Set your testRigor authentication token";
|
|
54
53
|
Authenticate.examples = [
|
|
55
54
|
"testrigor authenticate",
|
|
@@ -57,3 +56,4 @@ Authenticate.examples = [
|
|
|
57
56
|
"Use 'testrigor test-suite config' to set default test suite ID separately",
|
|
58
57
|
"Config will be stored in ~/.testrigor/testrigor.yml",
|
|
59
58
|
];
|
|
59
|
+
exports.default = Authenticate;
|
|
@@ -74,7 +74,6 @@ class Config extends core_1.Command {
|
|
|
74
74
|
}
|
|
75
75
|
}
|
|
76
76
|
}
|
|
77
|
-
exports.default = Config;
|
|
78
77
|
Config.description = "Configure test suite settings and default test suite ID";
|
|
79
78
|
Config.examples = [
|
|
80
79
|
"testrigor test-suite config --default TEST-SUITE-ID",
|
|
@@ -95,3 +94,4 @@ Config.flags = {
|
|
|
95
94
|
exclusive: getExclusiveFlags("show"),
|
|
96
95
|
}),
|
|
97
96
|
};
|
|
97
|
+
exports.default = Config;
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
3
4
|
const core_1 = require("@oclif/core");
|
|
4
|
-
const
|
|
5
|
-
const
|
|
5
|
+
const fs_1 = tslib_1.__importDefault(require("@supercharge/fs"));
|
|
6
|
+
const form_data_1 = tslib_1.__importDefault(require("form-data"));
|
|
6
7
|
const listr2_1 = require("listr2");
|
|
7
|
-
const node_fetch_commonjs_1 = require("node-fetch-commonjs");
|
|
8
|
+
const node_fetch_commonjs_1 = tslib_1.__importDefault(require("node-fetch-commonjs"));
|
|
8
9
|
const command_base_1 = require("../../command-base");
|
|
9
10
|
const environments_1 = require("../../config/environments");
|
|
10
11
|
const chrome_extension_1 = require("../../flags/chrome-extension");
|
|
11
12
|
const parser_1 = require("../../util/parser");
|
|
12
13
|
const request_builder_1 = require("../../util/request-builder");
|
|
13
|
-
const tunnel_1 = require("../../util/tunnel");
|
|
14
|
+
const tunnel_1 = tslib_1.__importDefault(require("../../util/tunnel"));
|
|
14
15
|
const certificate_uploader_1 = require("../../util/certificate-uploader");
|
|
15
16
|
const variable_file_uploader_1 = require("../../util/variable-file-uploader");
|
|
16
17
|
const variables_path_parser_1 = require("../../util/variables-path-parser");
|
|
@@ -120,7 +121,7 @@ class Run extends command_base_1.CommandBase {
|
|
|
120
121
|
}
|
|
121
122
|
if (variablesPath) {
|
|
122
123
|
try {
|
|
123
|
-
const file = await
|
|
124
|
+
const file = await fs_1.default.content(variablesPath);
|
|
124
125
|
const parsed = JSON.parse(file.toString());
|
|
125
126
|
const { textValues, fileInputs, certInputs } = (0, variables_path_parser_1.parseVariablesJson)(parsed);
|
|
126
127
|
context.configuration.storedValues = textValues;
|
|
@@ -147,7 +148,7 @@ class Run extends command_base_1.CommandBase {
|
|
|
147
148
|
context.configuration.baselineMutations = testCases;
|
|
148
149
|
}
|
|
149
150
|
}
|
|
150
|
-
catch
|
|
151
|
+
catch {
|
|
151
152
|
core_1.ux.error("--test-cases-path must be a valid JSON path");
|
|
152
153
|
}
|
|
153
154
|
}
|
|
@@ -158,7 +159,7 @@ class Run extends command_base_1.CommandBase {
|
|
|
158
159
|
context.configuration.ruleMutations = rules;
|
|
159
160
|
}
|
|
160
161
|
}
|
|
161
|
-
catch
|
|
162
|
+
catch {
|
|
162
163
|
core_1.ux.error("--rules-path must be a valid JSON path");
|
|
163
164
|
}
|
|
164
165
|
}
|
|
@@ -169,7 +170,7 @@ class Run extends command_base_1.CommandBase {
|
|
|
169
170
|
context.configuration.settings = settings;
|
|
170
171
|
}
|
|
171
172
|
}
|
|
172
|
-
catch
|
|
173
|
+
catch {
|
|
173
174
|
core_1.ux.error("--settings-path must be a valid JSON/YAML path");
|
|
174
175
|
}
|
|
175
176
|
}
|
|
@@ -187,7 +188,7 @@ class Run extends command_base_1.CommandBase {
|
|
|
187
188
|
Object.assign(context.configuration, localTestNodes);
|
|
188
189
|
}
|
|
189
190
|
}
|
|
190
|
-
catch
|
|
191
|
+
catch {
|
|
191
192
|
core_1.ux.error("--local-test-nodes-path must be a valid JSON/YAML path");
|
|
192
193
|
}
|
|
193
194
|
}
|
|
@@ -197,12 +198,12 @@ class Run extends command_base_1.CommandBase {
|
|
|
197
198
|
delete flags["file-path"];
|
|
198
199
|
}
|
|
199
200
|
else {
|
|
200
|
-
const fileExists = await
|
|
201
|
+
const fileExists = await fs_1.default.isFile(filePath);
|
|
201
202
|
if (!fileExists || !(0, utils_1.isValidFileExtensionToUpload)(filePath)) {
|
|
202
203
|
core_1.ux.error("--file-path must be one of the valid format types: [zip, exe, msi, apk, aab, ipa, app]");
|
|
203
204
|
}
|
|
204
|
-
const fileName =
|
|
205
|
-
const fileSize =
|
|
205
|
+
const fileName = fs_1.default.basename(filePath);
|
|
206
|
+
const fileSize = fs_1.default.statSync(filePath).size;
|
|
206
207
|
context.fileProperties = { fileName, fileSize };
|
|
207
208
|
}
|
|
208
209
|
}
|
|
@@ -421,8 +422,8 @@ class Run extends command_base_1.CommandBase {
|
|
|
421
422
|
}
|
|
422
423
|
const configuration = ctx.configuration;
|
|
423
424
|
const filePath = flags["file-path"];
|
|
424
|
-
const form = new
|
|
425
|
-
form.append("file",
|
|
425
|
+
const form = new form_data_1.default();
|
|
426
|
+
form.append("file", fs_1.default.createReadStream(filePath));
|
|
426
427
|
form.append("data", JSON.stringify(configuration));
|
|
427
428
|
const response = await (0, node_fetch_commonjs_1.default)(`${this.TESTRIGOR_API2_URL}/apps/${testSuiteId}/retest`, {
|
|
428
429
|
method: "POST",
|
|
@@ -707,7 +708,7 @@ class Run extends command_base_1.CommandBase {
|
|
|
707
708
|
throw new Error(`Failed to prepare upload: ${preSignedUrlResponse.message}`);
|
|
708
709
|
}
|
|
709
710
|
const preSignedUrlData = preSignedUrlResponse.data;
|
|
710
|
-
const fileToBeUploaded =
|
|
711
|
+
const fileToBeUploaded = fs_1.default.createReadStream(filePath);
|
|
711
712
|
const uploadFileResponse = await (0, node_fetch_commonjs_1.default)(preSignedUrlData.url, {
|
|
712
713
|
method: "PUT",
|
|
713
714
|
body: fileToBeUploaded,
|
|
@@ -823,7 +824,7 @@ class Run extends command_base_1.CommandBase {
|
|
|
823
824
|
throw new Error(`Unexpected contentType of junit report: ${contentType}`);
|
|
824
825
|
}
|
|
825
826
|
const xmlData = await response.text();
|
|
826
|
-
await
|
|
827
|
+
await fs_1.default.writeFile(savePath, xmlData);
|
|
827
828
|
task.title = JUNIT_REPORT_STATUS.READY;
|
|
828
829
|
return;
|
|
829
830
|
}
|
|
@@ -839,7 +840,6 @@ class Run extends command_base_1.CommandBase {
|
|
|
839
840
|
}
|
|
840
841
|
}
|
|
841
842
|
}
|
|
842
|
-
exports.default = Run;
|
|
843
843
|
Run.description = "Run all tests of a Test Suite";
|
|
844
844
|
Run.examples = [];
|
|
845
845
|
Run.flags = {
|
|
@@ -928,3 +928,4 @@ Run.args = {
|
|
|
928
928
|
required: false,
|
|
929
929
|
}),
|
|
930
930
|
};
|
|
931
|
+
exports.default = Run;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { CommandBase } from "../../command-base";
|
|
2
|
+
export default class ValidateSyntax extends CommandBase<typeof ValidateSyntax> {
|
|
3
|
+
static description: string;
|
|
4
|
+
static examples: string[];
|
|
5
|
+
private TESTRIGOR_API2_URL;
|
|
6
|
+
static flags: {
|
|
7
|
+
steps: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
8
|
+
"test-cases-path": import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
9
|
+
"base-url-api": import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
10
|
+
"rules-path": import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
11
|
+
"explicit-mutations": import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
12
|
+
};
|
|
13
|
+
static args: {
|
|
14
|
+
testSuiteId: import("@oclif/core/lib/interfaces/parser").Arg<string | undefined, Record<string, unknown>>;
|
|
15
|
+
};
|
|
16
|
+
run(): Promise<void>;
|
|
17
|
+
private resolveStepsToValidate;
|
|
18
|
+
private reportValidationResults;
|
|
19
|
+
private callValidateSyntax;
|
|
20
|
+
}
|