Use CircleCI version 2.1 at the top of your .circleci/config.yml file.
1
version: 2.1
Add the orbs
stanza below your version, invoking the orb:
1
2
orbs:
autify-web: autify/autify-web@4.1.0
Use autify-web
elements in your existing workflows and jobs.
Opt-in to use of uncertified orbs on your organization’s Security settings page.
Run a test scenario or test plan.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
version: '2.1'
orbs:
autify-web: autify/autify-web@3
jobs:
test-run-by-command:
executor: autify-web/default
steps:
- autify-web/test-run:
autify-test-url: https://app.autify.com/projects/<ID>/(scenarios|test_plans)/<ID>
workflows:
test-run:
jobs:
- test-run-by-command
- autify-web/test-run:
autify-test-url: https://app.autify.com/projects/<ID>/(scenarios|test_plans)/<ID>
Run a test scenario or test plan.
PARAMETER | DESCRIPTION | REQUIRED | DEFAULT | TYPE |
---|---|---|---|---|
access-token | Environment variable storing the access token of Autify for Web. | No | AUTIFY_WEB_ACCESS_TOKEN | env_var_name |
autify-cli-installer-url | Autify CLI installer URL | No | >- https://autify-cli-assets.s3.amazonaws.com/autify-cli/channels/stable/install-cicd.bash | string |
autify-connect | Name of the Autify Connect Access Point | No | '' | string |
autify-connect-client | When true, start Autify Connect Client | No | false | boolean |
autify-connect-client-extra-arguments | Extra command line arguments you want to pass to Autify Connect Client e.g. "--experimental-tunnel-proxy http://proxy". | No | '' | string |
autify-path | A path to `autify`. | No | autify | string |
autify-test-url | URL of a test scenario or test plan e.g. https://app.autify.com/projects/<ID>/(scenarios|test_plans)/<ID> | Yes | - | string |
browser | Browser for running the test scenario (not supported by test plan executions) | No | '' | string |
device | Device for running the test scenario (not supported by test plan executions) | No | '' | string |
device-type | Device type for running the test scenario (not supported by test plan executions) | No | '' | string |
executor | Executor name for this job. | No | autify-cli/default | executor |
max-retry-count | Maximum retry count while waiting. The command can take up to `timeout * (max-retry-count + 1)`. Only effective with `wait` | No | -1 | integer |
os | OS for running the test scenario (not supported by test plan executions) | No | '' | string |
os-version | OS version for running the test scenario (not supported by test plan executions) | No | '' | string |
test-execution-name | Name of the test execution (not supported by test plan executions) | No | '' | string |
timeout | Timeout seconds when waiting. | No | 300 | integer |
url-replacements | URL replacements e.g. http://example.com=http://example.net,http://example.org=http://example.net | No | '' | string |
verbose | - | No | true | boolean |
wait | When true, the action waits until the test finishes. | No | false | boolean |
Run a test scenario or test plan.
PARAMETER | DESCRIPTION | REQUIRED | DEFAULT | TYPE |
---|---|---|---|---|
access-token | Environment variable storing the access token of Autify for Web. | No | AUTIFY_WEB_ACCESS_TOKEN | env_var_name |
autify-cli-installer-url | Autify CLI installer URL | No | >- https://autify-cli-assets.s3.amazonaws.com/autify-cli/channels/stable/install-cicd.bash | string |
autify-connect | Name of the Autify Connect Access Point | No | '' | string |
autify-connect-client | When true, start Autify Connect Client | No | false | boolean |
autify-connect-client-extra-arguments | Extra command line arguments you want to pass to Autify Connect Client e.g. "--experimental-tunnel-proxy http://proxy". | No | '' | string |
autify-path | A path to `autify`. | No | autify | string |
autify-test-url | URL of a test scenario or test plan e.g. https://app.autify.com/projects/<ID>/(scenarios|test_plans)/<ID> | Yes | - | string |
browser | Browser for running the test scenario (not supported by test plan executions) | No | '' | string |
device | Device for running the test scenario (not supported by test plan executions) | No | '' | string |
device-type | Device type for running the test scenario (not supported by test plan executions) | No | '' | string |
max-retry-count | Maximum retry count while waiting. The command can take up to `timeout * (max-retry-count + 1)`. Only effective with `wait` | No | -1 | integer |
os | OS for running the test scenario (not supported by test plan executions) | No | '' | string |
os-version | OS version for running the test scenario (not supported by test plan executions) | No | '' | string |
test-execution-name | Name of the test execution (not supported by test plan executions) | No | '' | string |
timeout | Timeout seconds when waiting. | No | 300 | integer |
url-replacements | URL replacements e.g. http://example.com=http://example.net,http://example.org=http://example.net | No | '' | string |
verbose | - | No | true | boolean |
wait | When true, the action waits until the test finishes. | No | false | boolean |
A base Docker image should work.
PARAMETER | DESCRIPTION | REQUIRED | DEFAULT | TYPE |
---|---|---|---|---|
size | Docker executer's resource_class | No | small | string |
tag | Pick a specific cimg/base image variant: https://hub.docker.com/r/cimg/base/tags
| No | current | string |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
# This code is licensed from CircleCI to the user under the MIT license.
# See here for details: https://circleci.com/developer/orbs/licensing
version: 2.1
description: |
CircleCI integration with Autify for Web. Run a test scenario or test plan with this Orb.
display:
home_url: https://help.autify.com/docs/circleci-integration
source_url: https://github.com/autifyhq/autify-circleci-orb-web
orbs:
autify-cli: autify/autify-cli@2
commands:
test-run:
description: |
Run a test scenario or test plan.
parameters:
access-token:
default: AUTIFY_WEB_ACCESS_TOKEN
description: Environment variable storing the access token of Autify for Web.
type: env_var_name
autify-cli-installer-url:
default: https://autify-cli-assets.s3.amazonaws.com/autify-cli/channels/stable/install-cicd.bash
description: Autify CLI installer URL
type: string
autify-connect:
default: ""
description: Name of the Autify Connect Access Point
type: string
autify-connect-client:
default: false
description: When true, start Autify Connect Client
type: boolean
autify-connect-client-extra-arguments:
default: ""
description: Extra command line arguments you want to pass to Autify Connect Client e.g. "--experimental-tunnel-proxy http://proxy".
type: string
autify-path:
default: autify
description: A path to `autify`.
type: string
autify-test-url:
description: URL of a test scenario or test plan e.g. https://app.autify.com/projects/<ID>/(scenarios|test_plans)/<ID>
type: string
browser:
default: ""
description: Browser for running the test scenario (not supported by test plan executions)
type: string
device:
default: ""
description: Device for running the test scenario (not supported by test plan executions)
type: string
device-type:
default: ""
description: Device type for running the test scenario (not supported by test plan executions)
type: string
max-retry-count:
default: -1
description: Maximum retry count while waiting. The command can take up to `timeout * (max-retry-count + 1)`. Only effective with `wait`
type: integer
os:
default: ""
description: OS for running the test scenario (not supported by test plan executions)
type: string
os-version:
default: ""
description: OS version for running the test scenario (not supported by test plan executions)
type: string
test-execution-name:
default: ""
description: Name of the test execution (not supported by test plan executions)
type: string
timeout:
default: 300
description: Timeout seconds when waiting.
type: integer
url-replacements:
default: ""
description: URL replacements e.g. http://example.com=http://example.net,http://example.org=http://example.net
type: string
verbose:
default: true
type: boolean
wait:
default: false
description: When true, the action waits until the test finishes.
type: boolean
steps:
- autify-cli/install:
shell-installer-url: << parameters.autify-cli-installer-url >>
- when:
condition: << parameters.autify-connect-client >>
steps:
- run: autify connect client install
- run:
command: |
#!/usr/bin/env bash
AUTIFY="${INPUT_AUTIFY_PATH}"
ACCESS_TOKEN="${!INPUT_ACCESS_TOKEN}"
if [ -z "${ACCESS_TOKEN}" ]; then
echo "Missing access-token."
exit 1
fi
ARGS=()
function add_args() {
ARGS+=("$1")
}
if [ -n "${INPUT_AUTIFY_TEST_URL}" ]; then
add_args "${INPUT_AUTIFY_TEST_URL}"
else
echo "Missing autify-test-url."
exit 1
fi
if [ "${INPUT_VERBOSE}" -eq 1 ]; then
add_args "--verbose"
fi
if [ "${INPUT_WAIT}" -eq 1 ]; then
add_args "--wait"
fi
if [ "${INPUT_TIMEOUT}" -ne -1 ]; then
add_args "-t=${INPUT_TIMEOUT}"
fi
if [ -n "${INPUT_URL_REPLACEMENTS}" ]; then
IFS=',' read -ra URL_REPLACEMENTS \<<< "${INPUT_URL_REPLACEMENTS}"
for url_replacement in "${URL_REPLACEMENTS[@]}"; do
add_args "-r=${url_replacement}"
done
fi
if [ "${INPUT_MAX_RETRY_COUNT}" -ne -1 ]; then
add_args "--max-retry-count=${INPUT_MAX_RETRY_COUNT}"
fi
if [ -n "${INPUT_TEST_EXECUTION_NAME}" ]; then
add_args "--name=${INPUT_TEST_EXECUTION_NAME}"
fi
if [ -n "${INPUT_BROWSER}" ]; then
add_args "--browser=${INPUT_BROWSER}"
fi
if [ -n "${INPUT_DEVICE}" ]; then
add_args "--device=${INPUT_DEVICE}"
fi
if [ -n "${INPUT_DEVICE_TYPE}" ]; then
add_args "--device-type=${INPUT_DEVICE_TYPE}"
fi
if [ -n "${INPUT_OS}" ]; then
add_args "--os=${INPUT_OS}"
fi
if [ -n "${INPUT_OS_VERSION}" ]; then
add_args "--os-version=${INPUT_OS_VERSION}"
fi
if [ -n "${INPUT_AUTIFY_CONNECT}" ]; then
add_args "--autify-connect=${INPUT_AUTIFY_CONNECT}"
fi
if [ "${INPUT_AUTIFY_CONNECT_CLIENT}" -eq 1 ]; then
add_args "--autify-connect-client"
fi
if [ -n "${INPUT_AUTIFY_CONNECT_CLIENT_EXTRA_ARGUMENTS}" ]; then
add_args "--autify-connect-client-extra-arguments=${INPUT_AUTIFY_CONNECT_CLIENT_EXTRA_ARGUMENTS}"
fi
export AUTIFY_CLI_USER_AGENT_SUFFIX="${AUTIFY_CLI_USER_AGENT_SUFFIX:=circleci-orb-web-test-run}"
AUTIFY_WEB_ACCESS_TOKEN="${ACCESS_TOKEN}" "${AUTIFY}" web test run "${ARGS[@]}"
environment:
INPUT_ACCESS_TOKEN: << parameters.access-token >>
INPUT_AUTIFY_CONNECT: << parameters.autify-connect >>
INPUT_AUTIFY_CONNECT_CLIENT: << parameters.autify-connect-client >>
INPUT_AUTIFY_CONNECT_CLIENT_EXTRA_ARGUMENTS: << parameters.autify-connect-client-extra-arguments >>
INPUT_AUTIFY_PATH: << parameters.autify-path >>
INPUT_AUTIFY_TEST_URL: << parameters.autify-test-url >>
INPUT_BROWSER: << parameters.browser >>
INPUT_DEVICE: << parameters.device >>
INPUT_DEVICE_TYPE: << parameters.device-type >>
INPUT_MAX_RETRY_COUNT: << parameters.max-retry-count >>
INPUT_OS: << parameters.os >>
INPUT_OS_VERSION: << parameters.os-version >>
INPUT_TEST_EXECUTION_NAME: << parameters.test-execution-name >>
INPUT_TIMEOUT: << parameters.timeout >>
INPUT_URL_REPLACEMENTS: << parameters.url-replacements >>
INPUT_VERBOSE: << parameters.verbose >>
INPUT_WAIT: << parameters.wait >>
name: Run a test scenario or test plan
executors:
default:
description: |
A base Docker image should work.
docker:
- image: cimg/base:<<parameters.tag>>
parameters:
size:
default: small
description: Docker executer's resource_class
type: string
tag:
default: current
description: |
Pick a specific cimg/base image variant: https://hub.docker.com/r/cimg/base/tags
type: string
resource_class: <<parameters.size>>
shell: bash
jobs:
test-run:
description: |
Run a test scenario or test plan.
executor: << parameters.executor >>
parameters:
access-token:
default: AUTIFY_WEB_ACCESS_TOKEN
description: Environment variable storing the access token of Autify for Web.
type: env_var_name
autify-cli-installer-url:
default: https://autify-cli-assets.s3.amazonaws.com/autify-cli/channels/stable/install-cicd.bash
description: Autify CLI installer URL
type: string
autify-connect:
default: ""
description: Name of the Autify Connect Access Point
type: string
autify-connect-client:
default: false
description: When true, start Autify Connect Client
type: boolean
autify-connect-client-extra-arguments:
default: ""
description: Extra command line arguments you want to pass to Autify Connect Client e.g. "--experimental-tunnel-proxy http://proxy".
type: string
autify-path:
default: autify
description: A path to `autify`.
type: string
autify-test-url:
description: URL of a test scenario or test plan e.g. https://app.autify.com/projects/<ID>/(scenarios|test_plans)/<ID>
type: string
browser:
default: ""
description: Browser for running the test scenario (not supported by test plan executions)
type: string
device:
default: ""
description: Device for running the test scenario (not supported by test plan executions)
type: string
device-type:
default: ""
description: Device type for running the test scenario (not supported by test plan executions)
type: string
executor:
default: autify-cli/default
description: Executor name for this job.
type: executor
max-retry-count:
default: -1
description: Maximum retry count while waiting. The command can take up to `timeout * (max-retry-count + 1)`. Only effective with `wait`
type: integer
os:
default: ""
description: OS for running the test scenario (not supported by test plan executions)
type: string
os-version:
default: ""
description: OS version for running the test scenario (not supported by test plan executions)
type: string
test-execution-name:
default: ""
description: Name of the test execution (not supported by test plan executions)
type: string
timeout:
default: 300
description: Timeout seconds when waiting.
type: integer
url-replacements:
default: ""
description: URL replacements e.g. http://example.com=http://example.net,http://example.org=http://example.net
type: string
verbose:
default: true
type: boolean
wait:
default: false
description: When true, the action waits until the test finishes.
type: boolean
steps:
- test-run:
access-token: << parameters.access-token >>
autify-cli-installer-url: << parameters.autify-cli-installer-url >>
autify-connect: << parameters.autify-connect >>
autify-connect-client: << parameters.autify-connect-client >>
autify-connect-client-extra-arguments: << parameters.autify-connect-client-extra-arguments >>
autify-path: << parameters.autify-path >>
autify-test-url: << parameters.autify-test-url >>
browser: << parameters.browser >>
device: << parameters.device >>
device-type: << parameters.device-type >>
max-retry-count: << parameters.max-retry-count >>
os: << parameters.os >>
os-version: << parameters.os-version >>
test-execution-name: << parameters.test-execution-name >>
timeout: << parameters.timeout >>
url-replacements: << parameters.url-replacements >>
verbose: << parameters.verbose >>
wait: << parameters.wait >>
examples:
test-run:
description: |
Run a test scenario or test plan.
usage:
version: "2.1"
orbs:
autify-web: autify/autify-web@3
jobs:
test-run-by-command:
executor: autify-web/default
steps:
- autify-web/test-run:
autify-test-url: https://app.autify.com/projects/<ID>/(scenarios|test_plans)/<ID>
workflows:
test-run:
jobs:
- test-run-by-command
- autify-web/test-run:
autify-test-url: https://app.autify.com/projects/<ID>/(scenarios|test_plans)/<ID>