Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 5.5.0 #170

Merged
merged 11 commits into from
Oct 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/CI-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ on:
- README.md
- CHANGELOG.md
pull_request:
paths-ignore:
- README.md
- CHANGELOG.md

jobs:
test:
Expand Down
13 changes: 10 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
### Added
- `@cucumber/cucumber` version 11 support. Addressed [169](https://github.com/reportportal/agent-js-cucumber/issues/169).
### Changed
- **Breaking change** Drop support of Node.js 12. The version [5.4.0](https://github.com/reportportal/agent-js-cucumber/releases/tag/v5.4.0) is the latest that supports it.
- The agent now supports reporting the time for launches, test items and logs with microsecond precision in the ISO string format.
For logs, microsecond precision is available on the UI from ReportPortal version 24.2.
- `@reportportal/client-javascript` bumped to version `5.3.0`.

## [5.4.0] - 2024-07-17
### Added
Expand All @@ -17,7 +24,7 @@

## [5.3.0] - 2024-02-07
### Added
- Add `@cucumber/cucumber` version 10 support. Addressed [155](https://github.com/reportportal/agent-js-cucumber/issues/155).
- `@cucumber/cucumber` version 10 support. Addressed [155](https://github.com/reportportal/agent-js-cucumber/issues/155).
### Changed
- **Breaking change** Drop support of cucumber <7. Addressed [153](https://github.com/reportportal/agent-js-cucumber/issues/153).
- **Breaking change** Drop support of Node.js 10. The version [5.2.3](https://github.com/reportportal/agent-js-cucumber/releases/tag/v5.2.3) is the latest that supports it.
Expand All @@ -33,7 +40,7 @@

## [5.2.2] - 2023-07-18
### Added
- Add `@cucumber/cucumber` version 9 support. Addressed [147](https://github.com/reportportal/agent-js-cucumber/issues/147).
- `@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 @@ -55,7 +62,7 @@

## [5.1.0] - 2022-11-29
### Added
- Added support for 7-8 versions of `@cucumber/cucumber` package
- `@cucumber/cucumber` versions 7-8 support.
### Updated
- `@reportportal/client-javascript` version to the latest

Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ Agent to integrate CucumberJS with ReportPortal.
* More about [CucumberJS](https://cucumber.io/docs/installation/javascript/)
* More about [ReportPortal](http://reportportal.io/)

This agent works with cucumber versions from 7.x to 10.x.
This agent works with Cucumber versions from 7.x to 11.x.
See [release notes](https://github.com/reportportal/agent-js-cucumber/releases) for the detailed versions description.

## Install the agent to your project dir

Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5.4.0
5.4.1-SNAPSHOT
35 changes: 18 additions & 17 deletions modules/cucumber-reportportal-formatter.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*/

const ReportPortalClient = require('@reportportal/client-javascript');
const clientHelpers = require('@reportportal/client-javascript/lib/helpers');
const { Formatter } = require('@cucumber/cucumber');
const stripAnsi = require('strip-ansi');
const utils = require('./utils');
Expand Down Expand Up @@ -110,7 +111,7 @@ const createRPFormatterClass = (config) =>
}
const startLaunchData = {
name: this.config.launch,
startTime: this.reportportal.helpers.now(),
startTime: clientHelpers.now(),
description: this.config.description || '',
attributes,
rerun: this.isRerun,
Expand Down Expand Up @@ -152,7 +153,7 @@ const createRPFormatterClass = (config) =>
const launchTempId = this.storage.getLaunchTempId();
const suiteData = {
name: `${feature.keyword}: ${feature.name}`,
startTime: this.reportportal.helpers.now(),
startTime: clientHelpers.now(),
type: this.isScenarioBasedStatistics ? TEST_ITEM_TYPES.TEST : TEST_ITEM_TYPES.SUITE,
description: (feature.description || '').trim(),
attributes: utils.createAttributes(feature.tags),
Expand All @@ -167,7 +168,7 @@ const createRPFormatterClass = (config) =>
const { tempId, endTime } = this.storage.getFeature(pickleFeatureUri);

this.reportportal.finishTestItem(tempId, {
endTime: endTime || this.reportportal.helpers.now(),
endTime: endTime || clientHelpers.now(),
});

this.storage.deleteFeature(pickleFeatureUri);
Expand Down Expand Up @@ -203,7 +204,7 @@ const createRPFormatterClass = (config) =>
const childrenIds = children.map((child) => child.scenario.id);
const currentNodeCodeRef = utils.formatCodeRef(featureCodeRef, name);
const testData = {
startTime: this.reportportal.helpers.now(),
startTime: clientHelpers.now(),
type: this.isScenarioBasedStatistics ? TEST_ITEM_TYPES.TEST : TEST_ITEM_TYPES.SUITE,
name: `${keyword}: ${name}`,
description,
Expand Down Expand Up @@ -257,7 +258,7 @@ const createRPFormatterClass = (config) =>
: currentNodeCodeRef;
const scenarioAttributes = utils.createAttributes(scenario.tags);
const testData = {
startTime: this.reportportal.helpers.now(),
startTime: clientHelpers.now(),
type: this.isScenarioBasedStatistics ? TEST_ITEM_TYPES.STEP : TEST_ITEM_TYPES.TEST,
name: `${keyword}: ${name}`,
description: scenario.description,
Expand Down Expand Up @@ -311,7 +312,7 @@ const createRPFormatterClass = (config) =>

const stepData = {
name: keyword ? `${keyword} ${name}` : name,
startTime: this.reportportal.helpers.now(),
startTime: clientHelpers.now(),
type,
codeRef,
hasStats: !this.isScenarioBasedStatistics,
Expand Down Expand Up @@ -396,7 +397,7 @@ const createRPFormatterClass = (config) =>

case 'text/plain': {
const request = {
time: this.reportportal.helpers.now(),
time: clientHelpers.now(),
};
let tempId = this.storage.getStepTempId(testStepId);

Expand All @@ -419,7 +420,7 @@ const createRPFormatterClass = (config) =>
default: {
const fileName = 'file'; // TODO: generate human valuable file name here if possible
const request = {
time: this.reportportal.helpers.now(),
time: clientHelpers.now(),
level: LOG_LEVELS.INFO,
message: fileName,
file: {
Expand Down Expand Up @@ -468,7 +469,7 @@ const createRPFormatterClass = (config) =>
}
case STATUSES.PENDING: {
this.reportportal.sendLog(tempStepId, {
time: this.reportportal.helpers.now(),
time: clientHelpers.now(),
level: LOG_LEVELS.WARN,
message: TEST_STEP_FINISHED_RP_MESSAGES.PENDING,
});
Expand All @@ -477,7 +478,7 @@ const createRPFormatterClass = (config) =>
}
case STATUSES.UNDEFINED: {
this.reportportal.sendLog(tempStepId, {
time: this.reportportal.helpers.now(),
time: clientHelpers.now(),
level: LOG_LEVELS.ERROR,
message: TEST_STEP_FINISHED_RP_MESSAGES.UNDEFINED,
});
Expand All @@ -486,7 +487,7 @@ const createRPFormatterClass = (config) =>
}
case STATUSES.AMBIGUOUS: {
this.reportportal.sendLog(tempStepId, {
time: this.reportportal.helpers.now(),
time: clientHelpers.now(),
level: LOG_LEVELS.ERROR,
message: TEST_STEP_FINISHED_RP_MESSAGES.AMBIGUOUS,
});
Expand All @@ -500,7 +501,7 @@ const createRPFormatterClass = (config) =>
case STATUSES.FAILED: {
status = STATUSES.FAILED;
this.reportportal.sendLog(tempStepId, {
time: this.reportportal.helpers.now(),
time: clientHelpers.now(),
level: LOG_LEVELS.ERROR,
message: stripAnsi(testStepResult.message),
});
Expand All @@ -515,7 +516,7 @@ const createRPFormatterClass = (config) =>
const screenshotName = utils.getScreenshotName(astNodesData, step.astNodeIds);

const request = {
time: this.reportportal.helpers.now(),
time: clientHelpers.now(),
level: LOG_LEVELS.ERROR,
file: { name: screenshotName },
message: screenshotName,
Expand Down Expand Up @@ -556,7 +557,7 @@ const createRPFormatterClass = (config) =>
...(descriptionToSend && { description: descriptionToSend }),
...(customTestCaseId && { testCaseId: customTestCaseId }),
...(withoutIssue && { issue: { issueType: 'NOT_ISSUE' } }),
endTime: this.reportportal.helpers.now(),
endTime: clientHelpers.now(),
});
}

Expand Down Expand Up @@ -585,7 +586,7 @@ const createRPFormatterClass = (config) =>
} = this.storage.getScenario(testCaseId);

this.reportportal.finishTestItem(scenarioTempId, {
endTime: this.reportportal.helpers.now(),
endTime: clientHelpers.now(),
...(this.isScenarioBasedStatistics && {
status: scenarioStatus || testCase.status || STATUSES.PASSED,
}),
Expand All @@ -605,7 +606,7 @@ const createRPFormatterClass = (config) =>

if (ruleTempId && isAllRuleChildrenStarted) {
this.reportportal.finishTestItem(ruleTempId, {
endTime: this.reportportal.helpers.now(),
endTime: clientHelpers.now(),
});

this.storage.removeRuleTempIdToTestCase(testCaseStartedId);
Expand All @@ -622,7 +623,7 @@ const createRPFormatterClass = (config) =>
}

const { uri: pickleFeatureUri } = this.storage.getPickle(testCase.pickleId);
this.storage.updateFeature(pickleFeatureUri, { endTime: this.reportportal.helpers.now() });
this.storage.updateFeature(pickleFeatureUri, { endTime: clientHelpers.now() });
}

onTestRunFinishedEvent() {
Expand Down
Loading