Skip to content

Commit 8caadfd

Browse files
Initial plugin
1 parent 6782f9f commit 8caadfd

File tree

6 files changed

+4126
-0
lines changed

6 files changed

+4126
-0
lines changed

.eslintrc.js

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
module.exports = {
2+
env: {
3+
commonjs: true,
4+
es6: true,
5+
node: true,
6+
},
7+
extends: [
8+
'airbnb-base',
9+
],
10+
globals: {
11+
Given: 'readonly',
12+
When: 'readonly',
13+
Then: 'readonly',
14+
Before: 'readonly',
15+
After: 'readonly',
16+
inject: 'readonly',
17+
codeceptjs: 'readonly',
18+
codecept_helper: 'readonly',
19+
output_dir: 'readonly',
20+
pause: 'readonly',
21+
Feature: 'readonly',
22+
Scenario: 'readonly',
23+
locate: 'readonly',
24+
within: 'readonly',
25+
Atomics: 'readonly',
26+
SharedArrayBuffer: 'readonly',
27+
},
28+
parser: 'babel-eslint',
29+
rules: {
30+
'no-await-in-loop': 0,
31+
'no-plusplus': 0,
32+
'max-len': ['error', { code: 120 }],
33+
'no-underscore-dangle': 0,
34+
'import/no-extraneous-dependencies': ['error', { devDependencies: true }],
35+
},
36+
};

.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
node_modules
2+
output
3+
.vscode
4+
test

README.md

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# codeceptjs-cucumber-json-reporter
2+
3+
### CodeceptJS plugin to generate cucumber json output file to be consumed by cucumber-html-reporter or similar packages
4+
---
5+
## Requirements
6+
- CodeceptJS v3.0.5 or higher
7+
---
8+
9+
## Installation
10+
```
11+
npm i codeceptjs-cucumber-json-reporter
12+
```
13+
14+
---
15+
## Configuration
16+
17+
- Add plugin in your `codecept.conf.js`
18+
```
19+
plugins: {
20+
cucumberJsonReporter: {
21+
require: 'codeceptjs-cucumber-json-reporter',
22+
enabled: true,
23+
},
24+
}
25+
```
26+
27+
---
28+
## Usage
29+
30+
When the plugin is enabled, run your test as you normally would (parallelized runs not tests).
31+
32+
The plugin parses the BDD feature file before the start of each feature and generates the report structure. Once the test starts, it uses event listeners to add runtime data such as step status (pass/fail), screenshot embeddings, comment embeddings, and errors.
33+
34+
- Attach screenshots to your report by using `I.saveScreenshot` method on the available helpers.
35+
- Attach comments to your report by using `I.say` method in codeceptjs for logging comments.
36+
37+
38+
`cucumber_output.json` generated in your output folder on run completion.
39+
40+
Some additional logging added when running `--verbose` to debug potential issues
41+
42+
---
43+
## Html Report
44+
45+
Use `cucumber-html-reporter` or other similar html reporters to generate your pretty html report using the `cucumber_output.json` file.
46+
47+
---
48+
## Limitations
49+
- CodeceptJS treats BDD steps as metasteps. Therefore if your step definition does not contain any helper methods it only fires bddStep events which are limited in what information we can extract.
50+
- Not tested with parallelized/multiple worker runs

0 commit comments

Comments
 (0)