@testomatio/reporter 0.4.3 → 0.5.0-beta.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.
Files changed (49) hide show
  1. package/.eslintrc.js +18 -22
  2. package/.github/workflows/node.js.yml +2 -1
  3. package/.prettierrc.js +12 -0
  4. package/Changelog.md +27 -14
  5. package/README.md +122 -93
  6. package/example/codecept/codecept.conf.js +7 -7
  7. package/example/codecept/index_test.js +8 -8
  8. package/example/codecept/sample_test.js +4 -4
  9. package/example/codecept/steps.d.ts +1 -1
  10. package/example/codecept/steps_file.js +4 -2
  11. package/example/core/index.js +6 -6
  12. package/example/jest/index.test.js +3 -3
  13. package/example/jest/jest.config.js +1 -1
  14. package/example/jest/sample.test.js +4 -4
  15. package/example/mocha/test/index.test.js +5 -5
  16. package/lib/adapter/codecept.js +73 -70
  17. package/lib/adapter/cucumber.js +35 -52
  18. package/lib/adapter/cypress-plugin/index.js +42 -0
  19. package/lib/adapter/jasmine.js +15 -6
  20. package/lib/adapter/jest.js +9 -10
  21. package/lib/adapter/mocha.js +17 -14
  22. package/lib/adapter/playwright.js +26 -25
  23. package/lib/adapter/webdriver.js +3 -3
  24. package/lib/bin/startTest.js +60 -58
  25. package/lib/client.js +61 -112
  26. package/lib/constants.js +6 -6
  27. package/lib/fileUploader.js +44 -16
  28. package/lib/output.js +6 -8
  29. package/lib/reporter.js +2 -2
  30. package/lib/util.js +18 -5
  31. package/package.json +27 -15
  32. package/testcafe/index.js +11 -14
  33. package/tests/adapter/config/index.js +10 -0
  34. package/tests/adapter/examples/codecept/codecept.conf.js +33 -0
  35. package/tests/adapter/examples/codecept/index_test.js +11 -0
  36. package/tests/adapter/examples/codecept/jsconfig.json +5 -0
  37. package/tests/adapter/examples/codecept/output/Test_for_suite_2_@Tc2171bd2.failed.png +0 -0
  38. package/tests/adapter/examples/codecept/output/Test_issue_for_suite_1_@Tca70c8c4.failed.png +0 -0
  39. package/tests/adapter/examples/codecept/sample_test.js +7 -0
  40. package/tests/adapter/examples/codecept/steps_file.js +10 -0
  41. package/tests/adapter/examples/jasmine/index.test.js +11 -0
  42. package/tests/adapter/examples/jasmine/passReporterOpts.sh +8 -0
  43. package/tests/adapter/examples/jest/index.test.js +11 -0
  44. package/tests/adapter/examples/jest/jest.config.js +4 -0
  45. package/tests/adapter/examples/mocha/index.test.js +13 -0
  46. package/tests/adapter/examples/mocha/mocha.config.js +4 -0
  47. package/tests/adapter/index.test.js +136 -0
  48. package/tests/adapter/utils/index.js +40 -0
  49. 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: ["airbnb-base"],
8
+ extends: ['airbnb-base', 'prettier'],
8
9
  globals: {
9
- Atomics: "readonly",
10
- SharedArrayBuffer: "readonly",
10
+ Atomics: 'readonly',
11
+ SharedArrayBuffer: 'readonly',
11
12
  },
12
13
  parserOptions: {
13
14
  ecmaVersion: 2018,
14
15
  },
15
16
  rules: {
16
- "arrow-parens": 0,
17
- "no-underscore-dangle": 0,
18
- "class-methods-use-this": 0,
19
- "no-restricted-syntax": 0,
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
- "no-console": 0,
22
- "object-curly-newline": 0,
23
- "consistent-return": 0,
24
- "func-names": 0,
25
- "prefer-const": 0,
26
- "comma-dangle": 0,
27
- "no-param-reassign": 0,
28
- "operator-linebreak": 0,
29
- "prefer-destructuring": 0,
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
  };
@@ -24,6 +24,7 @@ jobs:
24
24
  uses: actions/setup-node@v2
25
25
  with:
26
26
  node-version: ${{ matrix.node-version }}
27
- cache: "npm"
27
+ cache: 'npm'
28
28
  - run: npm i
