@autifyhq/autify-cli 0.3.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/LICENSE +21 -0
- package/README.md +512 -0
- package/bin/dev +22 -0
- package/bin/dev.cmd +3 -0
- package/bin/run +10 -0
- package/bin/run.cmd +3 -0
- package/dist/autify/web/getTestResultUrl.d.ts +1 -0
- package/dist/autify/web/getTestResultUrl.js +16 -0
- package/dist/autify/web/parseTestResultUrl.d.ts +4 -0
- package/dist/autify/web/parseTestResultUrl.js +17 -0
- package/dist/autify/web/runTest.d.ts +14 -0
- package/dist/autify/web/runTest.js +97 -0
- package/dist/autify/web/waitTestResult.d.ts +8 -0
- package/dist/autify/web/waitTestResult.js +71 -0
- package/dist/commands/mobile/api/run-test-plan.d.ts +10 -0
- package/dist/commands/mobile/api/run-test-plan.js +29 -0
- package/dist/commands/mobile/api/upload-build.d.ts +10 -0
- package/dist/commands/mobile/api/upload-build.js +26 -0
- package/dist/commands/mobile/auth/login.d.ts +7 -0
- package/dist/commands/mobile/auth/login.js +30 -0
- package/dist/commands/web/api/create-url-replacement.d.ts +10 -0
- package/dist/commands/web/api/create-url-replacement.js +29 -0
- package/dist/commands/web/api/delete-url-replacement.d.ts +10 -0
- package/dist/commands/web/api/delete-url-replacement.js +29 -0
- package/dist/commands/web/api/describe-result.d.ts +10 -0
- package/dist/commands/web/api/describe-result.js +29 -0
- package/dist/commands/web/api/describe-scenario.d.ts +10 -0
- package/dist/commands/web/api/describe-scenario.js +29 -0
- package/dist/commands/web/api/execute-scenarios.d.ts +10 -0
- package/dist/commands/web/api/execute-scenarios.js +29 -0
- package/dist/commands/web/api/execute-schedule.d.ts +9 -0
- package/dist/commands/web/api/execute-schedule.js +25 -0
- package/dist/commands/web/api/list-capabilities.d.ts +12 -0
- package/dist/commands/web/api/list-capabilities.js +34 -0
- package/dist/commands/web/api/list-results.d.ts +12 -0
- package/dist/commands/web/api/list-results.js +37 -0
- package/dist/commands/web/api/list-scenarios.d.ts +10 -0
- package/dist/commands/web/api/list-scenarios.js +29 -0
- package/dist/commands/web/api/list-url-replacements.d.ts +9 -0
- package/dist/commands/web/api/list-url-replacements.js +25 -0
- package/dist/commands/web/api/update-url-replacement.d.ts +11 -0
- package/dist/commands/web/api/update-url-replacement.js +33 -0
- package/dist/commands/web/auth/login.d.ts +7 -0
- package/dist/commands/web/auth/login.js +30 -0
- package/dist/commands/web/test/run.d.ts +23 -0
- package/dist/commands/web/test/run.js +114 -0
- package/dist/commands/web/test/wait.d.ts +15 -0
- package/dist/commands/web/test/wait.js +54 -0
- package/dist/config.d.ts +5 -0
- package/dist/config.js +38 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +5 -0
- package/oclif.manifest.json +1 -0
- package/package.json +141 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2022 Autify Inc.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,512 @@
|
|
|
1
|
+
# Autify Command Line Interface (CLI)
|
|
2
|
+
|
|
3
|
+
Autify CLI can help your integration with Autify!
|
|
4
|
+
|
|
5
|
+
[](https://oclif.io)
|
|
6
|
+
|
|
7
|
+
<!-- toc -->
|
|
8
|
+
* [Autify Command Line Interface (CLI)](#autify-command-line-interface-cli)
|
|
9
|
+
* [Usage](#usage)
|
|
10
|
+
* [Commands](#commands)
|
|
11
|
+
<!-- tocstop -->
|
|
12
|
+
|
|
13
|
+
# Usage
|
|
14
|
+
|
|
15
|
+
Note: `npm install` is not available yet. We'll work on publishing to npm.
|
|
16
|
+
|
|
17
|
+
<!-- usage -->
|
|
18
|
+
```sh-session
|
|
19
|
+
$ npm install -g @autifyhq/autify-cli
|
|
20
|
+
$ autify COMMAND
|
|
21
|
+
running command...
|
|
22
|
+
$ autify (--version)
|
|
23
|
+
@autifyhq/autify-cli/0.3.1 linux-x64 node-v16.15.1
|
|
24
|
+
$ autify --help [COMMAND]
|
|
25
|
+
USAGE
|
|
26
|
+
$ autify COMMAND
|
|
27
|
+
...
|
|
28
|
+
```
|
|
29
|
+
<!-- usagestop -->
|
|
30
|
+
|
|
31
|
+
## Download Prebuilt package
|
|
32
|
+
|
|
33
|
+
We provide prebuilt packages in the forms below (Node.js runtime is included):
|
|
34
|
+
|
|
35
|
+
| OS | Architecture | Package type | Download Link | Note |
|
|
36
|
+
| :------ | :----------- | :----------- | :--------------------------------------------------------------------------------------------------------------------- | :----------------------- |
|
|
37
|
+
| Linux | Intel 64bit | tar.gz | [`stable`](https://autify-cli-assets.s3.us-west-2.amazonaws.com/autify-cli/channels/stable/autify-linux-x64.tar.gz) |
|
|
38
|
+
| Linux | Intel 64bit | tar.xz | [`stable`](https://autify-cli-assets.s3.us-west-2.amazonaws.com/autify-cli/channels/stable/autify-linux-x64.tar.xz) |
|
|
39
|
+
| Linux | Arm 32bit | tar.gz | [`stable`](https://autify-cli-assets.s3.us-west-2.amazonaws.com/autify-cli/channels/stable/autify-linux-arm.tar.gz) |
|
|
40
|
+
| Linux | Arm 32bit | tar.xz | [`stable`](https://autify-cli-assets.s3.us-west-2.amazonaws.com/autify-cli/channels/stable/autify-linux-arm.tar.xz) |
|
|
41
|
+
| macOS | Intel 64bit | tar.gz | [`stable`](https://autify-cli-assets.s3.us-west-2.amazonaws.com/autify-cli/channels/stable/autify-darwin-x64.tar.gz) |
|
|
42
|
+
| macOS | Intel 64bit | tar.xz | [`stable`](https://autify-cli-assets.s3.us-west-2.amazonaws.com/autify-cli/channels/stable/autify-darwin-x64.tar.xz) |
|
|
43
|
+
| macOS | Intel 64bit | Installer | [`stable`](https://autify-cli-assets.s3.us-west-2.amazonaws.com/autify-cli/channels/stable/autify-x64.pkg) | Not properly signed yet. |
|
|
44
|
+
| macOS | Arm 64bit | tar.gz | [`stable`](https://autify-cli-assets.s3.us-west-2.amazonaws.com/autify-cli/channels/stable/autify-darwin-arm64.tar.gz) |
|
|
45
|
+
| macOS | Arm 64bit | tar.xz | [`stable`](https://autify-cli-assets.s3.us-west-2.amazonaws.com/autify-cli/channels/stable/autify-darwin-arm64.tar.xz) |
|
|
46
|
+
| macOS | Arm 64bit | Installer | [`stable`](https://autify-cli-assets.s3.us-west-2.amazonaws.com/autify-cli/channels/stable/autify-arm64.pkg) | Not properly signed yet. |
|
|
47
|
+
| Windows | Intel 64bit | tar.gz | [`stable`](https://autify-cli-assets.s3.us-west-2.amazonaws.com/autify-cli/channels/stable/autify-win32-x64.tar.gz) |
|
|
48
|
+
| Windows | Intel 64bit | tar.xz | [`stable`](https://autify-cli-assets.s3.us-west-2.amazonaws.com/autify-cli/channels/stable/autify-win32-x64.tar.xz) |
|
|
49
|
+
| Windows | Intel 64bit | Installer | [`stable`](https://autify-cli-assets.s3.us-west-2.amazonaws.com/autify-cli/channels/stable/autify-x64.exe) | Not properly signed yet. |
|
|
50
|
+
| Windows | Intel 32bit | tar.gz | [`stable`](https://autify-cli-assets.s3.us-west-2.amazonaws.com/autify-cli/channels/stable/autify-win32-x86.tar.gz) |
|
|
51
|
+
| Windows | Intel 32bit | tar.xz | [`stable`](https://autify-cli-assets.s3.us-west-2.amazonaws.com/autify-cli/channels/stable/autify-win32-x86.tar.xz) |
|
|
52
|
+
| Windows | Intel 32bit | Installer | [`stable`](https://autify-cli-assets.s3.us-west-2.amazonaws.com/autify-cli/channels/stable/autify-x86.exe) | Not properly signed yet. |
|
|
53
|
+
|
|
54
|
+
After the installation, you can always get the latest update on `stable` channel automatically, or by running `autify update`.
|
|
55
|
+
|
|
56
|
+
# Commands
|
|
57
|
+
|
|
58
|
+
<!-- commands -->
|
|
59
|
+
* [`autify help [COMMAND]`](#autify-help-command)
|
|
60
|
+
* [`autify mobile api run-test-plan`](#autify-mobile-api-run-test-plan)
|
|
61
|
+
* [`autify mobile api upload-build`](#autify-mobile-api-upload-build)
|
|
62
|
+
* [`autify mobile auth login`](#autify-mobile-auth-login)
|
|
63
|
+
* [`autify update [CHANNEL]`](#autify-update-channel)
|
|
64
|
+
* [`autify web api create-url-replacement`](#autify-web-api-create-url-replacement)
|
|
65
|
+
* [`autify web api delete-url-replacement`](#autify-web-api-delete-url-replacement)
|
|
66
|
+
* [`autify web api describe-result`](#autify-web-api-describe-result)
|
|
67
|
+
* [`autify web api describe-scenario`](#autify-web-api-describe-scenario)
|
|
68
|
+
* [`autify web api execute-scenarios`](#autify-web-api-execute-scenarios)
|
|
69
|
+
* [`autify web api execute-schedule`](#autify-web-api-execute-schedule)
|
|
70
|
+
* [`autify web api list-capabilities`](#autify-web-api-list-capabilities)
|
|
71
|
+
* [`autify web api list-results`](#autify-web-api-list-results)
|
|
72
|
+
* [`autify web api list-scenarios`](#autify-web-api-list-scenarios)
|
|
73
|
+
* [`autify web api list-url-replacements`](#autify-web-api-list-url-replacements)
|
|
74
|
+
* [`autify web api update-url-replacement`](#autify-web-api-update-url-replacement)
|
|
75
|
+
* [`autify web auth login`](#autify-web-auth-login)
|
|
76
|
+
* [`autify web test run SCENARIO-OR-TEST-PLAN-URL`](#autify-web-test-run-scenario-or-test-plan-url)
|
|
77
|
+
* [`autify web test wait TEST-RESULT-URL`](#autify-web-test-wait-test-result-url)
|
|
78
|
+
|
|
79
|
+
## `autify help [COMMAND]`
|
|
80
|
+
|
|
81
|
+
Display help for autify.
|
|
82
|
+
|
|
83
|
+
```
|
|
84
|
+
USAGE
|
|
85
|
+
$ autify help [COMMAND] [-n]
|
|
86
|
+
|
|
87
|
+
ARGUMENTS
|
|
88
|
+
COMMAND Command to show help for.
|
|
89
|
+
|
|
90
|
+
FLAGS
|
|
91
|
+
-n, --nested-commands Include all nested commands in the output.
|
|
92
|
+
|
|
93
|
+
DESCRIPTION
|
|
94
|
+
Display help for autify.
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
_See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v5.1.12/src/commands/help.ts)_
|
|
98
|
+
|
|
99
|
+
## `autify mobile api run-test-plan`
|
|
100
|
+
|
|
101
|
+
Run a test plan
|
|
102
|
+
|
|
103
|
+
```
|
|
104
|
+
USAGE
|
|
105
|
+
$ autify mobile api run-test-plan --test-plan-id <value> --run-test-plan-request <value>
|
|
106
|
+
|
|
107
|
+
FLAGS
|
|
108
|
+
--run-test-plan-request=<value> (required) The build_id to execute the test plan.
|
|
109
|
+
--test-plan-id=<value> (required) The ID of the test plan to run.
|
|
110
|
+
|
|
111
|
+
DESCRIPTION
|
|
112
|
+
Run a test plan
|
|
113
|
+
|
|
114
|
+
EXAMPLES
|
|
115
|
+
$ autify mobile api run-test-plan
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
## `autify mobile api upload-build`
|
|
119
|
+
|
|
120
|
+
Upload the build file.
|
|
121
|
+
|
|
122
|
+
```
|
|
123
|
+
USAGE
|
|
124
|
+
$ autify mobile api upload-build --project-id <value> --file <value>
|
|
125
|
+
|
|
126
|
+
FLAGS
|
|
127
|
+
--file=<value> (required) Build file.
|
|
128
|
+
--project-id=<value> (required) The ID of the project to upload the build file to.
|
|
129
|
+
|
|
130
|
+
DESCRIPTION
|
|
131
|
+
Upload the build file.
|
|
132
|
+
|
|
133
|
+
EXAMPLES
|
|
134
|
+
$ autify mobile api upload-build
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
## `autify mobile auth login`
|
|
138
|
+
|
|
139
|
+
Login to Autify for Mobile
|
|
140
|
+
|
|
141
|
+
```
|
|
142
|
+
USAGE
|
|
143
|
+
$ autify mobile auth login
|
|
144
|
+
|
|
145
|
+
DESCRIPTION
|
|
146
|
+
Login to Autify for Mobile
|
|
147
|
+
|
|
148
|
+
EXAMPLES
|
|
149
|
+
Start interactive setup:
|
|
150
|
+
|
|
151
|
+
$ autify mobile auth login
|
|
152
|
+
|
|
153
|
+
Reading the token from file:
|
|
154
|
+
|
|
155
|
+
$ autify mobile auth login < token.txt
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
## `autify update [CHANNEL]`
|
|
159
|
+
|
|
160
|
+
update the autify CLI
|
|
161
|
+
|
|
162
|
+
```
|
|
163
|
+
USAGE
|
|
164
|
+
$ autify update [CHANNEL] [-a] [-v <value> | -i] [--force]
|
|
165
|
+
|
|
166
|
+
FLAGS
|
|
167
|
+
-a, --available Install a specific version.
|
|
168
|
+
-i, --interactive Interactively select version to install. This is ignored if a channel is provided.
|
|
169
|
+
-v, --version=<value> Install a specific version.
|
|
170
|
+
--force Force a re-download of the requested version.
|
|
171
|
+
|
|
172
|
+
DESCRIPTION
|
|
173
|
+
update the autify CLI
|
|
174
|
+
|
|
175
|
+
EXAMPLES
|
|
176
|
+
Update to the stable channel:
|
|
177
|
+
|
|
178
|
+
$ autify update stable
|
|
179
|
+
|
|
180
|
+
Update to a specific version:
|
|
181
|
+
|
|
182
|
+
$ autify update --version 1.0.0
|
|
183
|
+
|
|
184
|
+
Interactively select version:
|
|
185
|
+
|
|
186
|
+
$ autify update --interactive
|
|
187
|
+
|
|
188
|
+
See available versions:
|
|
189
|
+
|
|
190
|
+
$ autify update --available
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
_See code: [@oclif/plugin-update](https://github.com/oclif/plugin-update/blob/v3.0.0/src/commands/update.ts)_
|
|
194
|
+
|
|
195
|
+
## `autify web api create-url-replacement`
|
|
196
|
+
|
|
197
|
+
Create a new url replacement for the test plan
|
|
198
|
+
|
|
199
|
+
```
|
|
200
|
+
USAGE
|
|
201
|
+
$ autify web api create-url-replacement --test-plan-id <value> --create-url-replacement-request <value>
|
|
202
|
+
|
|
203
|
+
FLAGS
|
|
204
|
+
--create-url-replacement-request=<value> (required) The url to replace
|
|
205
|
+
--test-plan-id=<value> (required) For example, 15 for the following URL:
|
|
206
|
+
https://app.autify.com/projects/1/test_plans/15
|
|
207
|
+
|
|
208
|
+
DESCRIPTION
|
|
209
|
+
Create a new url replacement for the test plan
|
|
210
|
+
|
|
211
|
+
EXAMPLES
|
|
212
|
+
$ autify web api create-url-replacement
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
## `autify web api delete-url-replacement`
|
|
216
|
+
|
|
217
|
+
Delete a url replacement for the test plan
|
|
218
|
+
|
|
219
|
+
```
|
|
220
|
+
USAGE
|
|
221
|
+
$ autify web api delete-url-replacement --test-plan-id <value> --url-replacement-id <value>
|
|
222
|
+
|
|
223
|
+
FLAGS
|
|
224
|
+
--test-plan-id=<value> (required) For example, 15 for the following URL:
|
|
225
|
+
https://app.autify.com/projects/1/test_plans/15
|
|
226
|
+
--url-replacement-id=<value> (required) url_replacement id
|
|
227
|
+
|
|
228
|
+
DESCRIPTION
|
|
229
|
+
Delete a url replacement for the test plan
|
|
230
|
+
|
|
231
|
+
EXAMPLES
|
|
232
|
+
$ autify web api delete-url-replacement
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
## `autify web api describe-result`
|
|
236
|
+
|
|
237
|
+
Get a result.
|
|
238
|
+
|
|
239
|
+
```
|
|
240
|
+
USAGE
|
|
241
|
+
$ autify web api describe-result --project-id <value> --result-id <value>
|
|
242
|
+
|
|
243
|
+
FLAGS
|
|
244
|
+
--project-id=<value> (required) For example, 1 for the following URL: https://app.autify.com/projects/1/results/4
|
|
245
|
+
--result-id=<value> (required) For example, 4 for the following URL: https://app.autify.com/projects/1/results/4
|
|
246
|
+
|
|
247
|
+
DESCRIPTION
|
|
248
|
+
Get a result.
|
|
249
|
+
|
|
250
|
+
EXAMPLES
|
|
251
|
+
$ autify web api describe-result
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
## `autify web api describe-scenario`
|
|
255
|
+
|
|
256
|
+
Get a scenario.
|
|
257
|
+
|
|
258
|
+
```
|
|
259
|
+
USAGE
|
|
260
|
+
$ autify web api describe-scenario --project-id <value> --scenario-id <value>
|
|
261
|
+
|
|
262
|
+
FLAGS
|
|
263
|
+
--project-id=<value> (required) For example, 1 for the following URL: https://app.autify.com/projects/1/scenarios/2
|
|
264
|
+
--scenario-id=<value> (required) For example, 2 for the following URL: https://app.autify.com/projects/1/scenarios/2
|
|
265
|
+
|
|
266
|
+
DESCRIPTION
|
|
267
|
+
Get a scenario.
|
|
268
|
+
|
|
269
|
+
EXAMPLES
|
|
270
|
+
$ autify web api describe-scenario
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
## `autify web api execute-scenarios`
|
|
274
|
+
|
|
275
|
+
You can execute any scenarios in your workspace using any execution environments (which is called "capabilities" here).
|
|
276
|
+
|
|
277
|
+
```
|
|
278
|
+
USAGE
|
|
279
|
+
$ autify web api execute-scenarios --project-id <value> --execute-scenarios-request <value>
|
|
280
|
+
|
|
281
|
+
FLAGS
|
|
282
|
+
--execute-scenarios-request=<value> (required) The scenarios and settings to execute
|
|
283
|
+
--project-id=<value> (required) For example, 1 for the following URL:
|
|
284
|
+
https://app.autify.com/projects/1/scenarios
|
|
285
|
+
|
|
286
|
+
DESCRIPTION
|
|
287
|
+
You can execute any scenarios in your workspace using any execution environments (which is called "capabilities"
|
|
288
|
+
here).
|
|
289
|
+
|
|
290
|
+
EXAMPLES
|
|
291
|
+
$ autify web api execute-scenarios
|
|
292
|
+
```
|
|
293
|
+
|
|
294
|
+
## `autify web api execute-schedule`
|
|
295
|
+
|
|
296
|
+
Run a test plan. (Note: "Schedule" is called as "TestPlan" now.)
|
|
297
|
+
|
|
298
|
+
```
|
|
299
|
+
USAGE
|
|
300
|
+
$ autify web api execute-schedule --schedule-id <value>
|
|
301
|
+
|
|
302
|
+
FLAGS
|
|
303
|
+
--schedule-id=<value> (required) For example, 3 for the following URL: https://app.autify.com/projects/1/test_plans/3
|
|
304
|
+
|
|
305
|
+
DESCRIPTION
|
|
306
|
+
Run a test plan. (Note: "Schedule" is called as "TestPlan" now.)
|
|
307
|
+
|
|
308
|
+
EXAMPLES
|
|
309
|
+
$ autify web api execute-schedule
|
|
310
|
+
```
|
|
311
|
+
|
|
312
|
+
## `autify web api list-capabilities`
|
|
313
|
+
|
|
314
|
+
List available Capabilities.
|
|
315
|
+
|
|
316
|
+
```
|
|
317
|
+
USAGE
|
|
318
|
+
$ autify web api list-capabilities --project-id <value> [--os <value>] [--browser <value>] [--device-type <value>]
|
|
319
|
+
|
|
320
|
+
FLAGS
|
|
321
|
+
--browser=<value> browser name to filter
|
|
322
|
+
--device-type=<value> device_type name to filter
|
|
323
|
+
--os=<value> os name to filter
|
|
324
|
+
--project-id=<value> (required) For example, 1 for the following URL: https://app.autify.com/projects/1/capabilities
|
|
325
|
+
|
|
326
|
+
DESCRIPTION
|
|
327
|
+
List available Capabilities.
|
|
328
|
+
|
|
329
|
+
EXAMPLES
|
|
330
|
+
$ autify web api list-capabilities
|
|
331
|
+
```
|
|
332
|
+
|
|
333
|
+
## `autify web api list-results`
|
|
334
|
+
|
|
335
|
+
List results.
|
|
336
|
+
|
|
337
|
+
```
|
|
338
|
+
USAGE
|
|
339
|
+
$ autify web api list-results --project-id <value> [--page <value>] [--per-page <value>] [--test-plan-id <value>]
|
|
340
|
+
|
|
341
|
+
FLAGS
|
|
342
|
+
--page=<value> The number of page returns.
|
|
343
|
+
--per-page=<value> The number of items returns. Default number is 30 and up to a maximum of 100
|
|
344
|
+
--project-id=<value> (required) For example, 1 for the following URL: https://app.autify.com/projects/1/results
|
|
345
|
+
--test-plan-id=<value> Test plan ID used to filter results.
|
|
346
|
+
|
|
347
|
+
DESCRIPTION
|
|
348
|
+
List results.
|
|
349
|
+
|
|
350
|
+
EXAMPLES
|
|
351
|
+
$ autify web api list-results
|
|
352
|
+
```
|
|
353
|
+
|
|
354
|
+
## `autify web api list-scenarios`
|
|
355
|
+
|
|
356
|
+
List scenarios.
|
|
357
|
+
|
|
358
|
+
```
|
|
359
|
+
USAGE
|
|
360
|
+
$ autify web api list-scenarios --project-id <value> [--page <value>]
|
|
361
|
+
|
|
362
|
+
FLAGS
|
|
363
|
+
--page=<value> The number of page returns.
|
|
364
|
+
--project-id=<value> (required) For example, 1 for the following URL: https://app.autify.com/projects/1/scenarios
|
|
365
|
+
|
|
366
|
+
DESCRIPTION
|
|
367
|
+
List scenarios.
|
|
368
|
+
|
|
369
|
+
EXAMPLES
|
|
370
|
+
$ autify web api list-scenarios
|
|
371
|
+
```
|
|
372
|
+
|
|
373
|
+
## `autify web api list-url-replacements`
|
|
374
|
+
|
|
375
|
+
List url replacements for the test plan
|
|
376
|
+
|
|
377
|
+
```
|
|
378
|
+
USAGE
|
|
379
|
+
$ autify web api list-url-replacements --test-plan-id <value>
|
|
380
|
+
|
|
381
|
+
FLAGS
|
|
382
|
+
--test-plan-id=<value> (required) For example, 15 for the following URL:
|
|
383
|
+
https://app.autify.com/projects/1/test_plans/15
|
|
384
|
+
|
|
385
|
+
DESCRIPTION
|
|
386
|
+
List url replacements for the test plan
|
|
387
|
+
|
|
388
|
+
EXAMPLES
|
|
389
|
+
$ autify web api list-url-replacements
|
|
390
|
+
```
|
|
391
|
+
|
|
392
|
+
## `autify web api update-url-replacement`
|
|
393
|
+
|
|
394
|
+
Update a url replacement for the test plan
|
|
395
|
+
|
|
396
|
+
```
|
|
397
|
+
USAGE
|
|
398
|
+
$ autify web api update-url-replacement --test-plan-id <value> --url-replacement-id <value> --update-url-replacement-request
|
|
399
|
+
<value>
|
|
400
|
+
|
|
401
|
+
FLAGS
|
|
402
|
+
--test-plan-id=<value> (required) For example, 15 for the following URL:
|
|
403
|
+
https://app.autify.com/projects/1/test_plans/15
|
|
404
|
+
--update-url-replacement-request=<value> (required) The url to replace. Either pattern_url or replacement_url is
|
|
405
|
+
required.
|
|
406
|
+
--url-replacement-id=<value> (required) url_replacement id
|
|
407
|
+
|
|
408
|
+
DESCRIPTION
|
|
409
|
+
Update a url replacement for the test plan
|
|
410
|
+
|
|
411
|
+
EXAMPLES
|
|
412
|
+
$ autify web api update-url-replacement
|
|
413
|
+
```
|
|
414
|
+
|
|
415
|
+
## `autify web auth login`
|
|
416
|
+
|
|
417
|
+
Login to Autify for Web
|
|
418
|
+
|
|
419
|
+
```
|
|
420
|
+
USAGE
|
|
421
|
+
$ autify web auth login
|
|
422
|
+
|
|
423
|
+
DESCRIPTION
|
|
424
|
+
Login to Autify for Web
|
|
425
|
+
|
|
426
|
+
EXAMPLES
|
|
427
|
+
Start interactive setup:
|
|
428
|
+
|
|
429
|
+
$ autify web auth login
|
|
430
|
+
|
|
431
|
+
Reading the token from file:
|
|
432
|
+
|
|
433
|
+
$ autify web auth login < token.txt
|
|
434
|
+
```
|
|
435
|
+
|
|
436
|
+
## `autify web test run SCENARIO-OR-TEST-PLAN-URL`
|
|
437
|
+
|
|
438
|
+
Run a scenario or test plan.
|
|
439
|
+
|
|
440
|
+
```
|
|
441
|
+
USAGE
|
|
442
|
+
$ autify web test run [SCENARIO-OR-TEST-PLAN-URL] [-n <value>] [-r <value>] [--os <value>] [--os-version
|
|
443
|
+
<value>] [--browser <value>] [--device <value>] [--device-type <value>] [-w] [-t <value>] [-v]
|
|
444
|
+
|
|
445
|
+
ARGUMENTS
|
|
446
|
+
SCENARIO-OR-TEST-PLAN-URL Scenario URL or Test plan URL e.g.
|
|
447
|
+
https://app.autify.com/projects/<ID>/(scenarios|test_plans)/<ID>
|
|
448
|
+
|
|
449
|
+
FLAGS
|
|
450
|
+
-n, --name=<value> Name of the test execution. (Only for test scenario execution.)
|
|
451
|
+
-r, --url-replacements=<value>... URL replacements. Example: http://example.com=http://example.net
|
|
452
|
+
-t, --timeout=<value> [default: 300] Timeout seconds when waiting for the finish of the test execution.
|
|
453
|
+
-v, --verbose Verbose output
|
|
454
|
+
-w, --wait Wait until the test finishes.
|
|
455
|
+
--browser=<value> Browser to run the test
|
|
456
|
+
--device=<value> Device to run the test
|
|
457
|
+
--device-type=<value> Device type to run the test
|
|
458
|
+
--os=<value> OS to run the test
|
|
459
|
+
--os-version=<value> OS version to run the test
|
|
460
|
+
|
|
461
|
+
DESCRIPTION
|
|
462
|
+
Run a scenario or test plan.
|
|
463
|
+
|
|
464
|
+
EXAMPLES
|
|
465
|
+
Run a test scenario (Default capability):
|
|
466
|
+
|
|
467
|
+
$ autify web test run https://app.autify.com/projects/0000/scenarios/0000
|
|
468
|
+
|
|
469
|
+
Run a test plan:
|
|
470
|
+
|
|
471
|
+
$ autify web test run https://app.autify.com/projects/0000/test_plans/0000
|
|
472
|
+
|
|
473
|
+
Run and wait a test scenario:
|
|
474
|
+
|
|
475
|
+
$ autify web test run https://app.autify.com/projects/0000/scenarios/0000 --wait --timeout 600
|
|
476
|
+
|
|
477
|
+
Run a test scenario with a specific capability:
|
|
478
|
+
|
|
479
|
+
$ autify web test run https://app.autify.com/projects/0000/scenarios/0000 --os "Windows Server" --browser Edge
|
|
480
|
+
|
|
481
|
+
With URL replacements:
|
|
482
|
+
|
|
483
|
+
$ autify web test run https://app.autify.com/projects/0000/scenarios/0000 -r \
|
|
484
|
+
http://example.com=http://example.net -r http://example.org=http://example.net
|
|
485
|
+
|
|
486
|
+
Run a test with specifying the execution name:
|
|
487
|
+
|
|
488
|
+
$ autify web test run https://app.autify.com/projects/0000/scenarios/0000 --name "Sample execution"
|
|
489
|
+
```
|
|
490
|
+
|
|
491
|
+
## `autify web test wait TEST-RESULT-URL`
|
|
492
|
+
|
|
493
|
+
Wait a test result until it finishes.
|
|
494
|
+
|
|
495
|
+
```
|
|
496
|
+
USAGE
|
|
497
|
+
$ autify web test wait [TEST-RESULT-URL] [-t <value>] [-v]
|
|
498
|
+
|
|
499
|
+
ARGUMENTS
|
|
500
|
+
TEST-RESULT-URL Test result URL e.g. https://app.autify.com/projects/<ID>/results/<ID>
|
|
501
|
+
|
|
502
|
+
FLAGS
|
|
503
|
+
-t, --timeout=<value> [default: 300] Timeout seconds when waiting for the finish of the test execution.
|
|
504
|
+
-v, --verbose Verbose output
|
|
505
|
+
|
|
506
|
+
DESCRIPTION
|
|
507
|
+
Wait a test result until it finishes.
|
|
508
|
+
|
|
509
|
+
EXAMPLES
|
|
510
|
+
$ autify web test wait https://app.autify.com/projects/0000/results/0000
|
|
511
|
+
```
|
|
512
|
+
<!-- commandsstop -->
|
package/bin/dev
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const oclif = require('@oclif/core')
|
|
4
|
+
|
|
5
|
+
const path = require('path')
|
|
6
|
+
const project = path.join(__dirname, '..', 'tsconfig.json')
|
|
7
|
+
|
|
8
|
+
// In dev mode -> use ts-node and dev plugins
|
|
9
|
+
process.env.NODE_ENV = 'development'
|
|
10
|
+
|
|
11
|
+
require('ts-node').register({project})
|
|
12
|
+
|
|
13
|
+
// In dev mode, always show stack traces
|
|
14
|
+
oclif.settings.debug = true;
|
|
15
|
+
|
|
16
|
+
// Start the CLI
|
|
17
|
+
oclif.run().then(oclif.flush).catch(error => {
|
|
18
|
+
const oclifHandler = oclif.Errors.handle
|
|
19
|
+
// Workaround until this PR is released https://github.com/axios/axios/pull/4624
|
|
20
|
+
if (error.response?.data) console.error(JSON.stringify(error.response?.data, null, 2))
|
|
21
|
+
return oclifHandler(error)
|
|
22
|
+
})
|
package/bin/dev.cmd
ADDED
package/bin/run
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const oclif = require('@oclif/core')
|
|
4
|
+
|
|
5
|
+
oclif.run().then(require('@oclif/core/flush')).catch(error => {
|
|
6
|
+
const oclifHandler = require('@oclif/core/handle')
|
|
7
|
+
// Workaround until this PR is released https://github.com/axios/axios/pull/4624
|
|
8
|
+
if (error.response?.data) console.error(JSON.stringify(error.response?.data, null, 2))
|
|
9
|
+
return oclifHandler(error)
|
|
10
|
+
})
|
package/bin/run.cmd
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getWebTestResultUrl: (configDir: string, workspaceId: number, resultId: number) => string;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getWebTestResultUrl = void 0;
|
|
4
|
+
/* eslint-disable unicorn/filename-case */
|
|
5
|
+
const autify_sdk_1 = require("@autifyhq/autify-sdk");
|
|
6
|
+
const config_1 = require("../../config");
|
|
7
|
+
const getWebTestResultUrl = (configDir, workspaceId, resultId) => {
|
|
8
|
+
var _a;
|
|
9
|
+
// Currently, it's heuristic. We could provide a new API or include the URL in the response of the existing APIs.
|
|
10
|
+
let basePath = (_a = (0, config_1.get)(configDir, "AUTIFY_WEB_BASE_PATH")) !== null && _a !== void 0 ? _a : autify_sdk_1.WEB_BASE_PATH;
|
|
11
|
+
if (basePath.startsWith("http://localhost:"))
|
|
12
|
+
basePath = autify_sdk_1.WEB_BASE_PATH; // Override if it's running integration tests.
|
|
13
|
+
const endpoint = basePath.slice(0, Math.max(0, basePath.indexOf("/api/v1"))); // Assuming the UI endpoint is the same as API endpoint.
|
|
14
|
+
return `${endpoint}/projects/${workspaceId}/results/${resultId}`;
|
|
15
|
+
};
|
|
16
|
+
exports.getWebTestResultUrl = getWebTestResultUrl;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parseTestResultUrl = void 0;
|
|
4
|
+
/* eslint-disable unicorn/filename-case */
|
|
5
|
+
const errors_1 = require("@oclif/errors");
|
|
6
|
+
const parseTestResultUrl = (url) => {
|
|
7
|
+
var _a, _b, _c, _d;
|
|
8
|
+
const { pathname } = new URL(url);
|
|
9
|
+
const testResultUrlPathRegExp = /\/projects\/(?<workspaceId>\d+)\/results\/(?<resultId>\d+)/;
|
|
10
|
+
const match = testResultUrlPathRegExp.exec(pathname);
|
|
11
|
+
const workspaceId = Number.parseInt((_b = (_a = match === null || match === void 0 ? void 0 : match.groups) === null || _a === void 0 ? void 0 : _a.workspaceId) !== null && _b !== void 0 ? _b : "", 10);
|
|
12
|
+
const resultId = Number.parseInt((_d = (_c = match === null || match === void 0 ? void 0 : match.groups) === null || _c === void 0 ? void 0 : _c.resultId) !== null && _d !== void 0 ? _d : "", 10);
|
|
13
|
+
if (!workspaceId || !resultId)
|
|
14
|
+
throw new errors_1.CLIError(`Invalid URL: ${url}`);
|
|
15
|
+
return { workspaceId, resultId };
|
|
16
|
+
};
|
|
17
|
+
exports.parseTestResultUrl = parseTestResultUrl;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { WebClient } from "@autifyhq/autify-sdk";
|
|
2
|
+
declare type CapabilityOption = Parameters<WebClient["executeScenarios"]>[1]["capabilities"][number];
|
|
3
|
+
declare type CreateUrlReplacementRequest = Parameters<WebClient["createUrlReplacement"]>[1];
|
|
4
|
+
declare type RunTestProps = Readonly<{
|
|
5
|
+
option: CapabilityOption;
|
|
6
|
+
name?: string;
|
|
7
|
+
urlReplacements: CreateUrlReplacementRequest[];
|
|
8
|
+
}>;
|
|
9
|
+
export declare const runTest: (client: WebClient, url: string, { option, name, urlReplacements }: RunTestProps) => Promise<{
|
|
10
|
+
workspaceId: number;
|
|
11
|
+
resultId: number;
|
|
12
|
+
capability: string;
|
|
13
|
+
}>;
|
|
14
|
+
export {};
|