Skip to content
Open
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
19 changes: 13 additions & 6 deletions .github/workflows/CI-pipeline.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2024 EPAM Systems
# Copyright 2025 EPAM Systems
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
Expand All @@ -22,6 +22,9 @@ on:
- README.md
- CHANGELOG.md
pull_request:
branches:
- develop
- master
paths-ignore:
- README.md
- CHANGELOG.md
Expand All @@ -31,14 +34,18 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
uses: actions/checkout@v5

- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: 20
- name: Install of node dependencies
node-version: 24

- name: Install dependencies
run: npm install

- name: Run lint
run: npm run lint

- name: Run tests and check coverage
run: npm run test:coverage
29 changes: 15 additions & 14 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2024 EPAM Systems
# Copyright 2025 EPAM Systems
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
Expand All @@ -17,17 +17,21 @@ on:
repository_dispatch:
types: [version-released]

permissions:
id-token: write # Required for NPM OIDC
contents: write

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
uses: actions/checkout@v5
- name: Set up Node.js
uses: actions/setup-node@v4
uses: actions/setup-node@v6
with:
node-version: 20
- name: Install of node dependencies
node-version: 24
- name: Install dependencies
run: npm install
- name: Run lint
run: npm run lint
Expand All @@ -39,25 +43,22 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
uses: actions/checkout@v5
- name: Set up Node.js
uses: actions/setup-node@v4
uses: actions/setup-node@v6
with:
node-version: 20
node-version: 24
registry-url: 'https://registry.npmjs.org'
- name: Install of node dependencies
- name: Install dependencies
run: npm install
- name: Publish to NPM
run: |
npm config set //registry.npmjs.org/:_authToken=$NODE_AUTH_TOKEN
npm config list
npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }}
- name: Set up Node.js
uses: actions/setup-node@v4
uses: actions/setup-node@v6
with:
node-version: 20
node-version: 24
registry-url: 'https://npm.pkg.github.com'
scope: '@reportportal'
- name: Publish to GPR
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2024 EPAM Systems
# Copyright 2025 EPAM Systems
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
Expand Down Expand Up @@ -33,7 +33,7 @@ jobs:
releaseVersion: ${{ steps.exposeVersion.outputs.releaseVersion }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
uses: actions/checkout@v5
- name: Read version
id: readVersion
run: |
Expand Down Expand Up @@ -78,9 +78,9 @@ jobs:
versionInfo: ${{ steps.readChangelogEntry.outputs.log_entry }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
uses: actions/checkout@v5
- name: Setup NodeJS
uses: actions/setup-node@v4
uses: actions/setup-node@v6
with:
node-version: '12'
- name: Configure git
Expand Down Expand Up @@ -139,7 +139,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
uses: actions/checkout@v5
- name: Create Release
id: createRelease
uses: actions/create-release@v1
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
### Added
- Support for custom log methods with flexible log levels beyond the predefined ones (INFO, ERROR, DEBUG, TRACE, FATAL, WARN). Check the [Logs](README.md#Logs) section in the README for detailed usage examples.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's wait for the client release.


## [5.6.1] - 2025-10-21
### Added
Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,11 @@ Then(/^I should see my new task in the list$/, function() {
});
```

Custom log methods with flexible log levels:
- `log(message, level)` - Log to items with any predefined or custom log level
- `launchLog(message, level)` - Log to launch with any predefined or custom log level
- `scenarioLog(message, level)` - Log to scenario with any predefined or custom log level

### Attributes

Attributes for features and scenarios are parsed from @tags as `@key:value` pair.
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5.6.1
5.6.2-SNAPSHOT
4 changes: 2 additions & 2 deletions modules/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const STATUSES = {
AMBIGUOUS: 'ambiguous',
};

const LOG_LEVELS = {
const PREDEFINED_LOG_LEVELS = {
INFO: 'INFO',
ERROR: 'ERROR',
DEBUG: 'DEBUG',
Expand Down Expand Up @@ -100,7 +100,7 @@ const TEST_STEP_FINISHED_RP_MESSAGES = {
module.exports = {
RP_ENTITIES,
STATUSES,
LOG_LEVELS,
PREDEFINED_LOG_LEVELS,
CUCUMBER_EVENTS,
RP_EVENTS,
CUCUMBER_MESSAGES,
Expand Down
36 changes: 18 additions & 18 deletions modules/cucumber-reportportal-formatter.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const pjson = require('../package.json');
const {
RP_EVENTS,
RP_ENTITIES,
LOG_LEVELS,
PREDEFINED_LOG_LEVELS,
STATUSES,
CUCUMBER_MESSAGES,
TEST_STEP_FINISHED_RP_MESSAGES,
Expand All @@ -38,10 +38,16 @@ const createRPFormatterClass = (config) =>

this.options = options;
this.config = config;
this.reportportal = new ReportPortalClient(config, {
name: pjson.name,
version: pjson.version,
});
this.reportportal = new ReportPortalClient(
{
...config,
skippedIsNotIssue: config.skippedIssue === false,
},
{
name: pjson.name,
version: pjson.version,
},
);
const { rerun, rerunOf } = options.parsedArgvOptions || {};
this.isRerun = rerun || config.rerun;
this.rerunOf = rerunOf || config.rerunOf;
Expand Down Expand Up @@ -105,10 +111,6 @@ const createRPFormatterClass = (config) =>
...(this.config.attributes || []),
{ key: 'agent', value: `${pjson.name}|${pjson.version}`, system: true },
];
if (this.config.skippedIssue === false) {
const skippedIssueAttribute = { key: 'skippedIssue', value: 'false', system: true };
attributes.push(skippedIssueAttribute);
}
const startLaunchData = {
name: this.config.launch,
startTime: clientHelpers.now(),
Expand Down Expand Up @@ -412,7 +414,7 @@ const createRPFormatterClass = (config) =>
tempId = this.storage.getScenarioTempId(testCaseId);
}
} else {
request.level = LOG_LEVELS.DEBUG;
request.level = PREDEFINED_LOG_LEVELS.DEBUG;
request.message = data.body;
}
this.reportportal.sendLog(tempId, request);
Expand All @@ -422,7 +424,7 @@ const createRPFormatterClass = (config) =>
const fileName = 'file'; // TODO: generate human valuable file name here if possible
const request = {
time: clientHelpers.now(),
level: LOG_LEVELS.INFO,
level: PREDEFINED_LOG_LEVELS.INFO,
message: fileName,
file: {
name: fileName,
Expand Down Expand Up @@ -471,7 +473,7 @@ const createRPFormatterClass = (config) =>
case STATUSES.PENDING: {
this.reportportal.sendLog(tempStepId, {
time: clientHelpers.now(),
level: LOG_LEVELS.WARN,
level: PREDEFINED_LOG_LEVELS.WARN,
message: TEST_STEP_FINISHED_RP_MESSAGES.PENDING,
});
status = STATUSES.FAILED;
Expand All @@ -480,7 +482,7 @@ const createRPFormatterClass = (config) =>
case STATUSES.UNDEFINED: {
this.reportportal.sendLog(tempStepId, {
time: clientHelpers.now(),
level: LOG_LEVELS.ERROR,
level: PREDEFINED_LOG_LEVELS.ERROR,
message: TEST_STEP_FINISHED_RP_MESSAGES.UNDEFINED,
});
status = STATUSES.FAILED;
Expand All @@ -489,7 +491,7 @@ const createRPFormatterClass = (config) =>
case STATUSES.AMBIGUOUS: {
this.reportportal.sendLog(tempStepId, {
time: clientHelpers.now(),
level: LOG_LEVELS.ERROR,
level: PREDEFINED_LOG_LEVELS.ERROR,
message: TEST_STEP_FINISHED_RP_MESSAGES.AMBIGUOUS,
});
status = STATUSES.FAILED;
Expand All @@ -503,7 +505,7 @@ const createRPFormatterClass = (config) =>
status = STATUSES.FAILED;
this.reportportal.sendLog(tempStepId, {
time: clientHelpers.now(),
level: LOG_LEVELS.ERROR,
level: PREDEFINED_LOG_LEVELS.ERROR,
message: stripAnsi(testStepResult.message),
});

Expand All @@ -518,7 +520,7 @@ const createRPFormatterClass = (config) =>

const request = {
time: clientHelpers.now(),
level: LOG_LEVELS.ERROR,
level: PREDEFINED_LOG_LEVELS.ERROR,
file: { name: screenshotName },
message: screenshotName,
};
Expand Down Expand Up @@ -551,13 +553,11 @@ const createRPFormatterClass = (config) =>
const descriptionToSend = errorMessage
? `${description}${description ? '\n' : ''}${errorMessage}`
: description;
const withoutIssue = status === STATUSES.SKIPPED && this.config.skippedIssue === false;
this.reportportal.finishTestItem(tempStepId, {
...(status && { status }),
...(attributes && { attributes }),
...(descriptionToSend && { description: descriptionToSend }),
...(customTestCaseId && { testCaseId: customTestCaseId }),
...(withoutIssue && { issue: { issueType: 'NOT_ISSUE' } }),
endTime: clientHelpers.now(),
});
}
Expand Down
Loading