29
29
  - run: npm run lint
30
+ - run: npm run test
package/.prettierrc.js ADDED
@@ -0,0 +1,12 @@
1
+ module.exports = {
2
+ printWidth: 120,
3
+ tabWidth: 2,
4
+ useTabs: false,
5
+ semi: true,
6
+ singleQuote: true,
7
+ quoteProps: 'as-needed',
8
+ trailingComma: 'all',
9
+ bracketSpacing: true,
10
+ arrowParens: 'avoid',
11
+ endOfLine: 'lf',
12
+ };
package/Changelog.md CHANGED
@@ -1,12 +1,25 @@
1
+ # 0.4.6
2
+
3
+ - Fixed CodeceptJS reporter to report tests failed in hooks
4
+
5
+ # 0.4.5
6
+
7
+ - Fixed "Total XX artifacts publicly uploaded to S3 bucket" when no S3 bucket is configured
8
+ - Improved S3 connection error messages
9
+
10
+ # 0.4.4
11
+
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.
13
+
1
14
  # 0.4.3
2
15
 
3
- * Added `TESTOMATIO_DISABLE_ARTIFACTS` env variable to disable publishing artifacts.
16
+ - Added `TESTOMATIO_DISABLE_ARTIFACTS` env variable to disable publishing artifacts.
4
17
 
5
18
  # 0.4.2
6
19
 
7
- * print version of reporter
8
- * print number of uploaded artifacts
9
- * print access mode for uploaded artifacts
20
+ - print version of reporter
21
+ - print number of uploaded artifacts
22
+ - print access mode for uploaded artifacts
10
23
 
11
24
  # 0.4.1
12
25
 
@@ -19,19 +32,19 @@ global.testomatioArtifacts.push('file/to/upload.png');
19
32
 
20
33
  # 0.4.0
21
34
 
22
- * Playwright: Introduced playwright/test support with screenshots and video artifacts
35
+ - Playwright: Introduced playwright/test support with screenshots and video artifacts
23
36
 
24
37
  > Known issues: reporting using projects configured in Playwright does not work yet
25
38
 
26
- * CodeceptJS: added video uploads
39
+ - CodeceptJS: added video uploads
27
40
 
28
41
  # 0.3.16
29
42
 
30
- * CodeceptJS: fixed reporting tests with empty steps (on retry)
43
+ - CodeceptJS: fixed reporting tests with empty steps (on retry)
31
44
 
32
45
  # 0.3.15
33
46
 
34
- * Finish Run via API:
47
+ - Finish Run via API:
35
48
 
36
49
  ```
37
50
  TESTOMATIO={apiKey} TESTOMATIO_RUN={runId} npx @testomatio/reporter@latest --finish
@@ -39,7 +52,7 @@ TESTOMATIO={apiKey} TESTOMATIO_RUN={runId} npx @testomatio/reporter@latest --fin
39
52
 
40
53
  # 0.3.14
41
54
 
42
- * Create an empty Run via API:
55
+ - Create an empty Run via API:
43
56
 
44
57
  ```
45
58
  TESTOMATIO={apiKey} npx @testomatio/reporter@latest --launch
@@ -47,14 +60,14 @@ TESTOMATIO={apiKey} npx @testomatio/reporter@latest --launch
47
60
 
48
61
  # 0.3.13
49
62
 
50
- * Checking for a valid report URL
51
- * Sending unlimited data on test report
63
+ - Checking for a valid report URL
64
+ - Sending unlimited data on test report
52
65
 
53
66
  # 0.3.12
54
67
 
55
- * Fixed submitting arbitrary data on a test run
56
- * Jest: fixed sending errors with stack traces
57
- * Cypress: fixed sending reports
68
+ - Fixed submitting arbitrary data on a test run
69
+ - Jest: fixed sending errors with stack traces
70
+ - Cypress: fixed sending reports
58
71
 
59
72
  # 0.3.11
60
73
 
package/README.md CHANGED
@@ -1,60 +1,64 @@
1
1
  # @testomatio/reporter
2
2
 
