@testomatio/reporter 0.4.5 → 0.5.0-beta.3
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/.eslintrc.js +18 -22
- package/.github/workflows/node.js.yml +2 -1
- package/.prettierrc.js +12 -0
- package/Changelog.md +21 -17
- package/README.md +122 -93
- package/example/codecept/codecept.conf.js +7 -7
- package/example/codecept/index_test.js +8 -8
- package/example/codecept/sample_test.js +4 -4
- package/example/codecept/steps.d.ts +1 -1
- package/example/codecept/steps_file.js +4 -2
- package/example/core/index.js +6 -6
- package/example/jest/index.test.js +3 -3
- package/example/jest/jest.config.js +1 -1
- package/example/jest/sample.test.js +4 -4
- package/example/mocha/test/index.test.js +5 -5
- package/lib/adapter/codecept.js +72 -70
- package/lib/adapter/cucumber.js +35 -52
- package/lib/adapter/cypress-plugin/index.js +44 -0
- package/lib/adapter/jasmine.js +15 -6
- package/lib/adapter/jest.js +9 -10
- package/lib/adapter/mocha.js +17 -14
- package/lib/adapter/playwright.js +25 -25
- package/lib/adapter/webdriver.js +3 -3
- package/lib/bin/startTest.js +56 -60
- package/lib/client.js +59 -110
- package/lib/constants.js +6 -6
- package/lib/fileUploader.js +22 -19
- package/lib/output.js +6 -8
- package/lib/reporter.js +2 -2
- package/lib/util.js +18 -5
- package/package.json +29 -16
- package/testcafe/index.js +11 -14
- package/tests/adapter/config/index.js +10 -0
- package/tests/adapter/examples/codecept/codecept.conf.js +33 -0
- package/tests/adapter/examples/codecept/index_test.js +11 -0
- package/tests/adapter/examples/codecept/jsconfig.json +5 -0
- package/tests/adapter/examples/codecept/output/Test_for_suite_2_@Tc2171bd2.failed.png +0 -0
- package/tests/adapter/examples/codecept/output/Test_issue_for_suite_1_@Tca70c8c4.failed.png +0 -0
- package/tests/adapter/examples/codecept/sample_test.js +7 -0
- package/tests/adapter/examples/codecept/steps_file.js +10 -0
- package/tests/adapter/examples/jasmine/index.test.js +11 -0
- package/tests/adapter/examples/jasmine/passReporterOpts.sh +8 -0
- package/tests/adapter/examples/jest/index.test.js +11 -0
- package/tests/adapter/examples/jest/jest.config.js +4 -0
- package/tests/adapter/examples/mocha/index.test.js +13 -0
- package/tests/adapter/examples/mocha/mocha.config.js +4 -0
- package/tests/adapter/index.test.js +136 -0
- package/tests/adapter/utils/index.js +40 -0
- package/.prettierrc.json +0 -1
package/.eslintrc.js
CHANGED
|
@@ -3,36 +3,32 @@ module.exports = {
|
|
|
3
3
|
commonjs: true,
|
|
4
4
|
es6: true,
|
|
5
5
|
node: true,
|
|
6
|
+
mocha: true,
|
|
6
7
|
},
|
|
7
|
-
extends: [
|
|
8
|
+
extends: ['airbnb-base', 'prettier'],
|
|
8
9
|
globals: {
|
|
9
|
-
Atomics:
|
|
10
|
-
SharedArrayBuffer:
|
|
10
|
+
Atomics: 'readonly',
|
|
11
|
+
SharedArrayBuffer: 'readonly',
|
|
11
12
|
},
|
|
12
13
|
parserOptions: {
|
|
13
14
|
ecmaVersion: 2018,
|
|
14
15
|
},
|
|
15
16
|
rules: {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
'max-len': ['error', { code: 120 }],
|
|
18
|
+
'arrow-parens': 0,
|
|
19
|
+
'no-underscore-dangle': 0,
|
|
20
|
+
'class-methods-use-this': 0,
|
|
21
|
+
'no-restricted-syntax': 0,
|
|
20
22
|
quotes: 0,
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
"global-require": 0,
|
|
31
|
-
"no-use-before-define": 0,
|
|
32
|
-
"no-plusplus": 0,
|
|
33
|
-
"no-continue": 0,
|
|
34
|
-
"import/no-unresolved": 0,
|
|
35
|
-
"implicit-arrow-linebreak": 0,
|
|
23
|
+
'no-console': 0,
|
|
24
|
+
'no-continue': 0,
|
|
25
|
+
'no-use-before-define': 0,
|
|
26
|
+
'object-curly-newline': 0,
|
|
27
|
+
'consistent-return': 0,
|
|
28
|
+
'no-param-reassign': 0,
|
|
29
|
+
'operator-linebreak': 0,
|
|
30
|
+
'prefer-destructuring': 0,
|
|
31
|
+
'no-plusplus': 0,
|
|
36
32
|
camelcase: 0,
|
|
37
33
|
},
|
|
38
34
|
};
|
package/.prettierrc.js
ADDED
package/Changelog.md
CHANGED
|
@@ -1,21 +1,25 @@
|
|
|
1
|
+
# 0.4.6
|
|
2
|
+
|
|
3
|
+
- Fixed CodeceptJS reporter to report tests failed in hooks
|
|
4
|
+
|
|
1
5
|
# 0.4.5
|
|
2
6
|
|
|
3
|
-
|
|
4
|
-
|
|
7
|
+
- Fixed "Total XX artifacts publicly uploaded to S3 bucket" when no S3 bucket is configured
|
|
8
|
+
- Improved S3 connection error messages
|
|
5
9
|
|
|
6
10
|
# 0.4.4
|
|
7
11
|
|
|
8
|
-
|
|
12
|
+
- Fixed returning 0 exit code when a process fails when running tests in parallel via `start-test-run`. Previously was using the last exit code returned by a process. Currently prefers the highest exit code that was returned by a process.
|
|
9
13
|
|
|
10
14
|
# 0.4.3
|
|
11
15
|
|
|
12
|
-
|
|
16
|
+
- Added `TESTOMATIO_DISABLE_ARTIFACTS` env variable to disable publishing artifacts.
|
|
13
17
|
|
|
14
18
|
# 0.4.2
|
|
15
19
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
20
|
+
- print version of reporter
|
|
21
|
+
- print number of uploaded artifacts
|
|
22
|
+
- print access mode for uploaded artifacts
|
|
19
23
|
|
|
20
24
|
# 0.4.1
|
|
21
25
|
|
|
@@ -28,19 +32,19 @@ global.testomatioArtifacts.push('file/to/upload.png');
|
|
|
28
32
|
|
|
29
33
|
# 0.4.0
|
|
30
34
|
|
|
31
|
-
|
|
35
|
+
- Playwright: Introduced playwright/test support with screenshots and video artifacts
|
|
32
36
|
|
|
33
37
|
> Known issues: reporting using projects configured in Playwright does not work yet
|
|
34
38
|
|
|
35
|
-
|
|
39
|
+
- CodeceptJS: added video uploads
|
|
36
40
|
|
|
37
41
|
# 0.3.16
|
|
38
42
|
|
|
39
|
-
|
|
43
|
+
- CodeceptJS: fixed reporting tests with empty steps (on retry)
|
|
40
44
|
|
|
41
45
|
# 0.3.15
|
|
42
46
|
|
|
43
|
-
|
|
47
|
+
- Finish Run via API:
|
|
44
48
|
|
|
45
49
|
```
|
|
46
50
|
TESTOMATIO={apiKey} TESTOMATIO_RUN={runId} npx @testomatio/reporter@latest --finish
|
|
@@ -48,7 +52,7 @@ TESTOMATIO={apiKey} TESTOMATIO_RUN={runId} npx @testomatio/reporter@latest --fin
|
|
|
48
52
|
|
|
49
53
|
# 0.3.14
|
|
50
54
|
|
|
51
|
-
|
|
55
|
+
- Create an empty Run via API:
|
|
52
56
|
|
|
53
57
|
```
|
|
54
58
|
TESTOMATIO={apiKey} npx @testomatio/reporter@latest --launch
|
|
@@ -56,14 +60,14 @@ TESTOMATIO={apiKey} npx @testomatio/reporter@latest --launch
|
|
|
56
60
|
|
|
57
61
|
# 0.3.13
|
|
58
62
|
|
|
59
|
-
|
|
60
|
-
|
|
63
|
+
- Checking for a valid report URL
|
|
64
|
+
- Sending unlimited data on test report
|
|
61
65
|
|
|
62
66
|
# 0.3.12
|
|
63
67
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
68
|
+
- Fixed submitting arbitrary data on a test run
|
|
69
|
+
- Jest: fixed sending errors with stack traces
|
|
70
|
+
- Cypress: fixed sending reports
|
|
67
71
|
|
|
68
72
|
# 0.3.11
|
|
69
73
|
|
package/README.md
CHANGED
|
@@ -1,60 +1,64 @@
|
|
|
1
1
|
# @testomatio/reporter
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Library for sending test run reports to your [testomat.io](https://testomat.io) project.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
Get the `{API_KEY}` from testomat.
|
|
8
|
+
|
|
9
|
+
You can refer sample tests from example folder of this repo. This is a basic example. If you need something full fledged you can refer this [example repo](https://github.com/testomatio/examples).
|
|
6
10
|
|
|
7
11
|
Add `@testomatio/reporter` package to your project:
|
|
8
12
|
|
|
9
|
-
```
|
|
13
|
+
```bash
|
|
10
14
|
npm i @testomatio/reporter --save
|
|
11
15
|
```
|
|
12
16
|
|
|
13
|
-
For testcafe use testcafe reporter
|
|
17
|
+
For testcafe use testcafe reporter:
|
|
14
18
|
|
|
15
|
-
```
|
|
19
|
+
```bash
|
|
16
20
|
npm i testcafe-reporter-testomatio
|
|
17
21
|
```
|
|
18
22
|
|
|
19
|
-
##
|
|
23
|
+
## Usage
|
|
24
|
+
|
|
25
|
+
### CodeceptJS
|
|
20
26
|
|
|
21
27
|
Make sure you load all your tests using [check-test](https://github.com/testomatio/check-tests#cli).
|
|
22
28
|
|
|
23
|
-
Add plugin to [codecept conf](https://github.com/testomatio/reporter/blob/master/example/codecept/codecept.conf.js#L23)
|
|
29
|
+
Add plugin to [codecept conf](https://github.com/testomatio/reporter/blob/master/example/codecept/codecept.conf.js#L23):
|
|
24
30
|
|
|
25
|
-
```
|
|
31
|
+
```javascript
|
|
26
32
|
plugins: {
|
|
27
33
|
testomatio: {
|
|
28
34
|
enabled: true,
|
|
29
35
|
require: '@testomatio/reporter/lib/adapter/codecept',
|
|
30
|
-
apiKey: process.env.
|
|
36
|
+
apiKey: process.env.TESTOMATIO || 'API_KEY', // pass in api key via config or env variable
|
|
31
37
|
}
|
|
32
38
|
}
|
|
33
39
|
```
|
|
34
40
|
|
|
35
|
-
|
|
41
|
+
Run the following command from you project folder:
|
|
36
42
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
```
|
|
40
|
-
TESTOMATIO=<API_KEY> npx codeceptjs run`
|
|
43
|
+
```bash
|
|
44
|
+
TESTOMATIO={API_KEY} npx codeceptjs run
|
|
41
45
|
```
|
|
42
46
|
|
|
43
|
-
|
|
47
|
+
#### CodeceptJS Parallel Run
|
|
44
48
|
|
|
45
|
-
If tests run parallel, like workers in
|
|
49
|
+
If tests run parallel, like workers in CodeceptJS use `start-test-run` command to get proper reports:
|
|
46
50
|
|
|
47
|
-
```
|
|
48
|
-
TESTOMATIO
|
|
51
|
+
```bash
|
|
52
|
+
TESTOMATIO={API_KEY} npx start-test-run -c 'npx codeceptjs run-workers 2'
|
|
49
53
|
```
|
|
50
54
|
|
|
51
55
|
> Specify a command to run with `-c` option in `start-test-run`
|
|
52
56
|
|
|
53
|
-
|
|
57
|
+
### Playwright
|
|
54
58
|
|
|
55
59
|
Add a reporter to Playwright config:
|
|
56
60
|
|
|
57
|
-
```
|
|
61
|
+
```javascript
|
|
58
62
|
reporter: [
|
|
59
63
|
['list'],
|
|
60
64
|
['@testomatio/reporter/lib/adapter/playwright.js', {
|
|
@@ -63,119 +67,147 @@ Add a reporter to Playwright config:
|
|
|
63
67
|
]
|
|
64
68
|
```
|
|
65
69
|
|
|
66
|
-
|
|
70
|
+
Run the following command from you project folder:
|
|
67
71
|
|
|
68
|
-
```
|
|
69
|
-
TESTOMATIO
|
|
72
|
+
```bash
|
|
73
|
+
TESTOMATIO={API_KEY} npx playwright test
|
|
70
74
|
```
|
|
71
75
|
|
|
72
|
-
|
|
76
|
+
### Mocha
|
|
73
77
|
|
|
74
|
-
Load the test using using `check-test` if not done already. Get the test id from testomat account and add it to your mocha test like in this [example](https://github.com/testomatio/reporter/blob/master/example/mocha/test/index.test.js#L4)
|
|
78
|
+
Load the test using using `check-test` if not done already. Get the test id from testomat account and add it to your mocha test like in this [example](https://github.com/testomatio/reporter/blob/master/example/mocha/test/index.test.js#L4).
|
|
75
79
|
|
|
76
|
-
|
|
80
|
+
Run the following command from you project folder:
|
|
77
81
|
|
|
78
|
-
```
|
|
79
|
-
mocha --reporter ./node_modules/testomat-reporter/lib/adapter/mocha.js
|
|
82
|
+
```bash
|
|
83
|
+
mocha --reporter ./node_modules/testomat-reporter/lib/adapter/mocha.js --reporter-options apiKey={API_KEY}
|
|
80
84
|
```
|
|
81
85
|
|
|
82
|
-
|
|
86
|
+
### Jest
|
|
83
87
|
|
|
84
|
-
Load the test using using `check-test
|
|
88
|
+
Load the test using using `check-test`. Add the test id to your tests like in this [example](https://github.com/testomatio/reporter/blob/master/example/jest/index.test.js#L1).
|
|
85
89
|
|
|
86
|
-
Add the following line to [jest.config.js](https://github.com/testomatio/reporter/blob/master/example/jest/jest.config.js#L100)
|
|
90
|
+
Add the following line to [jest.config.js](https://github.com/testomatio/reporter/blob/master/example/jest/jest.config.js#L100):
|
|
87
91
|
|
|
88
|
-
|
|
92
|
+
```javascript
|
|
93
|
+
reporters: ['default', ['../../lib/adapter/jest.js', { apiKey: {API_KEY} }]],
|
|
94
|
+
```
|
|
89
95
|
|
|
90
96
|
Run your tests.
|
|
91
97
|
|
|
92
|
-
|
|
98
|
+
### Cucumber
|
|
93
99
|
|
|
94
|
-
Load you test using [`check-cucumber`](https://github.com/testomatio/check-cucumber)
|
|
100
|
+
Load you test using [`check-cucumber`](https://github.com/testomatio/check-cucumber).
|
|
95
101
|
|
|
96
|
-
Run
|
|
102
|
+
Run the following command from you project folder:
|
|
97
103
|
|
|
98
|
-
```
|
|
99
|
-
TESTOMATIO=
|
|
104
|
+
```bash
|
|
105
|
+
TESTOMATIO={API_KEY} ./node_modules/.bin/cucumber-js --format ./node_modules/@testomatio/reporter/lib/adapter/cucumber.js
|
|
100
106
|
```
|
|
101
107
|
|
|
102
|
-
|
|
108
|
+
### TestCafe
|
|
103
109
|
|
|
104
|
-
Load the test using using `check-test
|
|
110
|
+
Load the test using using `check-test`.
|
|
105
111
|
|
|
106
|
-
|
|
112
|
+
Run the following command from you project folder:
|
|
107
113
|
|
|
108
|
-
```
|
|
109
|
-
TESTOMATIO={
|
|
114
|
+
```bash
|
|
115
|
+
TESTOMATIO={API_KEY} npx testcafe chrome -r testomatio
|
|
110
116
|
```
|
|
111
117
|
|
|
112
|
-
|
|
118
|
+
### Cypress
|
|
119
|
+
|
|
120
|
+
Load the test using using `check-test`.
|
|
113
121
|
|
|
114
|
-
|
|
122
|
+
Register our `cypress-plugin` in `cypress/plugins/index.js`:
|
|
115
123
|
|
|
116
|
-
|
|
124
|
+
```javascript
|
|
125
|
+
const testomatioReporter = require('@testomatio/reporter/lib/adapter/cypress-plugin');
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* @type {Cypress.PluginConfig}
|
|
129
|
+
*/
|
|
130
|
+
module.exports = (on, config) => {
|
|
131
|
+
// `on` is used to hook into various events Cypress emits
|
|
132
|
+
// `config` is the resolved Cypress config
|
|
133
|
+
|
|
134
|
+
testomatioReporter(on, config);
|
|
135
|
+
|
|
136
|
+
return config;
|
|
137
|
+
};
|
|
138
|
+
```
|
|
117
139
|
|
|
118
|
-
|
|
119
|
-
|
|
140
|
+
Run the following command from you project folder:
|
|
141
|
+
|
|
142
|
+
```bash
|
|
143
|
+
TESTOMATIO={API_KEY} npx cypress run
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
### Protractor
|
|
147
|
+
|
|
148
|
+
Load the test using using `check-test`.
|
|
149
|
+
|
|
150
|
+
Add the following line to [conf.js](https://github.com/angular/protractor/blob/5.4.1/example/conf.js):
|
|
151
|
+
|
|
152
|
+
```javascript
|
|
153
|
+
const JasmineReporter = require('@testomatio/reporter/lib/adapter/jasmine');
|
|
120
154
|
|
|
121
155
|
exports.config = {
|
|
122
156
|
onPrepare: () => {
|
|
123
|
-
jasmine
|
|
124
|
-
.getEnv()
|
|
125
|
-
.addReporter(new JasmineReporter({ apiKey: process.env.TESTOMATIO }));
|
|
157
|
+
jasmine.getEnv().addReporter(new JasmineReporter({ apiKey: process.env.TESTOMATIO }));
|
|
126
158
|
},
|
|
127
159
|
};
|
|
128
160
|
```
|
|
129
161
|
|
|
130
|
-
|
|
162
|
+
Run the following command from you project folder:
|
|
131
163
|
|
|
132
|
-
```
|
|
133
|
-
TESTOMATIO={
|
|
164
|
+
```bash
|
|
165
|
+
TESTOMATIO={API_KEY} npx @testomatio/reporter@latest -c 'npx protractor conf.js'
|
|
134
166
|
```
|
|
135
167
|
|
|
136
|
-
|
|
168
|
+
## Advanced Usage
|
|
137
169
|
|
|
138
|
-
|
|
170
|
+
### Adding Report to Run by ID
|
|
139
171
|
|
|
140
172
|
This feature is widely used when a run is executed on CI.
|
|
141
173
|
A run is created before the test is started and it is marked as `scheduled`. Then
|
|
142
|
-
a report is assigned to that run using `TESTOMATIO_RUN` environment variable and
|
|
174
|
+
a report is assigned to that run using `TESTOMATIO_RUN` environment variable and `{RUN_ID}` of a run:
|
|
143
175
|
|
|
144
|
-
```
|
|
145
|
-
TESTOMATIO={
|
|
176
|
+
```bash
|
|
177
|
+
TESTOMATIO={API_KEY} TESTOMATIO_RUN={RUN_ID} <actual run command>
|
|
146
178
|
```
|
|
147
179
|
|
|
148
|
-
|
|
180
|
+
### Setting Report Title
|
|
149
181
|
|
|
150
182
|
Give a title to your reports by passing it as environment variable to `TESTOMATIO_TITLE`.
|
|
151
183
|
|
|
152
|
-
```
|
|
153
|
-
TESTOMATIO={
|
|
184
|
+
```bash
|
|
185
|
+
TESTOMATIO={API_KEY} TESTOMATIO_TITLE="title for the report" <actual run command>
|
|
154
186
|
```
|
|
155
187
|
|
|
156
|
-
|
|
188
|
+
### Adding Report to RunGroup
|
|
157
189
|
|
|
158
190
|
Create/Add run to group by providing `TESTOMATIO_RUNGROUP_TITLE`:
|
|
159
191
|
|
|
160
192
|
```sh
|
|
161
|
-
TESTOMATIO={
|
|
193
|
+
TESTOMATIO={API_KEY} TESTOMATIO_RUNGROUP_TITLE="Build ${BUILD_ID}" <actual run command>
|
|
162
194
|
```
|
|
163
195
|
|
|
164
|
-
|
|
196
|
+
### Adding Environments to Run
|
|
165
197
|
|
|
166
198
|
Add environments to run by providing `TESTOMATIO_ENV` as comma seperated values:
|
|
167
199
|
|
|
168
|
-
```
|
|
169
|
-
TESTOMATIO={
|
|
200
|
+
```bash
|
|
201
|
+
TESTOMATIO={API_KEY} TESTOMATIO_ENV="Windows, Chrome" <actual run command>
|
|
170
202
|
```
|
|
171
203
|
|
|
172
|
-
|
|
204
|
+
### Attaching Test Artifacts
|
|
173
205
|
|
|
174
206
|
To save a test artifacts (screenshots and videos) of a failed test use S3 storage.
|
|
175
207
|
Please note, that the **storage is not connected to Testomatio**.
|
|
176
208
|
This allows you to store your artifacts on your own account and not expose S3 credentials.
|
|
177
209
|
|
|
178
|
-
To save screenshots provide a configuration for S3 bucket via environment variables
|
|
210
|
+
To save screenshots provide a configuration for S3 bucket via environment variables:
|
|
179
211
|
|
|
180
212
|
- **S3_REGION** - Region your bucket lies.
|
|
181
213
|
- **S3_BUCKET** - Bucket name.
|
|
@@ -183,20 +215,20 @@ To save screenshots provide a configuration for S3 bucket via environment variab
|
|
|
183
215
|
- **S3_SECRET_ACCESS_KEY** - Secret.
|
|
184
216
|
- **S3_ENDPOINT** - for providers other than AWS
|
|
185
217
|
|
|
186
|
-
By default tests artifacts are uploaded to bucket with `public-read` permission.
|
|
187
|
-
In this case uploaded files will be publicly accessible in Internet.
|
|
188
|
-
These public links will be used by
|
|
218
|
+
By default tests artifacts are uploaded to bucket with `public-read` permission.
|
|
219
|
+
In this case uploaded files will be publicly accessible in Internet.
|
|
220
|
+
These public links will be used by [testomat.io](https://testomat.io) to display images and videos.
|
|
189
221
|
|
|
190
|
-
To upload files with `private` access bucket add `TESTOMATIO_PRIVATE_ARTIFACTS=1` environment value.
|
|
191
|
-
Then update provide the same S3 credentials in "Settings > Artifacts" section of a
|
|
192
|
-
so
|
|
222
|
+
To upload files with `private` access bucket add `TESTOMATIO_PRIVATE_ARTIFACTS=1` environment value.
|
|
223
|
+
Then update provide the same S3 credentials in "Settings > Artifacts" section of a [testomat.io](https://testomat.io) project,
|
|
224
|
+
so [testomat.io](https://testomat.io) could connect to the same bucket and fetch uploaded artifacts.
|
|
193
225
|
Links to files will be pre-signed and expires automatically in 10 minutes.
|
|
194
226
|
|
|
195
|
-
Example upload configuration in environment variables
|
|
227
|
+
Example upload configuration in environment variables:
|
|
196
228
|
|
|
197
229
|
##### AWS
|
|
198
230
|
|
|
199
|
-
```
|
|
231
|
+
```bash
|
|
200
232
|
TESTOMATIO_PRIVATE_ARTIFACTS=1
|
|
201
233
|
S3_ACCESS_KEY_ID=11111111111111111111
|
|
202
234
|
S3_SECRET_ACCESS_KEY=2222222222222222222222222222222222222222222
|
|
@@ -206,7 +238,7 @@ S3_REGION=us-west-1
|
|
|
206
238
|
|
|
207
239
|
##### DigitalOcean
|
|
208
240
|
|
|
209
|
-
```
|
|
241
|
+
```bash
|
|
210
242
|
TESTOMATIO_PRIVATE_ARTIFACTS=1
|
|
211
243
|
S3_ENDPOINT=https://ams3.digitaloceanspaces.com
|
|
212
244
|
S3_ACCESS_KEY_ID=11111111111111111111
|
|
@@ -217,7 +249,7 @@ S3_REGION=ams3
|
|
|
217
249
|
|
|
218
250
|
##### Minio
|
|
219
251
|
|
|
220
|
-
```
|
|
252
|
+
```bash
|
|
221
253
|
S3_ENDPOINT=http://company.storage.com
|
|
222
254
|
S3_ACCESS_KEY_ID=minio
|
|
223
255
|
S3_SECRET_ACCESS_KEY=minio123
|
|
@@ -227,19 +259,18 @@ S3_FORCE_PATH_STYLE=true
|
|
|
227
259
|
|
|
228
260
|
> It is important to add S3_FORCE_PATH_STYLE var for minio setup
|
|
229
261
|
|
|
230
|
-
|
|
231
262
|
For local testing, it is recommended to store this configuration in `.env` file and load it with [dotenv](https://www.npmjs.com/package/dotenv) library.
|
|
232
263
|
|
|
233
264
|
On CI set environment variables in CI config.
|
|
234
265
|
|
|
235
266
|
Test artifacts are automatically uploaded for these test runners:
|
|
236
267
|
|
|
237
|
-
|
|
238
|
-
|
|
268
|
+
- CodeceptJS
|
|
269
|
+
- Playwright
|
|
239
270
|
|
|
240
271
|
To manually attach an artifact and upload it for a test use `global.testomatioArtifacts` array:
|
|
241
272
|
|
|
242
|
-
```
|
|
273
|
+
```javascript
|
|
243
274
|
// attach a picture inside a test
|
|
244
275
|
global.testomatioArtifacts.push('img/file.png');
|
|
245
276
|
// attach a picture and add a name to it
|
|
@@ -250,28 +281,26 @@ Artifacts will be uploaded for the current test when it is finished.
|
|
|
250
281
|
|
|
251
282
|
To disable uploading artifacts add `TESTOMATIO_DISABLE_ARTIFACTS` environment variable:
|
|
252
283
|
|
|
253
|
-
```
|
|
284
|
+
```bash
|
|
254
285
|
TESTOMATIO_DISABLE_ARTIFACTS=1
|
|
255
286
|
```
|
|
256
287
|
|
|
288
|
+
### Starting an Empty Run
|
|
257
289
|
|
|
258
|
-
|
|
290
|
+
If you want to create a run and obtain its `{RUN_ID}` from [testomat.io](https://testomat.io) you can use `--launch` option:
|
|
259
291
|
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
```sh
|
|
263
|
-
TESTOMATIO={apiKey} npx @testomatio/reporter@latest --launch
|
|
292
|
+
```bash
|
|
293
|
+
TESTOMATIO={API_KEY} npx @testomatio/reporter@latest --launch
|
|
264
294
|
```
|
|
265
295
|
|
|
266
|
-
This command will return
|
|
296
|
+
This command will return `{RUN_ID}` which you can pass to other testrunner processes.
|
|
267
297
|
|
|
268
298
|
> When executed with `--launch` a command provided by `-c` flag is ignored
|
|
269
299
|
|
|
270
|
-
|
|
300
|
+
### Manually Finishing Run
|
|
271
301
|
|
|
272
302
|
If you want to finish a run started by `--launch` use `--finish` option. `TESTOMATIO_RUN` environment variable is required:
|
|
273
303
|
|
|
274
|
-
```
|
|
275
|
-
TESTOMATIO={
|
|
304
|
+
```bash
|
|
305
|
+
TESTOMATIO={API_KEY} TESTOMATIO_RUN={RUN_ID} npx @testomatio/reporter@latest --finish
|
|
276
306
|
```
|
|
277
|
-
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
exports.config = {
|
|
2
|
-
tests:
|
|
3
|
-
output:
|
|
2
|
+
tests: './*_test.js',
|
|
3
|
+
output: './output',
|
|
4
4
|
helpers: {
|
|
5
5
|
Puppeteer: {
|
|
6
|
-
url:
|
|
6
|
+
url: 'http://localhost',
|
|
7
7
|
show: true,
|
|
8
8
|
},
|
|
9
9
|
},
|
|
10
10
|
include: {
|
|
11
|
-
I:
|
|
11
|
+
I: './steps_file.js',
|
|
12
12
|
},
|
|
13
13
|
bootstrap: null,
|
|
14
14
|
mocha: {},
|
|
15
|
-
name:
|
|
15
|
+
name: 'codecept',
|
|
16
16
|
plugins: {
|
|
17
17
|
retryFailedStep: {
|
|
18
18
|
enabled: false,
|
|
@@ -22,8 +22,8 @@ exports.config = {
|
|
|
22
22
|
},
|
|
23
23
|
testomat: {
|
|
24
24
|
enabled: true,
|
|
25
|
-
require:
|
|
26
|
-
apiKey:
|
|
25
|
+
require: '../../lib/adapter/codecept',
|
|
26
|
+
apiKey: 'lz8ea4948ud5',
|
|
27
27
|
},
|
|
28
28
|
},
|
|
29
29
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
Feature(
|
|
1
|
+
Feature('Suite 1 @S25e19ba9');
|
|
2
2
|
|
|
3
|
-
Scenario(
|
|
4
|
-
I.amOnPage(
|
|
5
|
-
I.see(
|
|
6
|
-
I.fillField(
|
|
7
|
-
I.fillField(
|
|
8
|
-
I.click(
|
|
9
|
-
I.see(
|
|
3
|
+
Scenario('Test issue for suite 1 @Tca70c8c4', I => {
|
|
4
|
+
I.amOnPage('https://github.com/login');
|
|
5
|
+
I.see('GitHub');
|
|
6
|
+
I.fillField('login', 'randomuser_kmk');
|
|
7
|
+
I.fillField('password', 'randomuser_kmk');
|
|
8
|
+
I.click('Sign in');
|
|
9
|
+
I.see('Repositories');
|
|
10
10
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Feature(
|
|
1
|
+
Feature('Suite 2 @S2bf55e11');
|
|
2
2
|
|
|
3
|
-
Scenario(
|
|
4
|
-
I.amOnPage(
|
|
5
|
-
I.see(
|
|
3
|
+
Scenario('Test for suite 2 @Tc2171bd2', I => {
|
|
4
|
+
I.amOnPage('https://github.com/login');
|
|
5
|
+
I.see('GitHub');
|
|
6
6
|
});
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
// in this file you can append custom step methods to 'I' object
|
|
2
2
|
|
|
3
|
-
module.exports = function
|
|
3
|
+
module.exports = function() {
|
|
4
4
|
return actor({
|
|
5
|
+
|
|
5
6
|
// Define custom steps here, use 'this' to access default methods of I.
|
|
6
7
|
// It is recommended to place a general 'login' function here.
|
|
8
|
+
|
|
7
9
|
});
|
|
8
|
-
}
|
|
10
|
+
}
|
package/example/core/index.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
const { TestomatClient, TRConstants } = require(
|
|
1
|
+
const { TestomatClient, TRConstants } = require('testomat-reporter');
|
|
2
2
|
|
|
3
|
-
const client = new TestomatClient({ apiKey:
|
|
3
|
+
const client = new TestomatClient({ apiKey: 'l5x5d5cd6pc3' });
|
|
4
4
|
|
|
5
5
|
client
|
|
6
6
|
.createRun()
|
|
7
7
|
.then(async () => {
|
|
8
|
-
await client.addTestRun(
|
|
9
|
-
await client.addTestRun(
|
|
10
|
-
await client.addTestRun(
|
|
11
|
-
await client.addTestRun(
|
|
8
|
+
await client.addTestRun('cc883e99', TRConstants.PASSED);
|
|
9
|
+
await client.addTestRun('7af2c281', TRConstants.PASSED);
|
|
10
|
+
await client.addTestRun('6603c29e', TRConstants.PASSED);
|
|
11
|
+
await client.addTestRun('95956b60', TRConstants.FAILED, 'Test case failed');
|
|
12
12
|
|
|
13
13
|
client.updateRunStatus(TRConstants.FAILED);
|
|
14
14
|
})
|