Skip to content

Commit

Permalink
Merge pull request #148 from reportportal/EPMRPP-84876-add-cucumber-9…
Browse files Browse the repository at this point in the history
…-support

EPMRPP-84876 || Add cucumber 9 support
  • Loading branch information
AmsterGet authored Jul 18, 2023
2 parents 90935ea + 5c87774 commit 212b7b4
Show file tree
Hide file tree
Showing 4 changed files with 73 additions and 54 deletions.
6 changes: 2 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
### Added
- Add `@cucumber/cucumber` version 9 support. Addressed [147](https://github.com/reportportal/agent-js-cucumber/issues/147).
### Changed
- `token` configuration option was renamed to `apiKey` to maintain common convention.
- `@reportportal/client-javascript` bumped to version `5.0.12`.
Expand All @@ -20,28 +22,24 @@
## [5.1.0] - 2022-11-29
### Added
- Added support for 7-8 versions of `@cucumber/cucumber` package

### Updated
- `@reportportal/client-javascript` version to the latest

## [5.0.2] - 2021-06-23
### Fixed
- Launch status calculation

### Updated
- `@reportportal/client-javascript` version to the latest

## [5.0.1] - 2020-11-04
### Fixed
- [#66](https://github.com/reportportal/agent-js-cucumber/issues/66) Incorrect calculation of test status
- Lots of other bugs

### Updated
- `@reportportal/client-javascript` version to the latest

## [5.0.0] - 2020-08-28
### Added
- Full compatibility with ReportPortal version 5.* (see [reportportal releases](https://github.com/reportportal/reportportal/releases))

### Deprecated
- Previous package versions (`reportportal-agent-cucumber`, `agent-js-cucumber`) will no longer supported by reportportal.io
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Agent to integrate CucumberJS with ReportPortal.
* More about [CucumberJS](https://cucumber.io/docs/installation/javascript/)
* More about [ReportPortal](http://reportportal.io/)

This agent works well with cucumber versions from 7.x.
This agent works well with cucumber versions from 7.x to 9.x.
Documentation for legacy cucumber versions from 4.x to 6.x can be found [here](/modules/api/deprecated/README.md)

## Install agent to your project dir
Expand All @@ -31,14 +31,14 @@ npm install --save-dev @reportportal/agent-js-cucumber
#### Note
Protractor and Cucumber have their own **timeouts** .
When protractror start main process that lauches cucumber it would have different timeouts if there not the same they would wait for scripts different time.
If cucumbers's timeout less then protractor's it would through wrong exeption.
When protractor start main process that launches cucumber it would have different timeouts if they are not the same they would wait for scripts different time.
If cucumber's timeout less than protractor's it would through wrong exception.
For example if page that has been loaded and hasn't got angular, the next error would be thrown : `Error: function timed out after 10000 milliseconds . . .` . Instead of protractor's :
`Error: Error while running testForAngular: asynchronous script timeout: result was not received in 4 seconds . . .` .
So it must be handled manually by setting cucumbers's timeout greater then protractor's is at the hooks.js. For example if you set up protractor's timeout 9000 miliseconds , so cucumber must be at least 1 second greater = 10000 miliseconds. Example :
So it must be handled manually by setting cucumber's timeout greater than protractor's is at the hooks.js. For example if you set up protractor's timeout 9000 miliseconds , so cucumber must be at least 1 second greater = 10000 miliseconds. Example :
```javascript
var { setDefaultTimeout } = require('cucumber');
var { setDefaultTimeout } = require('@cucumber/cucumber');
setDefaultTimeout(10000);
```
Expand Down Expand Up @@ -73,7 +73,7 @@ The full list of available options presented below.
| project | Required | | The name of the project in which the launches will be created. |
| attributes | Optional | [] | Launch attributes. |
| description | Optional | '' | Launch description. |
| rerun | Optional | false | Enable [rerun](https://github.com/reportportal/documentation/blob/master/src/md/src/DevGuides/rerun.md) |
| rerun | Optional | false | Enable [rerun](https://reportportal.io/docs/dev-guides/RerunDevelopersGuide) |
| rerunOf | Optional | Not set | UUID of launch you want to rerun. If not specified, reportportal will update the latest launch with the same name |
| mode | Optional | 'DEFAULT' | Results will be submitted to Launches page <br/> *'DEBUG'* - Results will be submitted to Debug page. |
| skippedIssue | Optional | true | reportportal provides feature to mark skipped tests as not 'To Investigate'. <br/> Option could be equal boolean values: <br/> *true* - skipped tests considered as issues and will be marked as 'To Investigate' on reportportal. <br/> *false* - skipped tests will not be marked as 'To Investigate' on application. |
Expand Down
104 changes: 63 additions & 41 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"version": "5.2.1",
"description": "Agent that connects cucumber-js with Report Portal",
"main": "./modules/index",
"spec": "cucumber version >=4.x <=8.x",
"scripts": {
"lint": "eslint ./modules/**/*.js",
"format": "npm run lint -- --fix",
Expand All @@ -19,7 +18,7 @@
"node": ">=10.x"
},
"devDependencies": {
"@cucumber/cucumber": "^8.11.1",
"@cucumber/cucumber": "^9.3.0",
"@types/jest": "^29.4.0",
"eslint": "^6.8.0",
"eslint-config-airbnb-base": "^14.2.1",
Expand All @@ -33,7 +32,7 @@
},
"peerDependencies": {
"cucumber": "4.x - 6.x",
"@cucumber/cucumber": "7.x - 8.x"
"@cucumber/cucumber": "7.x - 9.x"
},
"repository": {
"type": "git",
Expand Down

0 comments on commit 212b7b4

Please sign in to comment.