3
- Send test run reports to your testomat.io project. Get the API key from testomat.
3
+ Library for sending test run reports to your [testomat.io](https://testomat.io) project.
4
4
 
5
- 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)
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
- ## CodeceptJS
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
- ```js
31
+ ```javascript
26
32
  plugins: {
27
33
  testomatio: {
28
34
  enabled: true,
29
35
  require: '@testomatio/reporter/lib/adapter/codecept',
30
- apiKey: process.env.API_KEY || 'API_KEY', // pass in api key via config or env variable
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
- > **Get the API_KEY from your testomat console**
41
+ Run the following command from you project folder:
36
42
 
37
- Run tests with
38
-
39
- ```
40
- TESTOMATIO=<API_KEY> npx codeceptjs run`
43
+ ```bash
44
+ TESTOMATIO={API_KEY} npx codeceptjs run
41
45
  ```
42
46
 
43
- ### CodeceptJS Parallel Run
47
+ #### CodeceptJS Parallel Run
44
48
 
45
- If tests run parallel, like workers in codeceptJS use `start-test-run` command to get proper reports
49
+ If tests run parallel, like workers in CodeceptJS use `start-test-run` command to get proper reports:
46
50
 
47
- ```
48
- TESTOMATIO=<API_KEY> npx start-test-run -c 'npx codeceptjs run-workers 2'
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
- ## Playwright
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
- Execute tests providing Api Key as TESTOMATIO environment variables:
70
+ Run the following command from you project folder:
67
71
 
68
- ```
69
- TESTOMATIO=<API_KEY> npx playwright test
72
+ ```bash
73
+ TESTOMATIO={API_KEY} npx playwright test
70
74
  ```
71
75
 
72
- ## Mocha
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
- run the following command from you project folder
80
+ Run the following command from you project folder:
77
81
 
78
- ```sh
79
- mocha --reporter ./node_modules/testomat-reporter/lib/adapter/mocha.js --reporter-options apiKey=API_KEY
82
+ ```bash
83
+ mocha --reporter ./node_modules/testomat-reporter/lib/adapter/mocha.js --reporter-options apiKey={API_KEY}
80
84
  ```
81
85
 
82
- ## Jest
86
+ ### Jest
83
87
 
84
- 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)
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
- `reporters: ['default', ['../../lib/adapter/jest.js', { apiKey: API_KEY }]],`
92
+ ```javascript
93
+ reporters: ['default', ['../../lib/adapter/jest.js', { apiKey: {API_KEY} }]],
94
+ ```
89
95
 
90
96
  Run your tests.
91
97
 
92
- ## Cucumber
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 cucumber test with this formatter and API key in environment in `TESTOMATIO`
102
+ Run the following command from you project folder:
97
103
 
98
- ```sh
99
- TESTOMATIO=api_key ./node_modules/.bin/cucumber-js --format ./node_modules/@testomatio/reporter/lib/adapter/cucumber.js
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
- ## TestCafe
108
+ ### TestCafe
103
109
 
104
- Load the test using using `check-test` .
110
+ Load the test using using `check-test`.
105
111
 
106
- run the following command from you project folder
112
+ Run the following command from you project folder:
107
113
 
108
- ```sh
109
- TESTOMATIO={apiKey} npx testcafe chrome -r testomatio
114
+ ```bash
115
+ TESTOMATIO={API_KEY} npx testcafe chrome -r testomatio
110
116
  ```
111
117
 
112
- ## Protractor
118
+ ### Cypress
119
+
120
+ Load the test using using `check-test`.
113
121
 
114
- Load the test using using `check-test` .
122
+ Register our `cypress-plugin` in `cypress/plugins/index.js`:
115
123
 
116
- Add the following line to [conf.js](https://github.com/angular/protractor/blob/5.4.1/example/conf.js)
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
- ```js
119
- const JasmineReporter = require("@testomatio/reporter/lib/adapter/jasmine");
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
- run the following command from you project folder
162
+ Run the following command from you project folder:
131
163
 
132
- ```sh
133
- TESTOMATIO={apiKey} npx @testomatio/reporter@latest -c 'npx protractor conf.js'
164
+ ```bash
165
+ TESTOMATIO={API_KEY} npx @testomatio/reporter@latest -c 'npx protractor conf.js'
134
166
  ```
135
167
 
136
- # Advanced Usage
168
+ ## Advanced Usage
137
169
 
138
- ## Adding Report to Run by ID
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 ID of a run:
174
+ a report is assigned to that run using `TESTOMATIO_RUN` environment variable and `{RUN_ID}` of a run:
143
175
 
144
- ```sh
145
- TESTOMATIO={apiKey} TESTOMATIO_RUN={runId} <actual run command>
176
+ ```bash
177
+ TESTOMATIO={API_KEY} TESTOMATIO_RUN={RUN_ID} <actual run command>
146
178
  ```
147
179
 
148
- ## Setting Report Title
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
- ```sh
153
- TESTOMATIO={apiKey} TESTOMATIO_TITLE="title for the report" <actual run command>
184
+ ```bash
185
+ TESTOMATIO={API_KEY} TESTOMATIO_TITLE="title for the report" <actual run command>
154
186
  ```
155
187
 
156
- ## Adding Report to RunGroup
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={apiKey} TESTOMATIO_RUNGROUP_TITLE="Build ${BUILD_ID}" <actual run command>
193
+ TESTOMATIO={API_KEY} TESTOMATIO_RUNGROUP_TITLE="Build ${BUILD_ID}" <actual run command>
162
194
  ```
163
195
 
164
- ## Adding Environments to Run
196
+ ### Adding Environments to Run
165
197
 
166
198
  Add environments to run by providing `TESTOMATIO_ENV` as comma seperated values:
167
199
 
168
- ```sh
169
- TESTOMATIO={apiKey} TESTOMATIO_ENV="Windows, Chrome" <actual run command>
200
+ ```bash
201
+ TESTOMATIO={API_KEY} TESTOMATIO_ENV="Windows, Chrome" <actual run command>
170
202
  ```
171
203
 
172
- ## Attaching Test Artifacts
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 Testomat.io to display images and videos.
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 Testomat.io project,
192
- so Testomat.io could connect to the same bucket and fetch uploaded artifacts.
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
- * CodeceptJS
238
- * Playwright
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
- ```js
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
- ## Starting an Empty Run
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
- If you want to create a run and obtain its RunID from Testomat.io you can use `--launch` option:
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 RunID which you can pass to other testrunner processes.
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
- ## Manually Finishing Run
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
- ```sh
275
- TESTOMATIO={apiKey} TESTOMATIO_RUN={runId} npx @testomatio/reporter@latest --finish
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: "./*_test.js",
3
- output: "./output",
2
+ tests: './*_test.js',
3
+ output: './output',
4
4
  helpers: {
5
5
  Puppeteer: {
6
- url: "http://localhost",
6
+ url: 'http://localhost',
7
7
  show: true,
8
8
  },
9
9
  },
10
10
  include: {
11
- I: "./steps_file.js",
11
+ I: './steps_file.js',
12
12
  },
13
13
  bootstrap: null,
14
14
  mocha: {},
15
- name: "codecept",
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: "../../lib/adapter/codecept",
26
- apiKey: "lz8ea4948ud5",
25
+ require: '../../lib/adapter/codecept',
26
+ apiKey: 'lz8ea4948ud5',
27
27
  },
28
28
  },
29
29
  };
@@ -1,10 +1,10 @@
1
- Feature("Suite 1 @S25e19ba9");
1
+ Feature('Suite 1 @S25e19ba9');
2
2
 
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");
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("Suite 2 @S2bf55e11");
1
+ Feature('Suite 2 @S2bf55e11');
2
2
 
3
- Scenario("Test for suite 2 @Tc2171bd2", (I) => {
4
- I.amOnPage("https://github.com/login");
5
- I.see("GitHub");
3
+ Scenario('Test for suite 2 @Tc2171bd2', I => {
4
+ I.amOnPage('https://github.com/login');
5
+ I.see('GitHub');
6
6
  });
@@ -1,5 +1,5 @@
1
1
  /// <reference types='codeceptjs' />
2
- type steps_file = typeof import("./steps_file.js");
2
+ type steps_file = typeof import('./steps_file.js');
3
3
 
4
4
  declare namespace CodeceptJS {
5
5
  interface SupportObject {
@@ -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
+ }
@@ -1,14 +1,14 @@
1
- const { TestomatClient, TRConstants } = require("testomat-reporter");
1
+ const { TestomatClient, TRConstants } = require('testomat-reporter');
2
2
 
3
- const client = new TestomatClient({ apiKey: "l5x5d5cd6pc3" });
3
+ const client = new TestomatClient({ apiKey: 'l5x5d5cd6pc3' });
4
4
 
5
5
  client
6
6
  .createRun()
7
7
  .then(async () => {
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");
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
  })