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:
oxygen: cloudbeat/oxygen@1.0.0
Use oxygen
elements in your existing workflows and jobs.
Opt-in to use of uncertified orbs on your organization’s Security settings page.
Install the Oxygen CLI, its dependencies, Selenium Standalone Server, start the Selenium Standalone Server and run a test suite with Oxygen CLI.
1
2
3
4
5
6
7
8
9
10
version: 2.1
orbs:
oxygen: cloudbeat/oxygen@1.0.0
workflows:
oxygen_install-start-run-tests:
jobs:
- oxygen/install-start-run-tests:
selenium-minor-version: '3.5'
selenium-patch-version: 3.5.3
file: tests/suite.json
Install Oxygen, Selenium, and Mono (optional), then start server and run a test case or test suite with Oxygen CLI
PARAMETER | DESCRIPTION | REQUIRED | DEFAULT | TYPE |
---|---|---|---|---|
executor | executor to use for this job | No | default | executor |
selenium-minor-version | the minor version of Selenium Standalone Server to use | No | '3.5' | string |
selenium-patch-version | the patch version of Selenium Standalone Server to use | No | 3.5.3 | string |
checkout | Boolean for whether or not to checkout as a first step. Default is true.
| No | true | boolean |
file | Test case or test suite file to execute.
| No | '' | string |
results | Folder in which test results will be stored. Default is oxygen-test-results.
| No | oxygen-test-results | string |
iter | Number of times (iterations) to run the test. Default is 1.
| No | 1 | integer |
param | Parameters file (optional). If not specified an attempt will be made to load parameters from a file named same as the test script, located in the same directory, and having extension - xlsx, xls, csv, or txt.
| No | '' | string |
pm | Order in which to read the parameters - sequential, random, all. Default is seq. In seq and random modes test will run exact number of times specified with the iter parameter. In all mode, all available parameters will be read sequentially. This option is mutually exclusive with iter parameter.
| No | seq | enum |
browser | Browser name (chrome or ie). Default is chrome.
| No | chrome | enum |
Install Oxygen CLI.
PARAMETER | DESCRIPTION | REQUIRED | DEFAULT | TYPE |
---|---|---|---|---|
executor | executor to use for this job | No | default | executor |
Install Selenium Standalone Server
PARAMETER | DESCRIPTION | REQUIRED | DEFAULT | TYPE |
---|---|---|---|---|
executor | executor to use for this job | No | default | executor |
selenium-minor-version | the minor version of Selenium Standalone Server to use | No | '3.5' | string |
selenium-patch-version | the patch version of Selenium Standalone Server to use | No | 3.5.3 | string |
Start Selenium Standalone Server
PARAMETER | DESCRIPTION | REQUIRED | DEFAULT | TYPE |
---|---|---|---|---|
executor | executor to use for this job | No | default | executor |
selenium-minor-version | the minor version of Selenium Standalone Server to use | No | '3.5' | string |
selenium-patch-version | the patch version of Selenium Standalone Server to use | No | 3.5.3 | string |
Run a test case or test suite with Oxygen CLI.
PARAMETER | DESCRIPTION | REQUIRED | DEFAULT | TYPE |
---|---|---|---|---|
executor | executor to use for this job | No | default | executor |
file | Test case or test suite file to execute.
| No | '' | string |
results | Folder in which test results will be stored. Default is oxygen-test-results.
| No | oxygen-test-results | string |
iter | Number of times (iterations) to run the test. Default is 1.
| No | 1 | integer |
param | Parameters file (optional). If not specified an attempt will be made to load parameters from a file named same as the test script, located in the same directory, and having extension - xlsx, xls, csv, or txt.
| No | '' | string |
pm | Order in which to read the parameters - sequential, random, all. Default is seq. In seq and random modes test will run exact number of times specified with the iter parameter. In all mode, all available parameters will be read sequentially. This option is mutually exclusive with iter parameter.
| No | seq | enum |
browser | Browser name (chrome or ie). Default is chrome.
| No | chrome | enum |
selenium-url | Selenium hub URL (optional). If not specified an attempt will be made to use http://localhost:4444/wd/hub.
| No | '' | 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
# 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: >
Use the Oxygen open source framework to run automated tests.
See this orb's source: https://github.com/oxygenhq/oxygen-orb
executors:
default:
docker:
- image: circleci/openjdk:8u181-jdk-stretch-node-browsers
commands:
install-oxygen-cli:
description: >
Install Oxygen CLI.
parameters:
executor:
description: executor to use for this job
type: executor
default: default
steps:
- run: echo 'export PATH=$HOME/npm/bin:$PATH' >> $BASH_ENV
- run:
name: Install Oxygen CLI
command: |
npm set prefix=/home/circleci/npm
npm install -g oxygen-cli
install-selenium:
description: >
Install Selenium Standalone Server
parameters:
executor:
description: executor to use for this job
type: executor
default: default
selenium-minor-version:
description: the minor version of Selenium Standalone Server to use
type: string
default: "3.5"
selenium-patch-version:
description: the patch version of Selenium Standalone Server to use
type: string
default: "3.5.3"
steps:
- run:
name: Install Selenium Standalone Server
command: |
curl -O http://selenium-release.storage.googleapis.com/<< parameters.selenium-minor-version >>/selenium-server-standalone-<< parameters.selenium-patch-version >>.jar
start-selenium:
description: >
Start Selenium Standalone Server
parameters:
executor:
description: executor to use for this job
type: executor
default: default
selenium-minor-version:
description: the minor version of Selenium Standalone Server to use
type: string
default: "3.5"
selenium-patch-version:
description: the patch version of Selenium Standalone Server to use
type: string
default: "3.5.3"
steps:
- run:
name: Create selenium-artifacts directory
command: mkdir selenium-artifacts
- run:
name: Start Selenium Standalone Server
command: |
java -jar selenium-server-standalone-<< parameters.selenium-patch-version >>.jar -port 4444 -timeout 320 -browserTimeout 320 -log selenium-artifacts/selenium.log
background: true
run-tests:
description: >
Run a test case or test suite with Oxygen CLI.
parameters:
executor:
description: executor to use for this job
type: executor
default: default
file:
description: >
Test case or test suite file to execute.
type: string
default: ''
results:
description: >
Folder in which test results will be stored. Default is oxygen-test-results.
type: string
default: 'oxygen-test-results'
iter:
description: >
Number of times (iterations) to run the test. Default is 1.
type: integer
default: 1
param:
description: >
Parameters file (optional). If not specified an attempt will be made to load parameters from a file named same as the test script, located in the same directory, and having extension - xlsx, xls, csv, or txt.
type: string
default: ''
pm:
description: >
Order in which to read the parameters - sequential, random, all. Default is seq. In seq and random modes test will run exact number of times specified with the iter parameter. In all mode, all available parameters will be read sequentially. This option is mutually exclusive with iter parameter.
type: enum
enum: ['seq', 'random', 'all']
default: 'seq'
browser:
description: >
Browser name (chrome or ie). Default is chrome.
type: enum
enum: ['chrome', 'ie']
default: 'chrome'
selenium-url:
description: >
Selenium hub URL (optional). If not specified an attempt will be made to use http://localhost:4444/wd/hub.
type: string
default: ''
steps:
- run:
name: Create test results directory
command: mkdir <<parameters.results>>
- run:
name: Run test case or test suite
command: |
oxygen --iter=<<parameters.iter>> --pm=<<parameters.pm>> --browser=<<parameters.browser>> \
<<# parameters.param>> --param=<<parameters.param>> <</ parameters.param>> \
<<# parameters.selenium-url>> --server=<<parameters.selenium-url>> <</ parameters.selenium-url>> \
--rf=junit --ro=<<parameters.results>> <<parameters.file>>
- store_test_results:
path: <<parameters.results>>
jobs:
install-start-run-tests:
description: Install Oxygen, Selenium, and Mono (optional), then start server and run a test case or test suite with Oxygen CLI
executor: default
parameters:
executor:
description: executor to use for this job
type: executor
default: default
selenium-minor-version:
description: the minor version of Selenium Standalone Server to use
type: string
default: "3.5"
selenium-patch-version:
description: the patch version of Selenium Standalone Server to use
type: string
default: "3.5.3"
checkout:
description: >
Boolean for whether or not to checkout as a first step. Default is true.
type: boolean
default: true
file:
description: >
Test case or test suite file to execute.
type: string
default: ''
results:
description: >
Folder in which test results will be stored. Default is oxygen-test-results.
type: string
default: 'oxygen-test-results'
iter:
description: >
Number of times (iterations) to run the test. Default is 1.
type: integer
default: 1
param:
description: >
Parameters file (optional). If not specified an attempt will be made to load parameters from a file named same as the test script, located in the same directory, and having extension - xlsx, xls, csv, or txt.
type: string
default: ''
pm:
description: >
Order in which to read the parameters - sequential, random, all. Default is seq. In seq and random modes test will run exact number of times specified with the iter parameter. In all mode, all available parameters will be read sequentially. This option is mutually exclusive with iter parameter.
type: enum
enum: ['seq', 'random', 'all']
default: 'seq'
browser:
description: >
Browser name (chrome or ie). Default is chrome.
type: enum
enum: ['chrome', 'ie']
default: 'chrome'
steps:
- when:
condition: << parameters.checkout >>
steps:
- checkout
- install-oxygen-cli
- install-selenium:
selenium-minor-version: << parameters.selenium-minor-version >>
selenium-patch-version: << parameters.selenium-patch-version >>
- start-selenium:
selenium-minor-version: << parameters.selenium-minor-version >>
selenium-patch-version: << parameters.selenium-patch-version >>
- run-tests:
file: << parameters.file >>
results: << parameters.results >>
iter: << parameters.iter >>
param: << parameters.param >>
pm: << parameters.pm >>
browser: << parameters.browser >>
examples:
build:
description: >
Install the Oxygen CLI, its dependencies, Selenium Standalone Server, start the Selenium Standalone Server and run a test suite with Oxygen CLI.
usage:
version: 2.1
orbs:
oxygen: cloudbeat/oxygen@1.0.0
workflows:
oxygen_install-start-run-tests:
jobs:
- oxygen/install-start-run-tests:
selenium-minor-version: "3.5"
selenium-patch-version: "3.5.3"
file: 'tests/suite.json'