From 191dae9130fb2f22ed5ff03f6b94c2ddb9565e48 Mon Sep 17 00:00:00 2001 From: "reportportal.io" Date: Tue, 6 Feb 2024 10:58:41 +0000 Subject: [PATCH 01/22] 5.1.0 -> 5.1.1-SNAPSHOT --- VERSION | 2 +- version_fragment | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/VERSION b/VERSION index 831446c..99a2954 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -5.1.0 +5.1.1-SNAPSHOT diff --git a/version_fragment b/version_fragment index acb503f..9eb7b90 100644 --- a/version_fragment +++ b/version_fragment @@ -1 +1 @@ -minor +patch From 3c82c725ee7dc48c87f87ae7a95d275d2a7c342c Mon Sep 17 00:00:00 2001 From: Ilya Date: Tue, 6 Feb 2024 16:27:20 +0300 Subject: [PATCH 02/22] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index cdc5bf2..aa59127 100644 --- a/README.md +++ b/README.md @@ -87,7 +87,7 @@ You may change this behavior to report steps to the log level by enabling scenar - scenario - STEP - step - log item (nested step) -To report your steps as logs, you need to pass an additional parameter to the agent config: `"cucumberNestedSteps": true` +To report scenarios as test cases and steps as logs, you need to pass an additional parameter to the agent config: `"cucumberNestedSteps": true`. ## Reporting From 4729e28463d05e631cb634edbb8d85efceb3ac9f Mon Sep 17 00:00:00 2001 From: Ilya Date: Tue, 6 Feb 2024 16:34:23 +0300 Subject: [PATCH 03/22] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index aa59127..2af0a08 100644 --- a/README.md +++ b/README.md @@ -62,7 +62,7 @@ The full list of available options presented below. | launchUuidPrintOutput | Optional | 'STDOUT' | Launch UUID printing output. Possible values: 'STDOUT', 'STDERR'. Works only if `launchUuidPrint` set to `true`. | | isLaunchMergeRequired | Optional | false | Allows to merge several run's into one launch at the end of the run. Needs additional setup. See [Manual merge launches](#manual-merge-launches). | | attachPicturesToLogs | Optional | false | Automatically add screenshots. | -| cucumberNestedSteps | Optional | false | [Report your steps as logs](https://github.com/reportportal/agent-js-webdriverio#step-reporting-configuration). | +| cucumberNestedSteps | Optional | false | [Report your steps as logs](https://github.com/reportportal/agent-js-webdriverio#step-reporting-configuration-for-cucumber-setup). | | reportSeleniumCommands | Optional | false | Add selenium logs to each test case. | | seleniumCommandsLogLevel | Optional | 'info' | If set *reportSeleniumCommands* to *true*, you need to provide log level witch can be one of: *'trace', 'debug', 'info', 'warn', 'error', 'fatal'*. | | token | Deprecated | Not set | Use `apiKey` instead. | From 23862f93c4b71a7163762b16fb47cd55f593ed29 Mon Sep 17 00:00:00 2001 From: Ilya Date: Tue, 6 Feb 2024 16:36:32 +0300 Subject: [PATCH 04/22] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2af0a08..b35ed18 100644 --- a/README.md +++ b/README.md @@ -160,7 +160,7 @@ Given('I do something awesome', () => { //... }); ``` -> **Note:** Agent is not supported adding attributes to the `scenario`. +> **Note:** The agent does not support adding attributes to the `scenario`. ### setDescription `ReportingApi.setDescription(description: string, suite?: string);` From 41539a634f50dc505b27eb35b39fbaf06092a061 Mon Sep 17 00:00:00 2001 From: Ilya Hancharyk Date: Fri, 1 Mar 2024 19:54:15 +0100 Subject: [PATCH 05/22] EPMRPP-89445 || Add documentation about taking screenshots --- README.md | 80 ++++++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 61 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index b35ed18..3ca08cf 100644 --- a/README.md +++ b/README.md @@ -61,8 +61,8 @@ The full list of available options presented below. | launchUuidPrint | Optional | false | Whether to print the current launch UUID. | | launchUuidPrintOutput | Optional | 'STDOUT' | Launch UUID printing output. Possible values: 'STDOUT', 'STDERR'. Works only if `launchUuidPrint` set to `true`. | | isLaunchMergeRequired | Optional | false | Allows to merge several run's into one launch at the end of the run. Needs additional setup. See [Manual merge launches](#manual-merge-launches). | -| attachPicturesToLogs | Optional | false | Automatically add screenshots. | -| cucumberNestedSteps | Optional | false | [Report your steps as logs](https://github.com/reportportal/agent-js-webdriverio#step-reporting-configuration-for-cucumber-setup). | +| attachPicturesToLogs | Optional | false | Automatically attach screenshots taken within tests execution. See [Screenshots](#screenshots). | +| cucumberNestedSteps | Optional | false | [Report your steps as logs](#cucumber-scenario-based-reporting). | | reportSeleniumCommands | Optional | false | Add selenium logs to each test case. | | seleniumCommandsLogLevel | Optional | 'info' | If set *reportSeleniumCommands* to *true*, you need to provide log level witch can be one of: *'trace', 'debug', 'info', 'warn', 'error', 'fatal'*. | | token | Deprecated | Not set | Use `apiKey` instead. | @@ -73,7 +73,9 @@ The following options can be overridden using ENVIRONMENT variables: |-------------|-----------------| | launchId | RP_LAUNCH_ID | -## Step reporting configuration (for Cucumber setup) +## Structure of reports + +### Cucumber scenario-based reporting By default, this agent reports the following structure: @@ -87,13 +89,52 @@ You may change this behavior to report steps to the log level by enabling scenar - scenario - STEP - step - log item (nested step) -To report scenarios as test cases and steps as logs, you need to pass an additional parameter to the agent config: `"cucumberNestedSteps": true`. +To report scenarios as test cases and steps as logs, you need to pass an additional parameter to the agent config: `cucumberNestedSteps: true`. -## Reporting +## Screenshots -This reporter provides Reporting API to use it directly in tests to send some additional data to the report. +To attach screenshots to the test, the option `attachPicturesToLogs` need to be enabled in the agent config. + +Then, in case the screenshot is taken within the test execution, it will be attached to the test result in ReportPortal automatically. + +### Jasmine/Mocha + +Examples: +```javascript +describe('suite name', () => { + it('Test should be FAILED', async () => { + await browser.url('https://webdriver.io'); + const title = await browser.getTitle(); + await browser.saveScreenshot('./screenshots/screenshot.png'); + + expect(title).toBe('WebdriverIO'); + }); +}); +``` + +### Cucumber -## Using `ReportingApi`: +```javascript +Given('I do something awesome', async () => { + await browser.takeScreenshot(); + assert.strictEqual(this.value, expectedValue); +}); +``` + +It is also may be useful to take the screenshot on test failure in the `afterStep` function for Cucumber in `wdio.conf.js` file: +```javascript +afterStep: async function(step, scenario, { error, result, duration, passed }, context) { + if (!passed) { + await browser.takeScreenshot(); + } +} +``` + +Another way to add any files to the test (not only screenshots) is to use the [ReportingAPI.log() method](#log). + +## Reporting API + +This reporter provides Reporting API to use it directly in tests to send some additional data to the report. To start using the `ReportingApi` in tests, just import it from `'@reportportal/agent-js-webdriverio'`: ```javascript @@ -103,7 +144,7 @@ const { ReportingApi } = require('@reportportal/agent-js-webdriverio'); `ReportingApi.addAttributes(attributes: Array, suite?: string);` **required**: `attributes` -```ts +```typescript interface Attribute { key?: string; value: string; @@ -112,7 +153,7 @@ interface Attribute { Examples: ```javascript -// Jasmine +// Jasmine/Mocha describe('suite name', () => { ReportingApi.addAttributes([ { @@ -168,7 +209,7 @@ Given('I do something awesome', () => { Examples: ```javascript -// Jasmine +// Jasmine/Mocha describe('suite name', () => { ReportingApi.setDescription('suite description', 'suite name'); // the second parameter must match the name of the suite it('test with attributes', () => { @@ -200,7 +241,7 @@ Given('I do something awesome', () => { Examples: ```javascript -// Jasmine +// Jasmine/Mocha describe('suite name', () => { ReportingApi.setTestCaseId('suiteTestCaseId', 'suite name'); // the second parameter must match the name of the suite it('some test', () => { @@ -227,7 +268,7 @@ where `status` must be one of the following: *passed*, *failed*, *stopped*, *ski Examples: ```javascript -// Jasmine +// Jasmine/Mocha describe('should have status FAILED', () => { ReportingApi.setStatus('failed', 'should have status FAILED'); // the second parameter must match the name of the suite it('test with INFO status', () => { @@ -259,7 +300,7 @@ Assign corresponding status to the current test item or suite. Examples: ```javascript -// Jasmine +// Jasmine/Mocha describe('manual statuses assigning', () => { ReportingApi.setStatusInfo('manual statuses assigning'); // string must match the name of the suite it('should call ReportingApi to set statuses', () => { @@ -286,7 +327,7 @@ where `status` must be one of the following: *passed*, *failed*, *stopped*, *ski Examples: ```javascript -// Jasmine +// Jasmine/Mocha it('launch should have status FAILED', () => { ReportingApi.setLaunchStatus('failed'); // ... @@ -313,7 +354,7 @@ Assign corresponding status to the current launch. Examples: ```javascript -// Jasmine +// Jasmine/Mocha it('should call ReportingApi to set launch statuses', () => { ReportingApi.setLaunchStatusInfo(); }); @@ -327,6 +368,7 @@ Given('I do something awesome', () => { ``` ### log + Send logs to report portal for the current test. `ReportingApi.log(level: LOG_LEVELS, message: string, file?: Attachmentm, suite?: string);` **required**: `level`, `message` @@ -334,7 +376,7 @@ where `level` can be one of the following: *TRACE*, *DEBUG*, *WARN*, *INFO*, *ER Examples: ```javascript -// Jasmine +// Jasmine/Mocha it('should contain logs with attachments', () => { const fileName = 'test.jpg'; const fileContent = fs.readFileSync(path.resolve(__dirname, './attachments', fileName)); @@ -360,7 +402,7 @@ Send logs with corresponding level to report portal for the current suite/test. Examples: ```javascript -// Jasmine +// Jasmine/Mocha describe('should containe suite log', () => { ReportingApi.info('Log message', null, 'should containe suite log'); // last parameter must match the name of the suite it('should contain logs with different levels', () => { @@ -384,7 +426,7 @@ where `level` can be one of the following: *TRACE*, *DEBUG*, *WARN*, *INFO*, *ER Examples: ```javascript -// Jasmine +// Jasmine/Mocha it('should contain logs with attachments', async (page) => { const fileName = 'test.jpg'; const fileContent = fs.readFileSync(path.resolve(__dirname, './attachments', fileName)); @@ -409,7 +451,7 @@ Send logs with corresponding level to report portal for the current launch. Shou Examples: ```javascript -// Jasmine +// Jasmine/Mocha it('launch should contain logs with with different levels', () => { ReportingApi.launchInfo('Log message'); ReportingApi.launchDebug('Log message'); From 7eca2e6637c93446f04f5192dffa098d1f59f5eb Mon Sep 17 00:00:00 2001 From: Ilya Hancharyk Date: Fri, 1 Mar 2024 19:58:31 +0100 Subject: [PATCH 06/22] EPMRPP-89445 || Update launchId option description --- README.md | 46 +++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index 3ca08cf..dc2f923 100644 --- a/README.md +++ b/README.md @@ -43,29 +43,29 @@ exports.config = { The full list of available options presented below. -| Option | Necessity | Default | Description | -|--------------------------|------------|-----------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| apiKey | Required | | User's ReportPortal token from which you want to send requests. It can be found on the profile page of this user. | -| endpoint | Required | | URL of your server. For example 'https://server:8080/api/v1'. | -| launch | Required | | Name of launch at creation. | -| 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://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
*'DEBUG'* - Results will be submitted to Debug page. | -| skippedIssue | Optional | true | ReportPortal provides feature to mark skipped tests as not 'To Investigate'.
Option could be equal boolean values:
*true* - skipped tests considered as issues and will be marked as 'To Investigate' on ReportPortal.
*false* - skipped tests will not be marked as 'To Investigate' on application. | -| debug | Optional | false | This flag allows seeing the logs of the client-javascript. Useful for debugging. | -| launchId | Optional | Not set | The _ID_ of an already existing launch. The launch must be in 'IN_PROGRESS' status while the tests are running. Please note that if this _ID_ is provided, the launch will not be finished at the end of the run and must be finished separately. | -| restClientConfig | Optional | Not set | The object with `agent` property for configure [http(s)](https://nodejs.org/api/https.html#https_https_request_url_options_callback) client, may contain other client options eg. [`timeout`](https://github.com/reportportal/client-javascript#timeout-30000ms-on-axios-requests).
Visit [client-javascript](https://github.com/reportportal/client-javascript) for more details. | -| launchUuidPrint | Optional | false | Whether to print the current launch UUID. | -| launchUuidPrintOutput | Optional | 'STDOUT' | Launch UUID printing output. Possible values: 'STDOUT', 'STDERR'. Works only if `launchUuidPrint` set to `true`. | -| isLaunchMergeRequired | Optional | false | Allows to merge several run's into one launch at the end of the run. Needs additional setup. See [Manual merge launches](#manual-merge-launches). | -| attachPicturesToLogs | Optional | false | Automatically attach screenshots taken within tests execution. See [Screenshots](#screenshots). | -| cucumberNestedSteps | Optional | false | [Report your steps as logs](#cucumber-scenario-based-reporting). | -| reportSeleniumCommands | Optional | false | Add selenium logs to each test case. | -| seleniumCommandsLogLevel | Optional | 'info' | If set *reportSeleniumCommands* to *true*, you need to provide log level witch can be one of: *'trace', 'debug', 'info', 'warn', 'error', 'fatal'*. | -| token | Deprecated | Not set | Use `apiKey` instead. | +| Option | Necessity | Default | Description | +|--------------------------|------------|-----------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| apiKey | Required | | User's ReportPortal token from which you want to send requests. It can be found on the profile page of this user. | +| endpoint | Required | | URL of your server. For example 'https://server:8080/api/v1'. | +| launch | Required | | Name of launch at creation. | +| 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://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
*'DEBUG'* - Results will be submitted to Debug page. | +| skippedIssue | Optional | true | ReportPortal provides feature to mark skipped tests as not 'To Investigate'.
Option could be equal boolean values:
*true* - skipped tests considered as issues and will be marked as 'To Investigate' on ReportPortal.
*false* - skipped tests will not be marked as 'To Investigate' on application. | +| debug | Optional | false | This flag allows seeing the logs of the client-javascript. Useful for debugging. | +| launchId | Optional | Not set | The _ID_ of an already existing launch. The launch must be in 'IN_PROGRESS' status while the tests are running. Please note that if this _ID_ is provided, the launch will not be finished at the end of the run and must be finished separately. If this option used, launch related options (eg. description, attributes, rerun, rerunOf, mode) will not take any effect as they are used within launch start. | +| restClientConfig | Optional | Not set | The object with `agent` property for configure [http(s)](https://nodejs.org/api/https.html#https_https_request_url_options_callback) client, may contain other client options eg. [`timeout`](https://github.com/reportportal/client-javascript#timeout-30000ms-on-axios-requests).
Visit [client-javascript](https://github.com/reportportal/client-javascript) for more details. | +| launchUuidPrint | Optional | false | Whether to print the current launch UUID. | +| launchUuidPrintOutput | Optional | 'STDOUT' | Launch UUID printing output. Possible values: 'STDOUT', 'STDERR'. Works only if `launchUuidPrint` set to `true`. | +| isLaunchMergeRequired | Optional | false | Allows to merge several run's into one launch at the end of the run. Needs additional setup. See [Manual merge launches](#manual-merge-launches). | +| attachPicturesToLogs | Optional | false | Automatically attach screenshots taken during test execution. See [Screenshots](#screenshots) for more details. | +| cucumberNestedSteps | Optional | false | [Report Cucumber steps as logs](#cucumber-scenario-based-reporting). | +| reportSeleniumCommands | Optional | false | Add selenium logs to each test case. | +| seleniumCommandsLogLevel | Optional | 'info' | If set *reportSeleniumCommands* to *true*, you need to provide log level witch can be one of: *'trace', 'debug', 'info', 'warn', 'error', 'fatal'*. | +| token | Deprecated | Not set | Use `apiKey` instead. | The following options can be overridden using ENVIRONMENT variables: From bfd85a9abb6147e7c09a006888dfc512b81f8d8c Mon Sep 17 00:00:00 2001 From: Ilya Hancharyk Date: Fri, 1 Mar 2024 20:06:58 +0100 Subject: [PATCH 07/22] EPMRPP-89445 || Add more exampels for Cucumber --- README.md | 76 +++++++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 68 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index dc2f923..231c200 100644 --- a/README.md +++ b/README.md @@ -369,7 +369,7 @@ Given('I do something awesome', () => { ### log -Send logs to report portal for the current test. +Send logs to the ReportPortal for the current test. `ReportingApi.log(level: LOG_LEVELS, message: string, file?: Attachmentm, suite?: string);` **required**: `level`, `message` where `level` can be one of the following: *TRACE*, *DEBUG*, *WARN*, *INFO*, *ERROR*, *FATAL* @@ -390,8 +390,23 @@ it('should contain logs with attachments', () => { }); ``` +```javascript +// Cucumber +Given('I do something awesome', () => { + const fileName = 'test.jpg'; + const fileContent = fs.readFileSync(path.resolve(__dirname, './attachments', fileName)); + const attachment = { + name: fileName, + type: 'image/jpg', + content: fileContent.toString('base64'), + }; + ReportingApi.log('INFO', 'info log with attachment', attachment); + //... +}); +``` + ##### info, debug, warn, error, trace, fatal -Send logs with corresponding level to report portal for the current suite/test. Should be called inside corresponding suite/test. +Send logs with corresponding level to the ReportPortal for the current suite/test. Should be called inside corresponding suite/test. `ReportingApi.info(message: string, file?: Attachment, suite?: string);` `ReportingApi.debug(message: string, file?: Attachment, suite?: string);` `ReportingApi.warn(message: string, file?: Attachment, suite?: string);` @@ -416,10 +431,25 @@ describe('should containe suite log', () => { }); }); ``` + > **Note:** Pay attention if you want to provide log to the `suite` you should pass describe name as a last parameter. +```javascript +// Cucumber +Given('I do something awesome', () => { + ReportingApi.info('Log message'); + ReportingApi.debug('Log message'); + ReportingApi.warn('Log message'); + ReportingApi.error('Log message'); + ReportingApi.trace('Log message'); + ReportingApi.fatal('Log message'); + //... +}); +``` + ### launchLog -Send logs to report portal for the current launch. Should be called inside the any test. + +Send logs to the ReportPortal for the current launch. Should be called inside the any test. `ReportingApi.launchLog(level: LOG_LEVELS, message: string, file?: Attachment);` **required**: `level`, `message` where `level` can be one of the following: *TRACE*, *DEBUG*, *WARN*, *INFO*, *ERROR*, *FATAL* @@ -427,7 +457,7 @@ where `level` can be one of the following: *TRACE*, *DEBUG*, *WARN*, *INFO*, *ER Examples: ```javascript // Jasmine/Mocha -it('should contain logs with attachments', async (page) => { +it('should send log with attachment to launch', async (page) => { const fileName = 'test.jpg'; const fileContent = fs.readFileSync(path.resolve(__dirname, './attachments', fileName)); const attachment = { @@ -435,12 +465,29 @@ it('should contain logs with attachments', async (page) => { type: 'image/jpg', content: fileContent.toString('base64'), }; - ReportingApi.launchLog('INFO', 'info log with attachment', attachment); // this log attaching to the laucnh + ReportingApi.launchLog('INFO', 'info log with attachment', attachment); // attaching log to the launch // ... }); ``` + +```javascript +// Cucumber +Given('I do something awesome', () => { + const fileName = 'test.jpg'; + const fileContent = fs.readFileSync(path.resolve(__dirname, './attachments', fileName)); + const attachment = { + name: fileName, + type: 'image/jpg', + content: fileContent.toString('base64'), + }; + ReportingApi.launchLog('INFO', 'info log with attachment', attachment); // attaching log to the launch + //... +}); +``` + ##### launchInfo, launchDebug, launchWarn, launchError, launchTrace, launchFatal -Send logs with corresponding level to report portal for the current launch. Should be called inside the any test. + +Send logs with corresponding level to the ReportPortal for the current launch. Should be called inside the any test. `ReportingApi.launchInfo(message: string, file?: Attachment);` `ReportingApi.launchDebug(message: string, file?: Attachment);` `ReportingApi.launchWarn(message: string, file?: Attachment);` @@ -453,16 +500,29 @@ Examples: ```javascript // Jasmine/Mocha it('launch should contain logs with with different levels', () => { + ReportingApi.launchInfo('Log message'); + ReportingApi.launchDebug('Log message'); + ReportingApi.launchWarn('Log message'); + ReportingApi.launchError('Log message'); + ReportingApi.launchTrace('Log message'); + ReportingApi.launchFatal('Log message'); + // ... +}); +``` +> **Note:** Pay attention if you want to provide log to the `launch` you should call ReportingApi methods inside test/it blocks. + +```javascript +// Cucumber +Given('I do something awesome', () => { ReportingApi.launchInfo('Log message'); ReportingApi.launchDebug('Log message'); ReportingApi.launchWarn('Log message'); ReportingApi.launchError('Log message'); ReportingApi.launchTrace('Log message'); ReportingApi.launchFatal('Log message'); - // ... + //... }); ``` -> **Note:** Pay attention if you want to provide log to the `launch` you should call ReportingApi methods inside test/it blocks. #### Integration with Sauce Labs From 147fdae81e4e642a95eaffba065cbb61810ec1ef Mon Sep 17 00:00:00 2001 From: Ilya Hancharyk Date: Fri, 1 Mar 2024 20:14:22 +0100 Subject: [PATCH 08/22] EPMRPP-89445 || Add link to examples --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index 231c200..b623179 100644 --- a/README.md +++ b/README.md @@ -73,6 +73,11 @@ The following options can be overridden using ENVIRONMENT variables: |-------------|-----------------| | launchId | RP_LAUNCH_ID | +Within completing the above configuration, you will be able to see the basic test results report in the ReportPortal. +To make the report more informative and to utilize the full power of ReportPortal, the agent provides additional features described below. + +You can also refer the [example-webdriverio](https://github.com/reportportal/examples-js/tree/main/example-webdriverio) example to see how to use the agent with WebdriverIO in action. + ## Structure of reports ### Cucumber scenario-based reporting From 5cf79f3f0dc93142c24542cac521210833b0e31f Mon Sep 17 00:00:00 2001 From: Ilya Date: Fri, 1 Mar 2024 20:15:56 +0100 Subject: [PATCH 09/22] Update CODEOWNERS --- .github/CODEOWNERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 4d58196..2df1f2b 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1 +1 @@ -* @AmsterGet +* @AmsterGet @AliakseiLiasnitski From 5d4e4a48a2e577a84a7f0837b07447e021b88d7b Mon Sep 17 00:00:00 2001 From: Ilya Date: Fri, 1 Mar 2024 20:16:53 +0100 Subject: [PATCH 10/22] Update README.md --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index b623179..3a46c92 100644 --- a/README.md +++ b/README.md @@ -18,8 +18,8 @@ Create `wdio.conf.js` [Testrunner Configuration](https://webdriver.io/docs/confi const { Reporter } = require('@reportportal/agent-js-webdriverio'); const config = { - token: '00000000-0000-0000-0000-00000000000', - endpoint: 'http://your.reportportal.server:8080/api/v1', + apiKey: '00000000-0000-0000-0000-00000000000', + endpoint: 'http://your.reportportal.server:8080/api/v2', project: 'YourReportPortalProjectName', launch: 'YourLauncherName', description: 'Static launch description', @@ -46,7 +46,7 @@ The full list of available options presented below. | Option | Necessity | Default | Description | |--------------------------|------------|-----------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | apiKey | Required | | User's ReportPortal token from which you want to send requests. It can be found on the profile page of this user. | -| endpoint | Required | | URL of your server. For example 'https://server:8080/api/v1'. | +| endpoint | Required | | URL of your server. For example 'https://server:8080/api/v2'. | | launch | Required | | Name of launch at creation. | | project | Required | | The name of the project in which the launches will be created. | | attributes | Optional | [] | Launch attributes. | From 4bb2832f63b8378f2705fb7e6a25959d7ae387bd Mon Sep 17 00:00:00 2001 From: Ilya Hancharyk Date: Fri, 1 Mar 2024 20:22:45 +0100 Subject: [PATCH 11/22] EPMRPP-89445 || Update restClientConfig option description --- README.md | 46 +++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index 3a46c92..fcf9fc0 100644 --- a/README.md +++ b/README.md @@ -43,29 +43,29 @@ exports.config = { The full list of available options presented below. -| Option | Necessity | Default | Description | -|--------------------------|------------|-----------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| apiKey | Required | | User's ReportPortal token from which you want to send requests. It can be found on the profile page of this user. | -| endpoint | Required | | URL of your server. For example 'https://server:8080/api/v2'. | -| launch | Required | | Name of launch at creation. | -| 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://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
*'DEBUG'* - Results will be submitted to Debug page. | -| skippedIssue | Optional | true | ReportPortal provides feature to mark skipped tests as not 'To Investigate'.
Option could be equal boolean values:
*true* - skipped tests considered as issues and will be marked as 'To Investigate' on ReportPortal.
*false* - skipped tests will not be marked as 'To Investigate' on application. | -| debug | Optional | false | This flag allows seeing the logs of the client-javascript. Useful for debugging. | -| launchId | Optional | Not set | The _ID_ of an already existing launch. The launch must be in 'IN_PROGRESS' status while the tests are running. Please note that if this _ID_ is provided, the launch will not be finished at the end of the run and must be finished separately. If this option used, launch related options (eg. description, attributes, rerun, rerunOf, mode) will not take any effect as they are used within launch start. | -| restClientConfig | Optional | Not set | The object with `agent` property for configure [http(s)](https://nodejs.org/api/https.html#https_https_request_url_options_callback) client, may contain other client options eg. [`timeout`](https://github.com/reportportal/client-javascript#timeout-30000ms-on-axios-requests).
Visit [client-javascript](https://github.com/reportportal/client-javascript) for more details. | -| launchUuidPrint | Optional | false | Whether to print the current launch UUID. | -| launchUuidPrintOutput | Optional | 'STDOUT' | Launch UUID printing output. Possible values: 'STDOUT', 'STDERR'. Works only if `launchUuidPrint` set to `true`. | -| isLaunchMergeRequired | Optional | false | Allows to merge several run's into one launch at the end of the run. Needs additional setup. See [Manual merge launches](#manual-merge-launches). | -| attachPicturesToLogs | Optional | false | Automatically attach screenshots taken during test execution. See [Screenshots](#screenshots) for more details. | -| cucumberNestedSteps | Optional | false | [Report Cucumber steps as logs](#cucumber-scenario-based-reporting). | -| reportSeleniumCommands | Optional | false | Add selenium logs to each test case. | -| seleniumCommandsLogLevel | Optional | 'info' | If set *reportSeleniumCommands* to *true*, you need to provide log level witch can be one of: *'trace', 'debug', 'info', 'warn', 'error', 'fatal'*. | -| token | Deprecated | Not set | Use `apiKey` instead. | +| Option | Necessity | Default | Description | +|--------------------------|------------|-----------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| apiKey | Required | | User's ReportPortal token from which you want to send requests. It can be found on the profile page of this user. | +| endpoint | Required | | URL of your server. For example 'https://server:8080/api/v2'. | +| launch | Required | | Name of launch at creation. | +| 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://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
*'DEBUG'* - Results will be submitted to Debug page. | +| skippedIssue | Optional | true | ReportPortal provides feature to mark skipped tests as not 'To Investigate'.
Option could be equal boolean values:
*true* - skipped tests considered as issues and will be marked as 'To Investigate' on ReportPortal.
*false* - skipped tests will not be marked as 'To Investigate' on application. | +| debug | Optional | false | This flag allows seeing the logs of the client-javascript. Useful for debugging. | +| launchId | Optional | Not set | The _ID_ of an already existing launch. The launch must be in 'IN_PROGRESS' status while the tests are running. Please note that if this _ID_ is provided, the launch will not be finished at the end of the run and must be finished separately. If this option used, launch related options (eg. description, attributes, rerun, rerunOf, mode) will not take any effect as they are used within launch start. | +| restClientConfig | Optional | Not set | `axios` like http client [config](https://github.com/axios/axios#request-config). May contain `agent` property for configure [http(s)](https://nodejs.org/api/https.html#https_https_request_url_options_callback) client, and other client options eg. `proxy`, [`timeout`](https://github.com/reportportal/client-javascript#timeout-30000ms-on-axios-requests). For debugging and displaying logs the `debug: true` option can be used.
Visit [client-javascript](https://github.com/reportportal/client-javascript) for more details. | +| launchUuidPrint | Optional | false | Whether to print the current launch UUID. | +| launchUuidPrintOutput | Optional | 'STDOUT' | Launch UUID printing output. Possible values: 'STDOUT', 'STDERR'. Works only if `launchUuidPrint` set to `true`. | +| isLaunchMergeRequired | Optional | false | Allows to merge several run's into one launch at the end of the run. Needs additional setup. See [Manual merge launches](#manual-merge-launches). | +| attachPicturesToLogs | Optional | false | Automatically attach screenshots taken during test execution. See [Screenshots](#screenshots) for more details. | +| cucumberNestedSteps | Optional | false | [Report Cucumber steps as logs](#cucumber-scenario-based-reporting). | +| reportSeleniumCommands | Optional | false | Add selenium logs to each test case. | +| seleniumCommandsLogLevel | Optional | 'info' | If set `reportSeleniumCommands` to `true`, you need to provide log level witch can be one of: *'trace', 'debug', 'info', 'warn', 'error', 'fatal'*. | +| token | Deprecated | Not set | Use `apiKey` instead. | The following options can be overridden using ENVIRONMENT variables: From 980a6cf4e51ba692460fabd154f7b4f8208d11cb Mon Sep 17 00:00:00 2001 From: Ilya Hancharyk Date: Fri, 1 Mar 2024 20:24:43 +0100 Subject: [PATCH 12/22] EPMRPP-89445 || Update configuration summary block --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index fcf9fc0..6325dad 100644 --- a/README.md +++ b/README.md @@ -73,8 +73,8 @@ The following options can be overridden using ENVIRONMENT variables: |-------------|-----------------| | launchId | RP_LAUNCH_ID | -Within completing the above configuration, you will be able to see the basic test results report in the ReportPortal. -To make the report more informative and to utilize the full power of ReportPortal, the agent provides additional features described below. +After completing the above configuration, you will be able to see a basic report of test results in ReportPortal. +To make the report more informative and utilize all features of ReportPortal, the agent provides additional features described below. You can also refer the [example-webdriverio](https://github.com/reportportal/examples-js/tree/main/example-webdriverio) example to see how to use the agent with WebdriverIO in action. From 39f60f32d3b82d863cf0b93647a9f3cc275acb4d Mon Sep 17 00:00:00 2001 From: Ilya Date: Tue, 12 Mar 2024 13:53:49 +0100 Subject: [PATCH 13/22] Update CI-pipeline.yml --- .github/workflows/CI-pipeline.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/CI-pipeline.yml b/.github/workflows/CI-pipeline.yml index a979f2c..b6fea47 100644 --- a/.github/workflows/CI-pipeline.yml +++ b/.github/workflows/CI-pipeline.yml @@ -1,4 +1,4 @@ -# Copyright 2021 EPAM Systems +# Copyright 2024 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 @@ -28,9 +28,9 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up Node.js - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: 18 - name: Install of node dependencies From fe9b2c35303827f508ec93d7b05ef3914c4b2deb Mon Sep 17 00:00:00 2001 From: Ilya Date: Tue, 12 Mar 2024 13:54:11 +0100 Subject: [PATCH 14/22] Update publish.yml --- .github/workflows/publish.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 67cf1e5..c0edc27 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,4 +1,4 @@ -# Copyright 2021 EPAM Systems +# Copyright 2024 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 @@ -22,9 +22,9 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up Node.js - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: 18 - name: Install of node dependencies @@ -41,9 +41,9 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up Node.js - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: 18 registry-url: 'https://registry.npmjs.org' @@ -59,7 +59,7 @@ jobs: env: NODE_AUTH_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }} - name: Set up Node.js - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: 18 registry-url: 'https://npm.pkg.github.com' From 6864ac2abbf2d98519dced944fedc8672d03c45e Mon Sep 17 00:00:00 2001 From: Ilya Date: Tue, 12 Mar 2024 13:54:34 +0100 Subject: [PATCH 15/22] Update release.yml --- .github/workflows/release.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f3e1e55..e126ab9 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,4 +1,4 @@ -# Copyright 2021 EPAM Systems +# Copyright 2024 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 @@ -33,7 +33,7 @@ jobs: releaseVersion: ${{ steps.exposeVersion.outputs.releaseVersion }} steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Read version id: readVersion run: | @@ -78,9 +78,9 @@ jobs: versionInfo: ${{ steps.readChangelogEntry.outputs.log_entry }} steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup NodeJS - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: '12' - name: Configure git @@ -139,7 +139,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Create Release id: createRelease uses: actions/create-release@v1 From b322ed94a98b4eceabc3dab28c0559929cef6599 Mon Sep 17 00:00:00 2001 From: Ilya Date: Thu, 11 Apr 2024 17:49:15 +0200 Subject: [PATCH 16/22] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6325dad..6c26d73 100644 --- a/README.md +++ b/README.md @@ -59,7 +59,7 @@ The full list of available options presented below. | launchId | Optional | Not set | The _ID_ of an already existing launch. The launch must be in 'IN_PROGRESS' status while the tests are running. Please note that if this _ID_ is provided, the launch will not be finished at the end of the run and must be finished separately. If this option used, launch related options (eg. description, attributes, rerun, rerunOf, mode) will not take any effect as they are used within launch start. | | restClientConfig | Optional | Not set | `axios` like http client [config](https://github.com/axios/axios#request-config). May contain `agent` property for configure [http(s)](https://nodejs.org/api/https.html#https_https_request_url_options_callback) client, and other client options eg. `proxy`, [`timeout`](https://github.com/reportportal/client-javascript#timeout-30000ms-on-axios-requests). For debugging and displaying logs the `debug: true` option can be used.
Visit [client-javascript](https://github.com/reportportal/client-javascript) for more details. | | launchUuidPrint | Optional | false | Whether to print the current launch UUID. | -| launchUuidPrintOutput | Optional | 'STDOUT' | Launch UUID printing output. Possible values: 'STDOUT', 'STDERR'. Works only if `launchUuidPrint` set to `true`. | +| launchUuidPrintOutput | Optional | 'STDOUT' | Launch UUID printing output. Possible values: 'STDOUT', 'STDERR', 'FILE', 'ENVIRONMENT'. Works only if `launchUuidPrint` set to `true`. File format: `rp-launch-uuid-${launch_uuid}.tmp`. Env variable: `RP_LAUNCH_UUID`. | | isLaunchMergeRequired | Optional | false | Allows to merge several run's into one launch at the end of the run. Needs additional setup. See [Manual merge launches](#manual-merge-launches). | | attachPicturesToLogs | Optional | false | Automatically attach screenshots taken during test execution. See [Screenshots](#screenshots) for more details. | | cucumberNestedSteps | Optional | false | [Report Cucumber steps as logs](#cucumber-scenario-based-reporting). | From c6f4936df52d352f67fbd400a67defcb1d883cdb Mon Sep 17 00:00:00 2001 From: Ilya Hancharyk Date: Thu, 11 Apr 2024 17:53:23 +0200 Subject: [PATCH 17/22] Bump version of client-javascript --- package-lock.json | 80 ++++++++++++++++++++++++++++++++++++----------- package.json | 2 +- 2 files changed, 62 insertions(+), 20 deletions(-) diff --git a/package-lock.json b/package-lock.json index f31bb48..0635ee8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6,10 +6,10 @@ "packages": { "": { "name": "@reportportal/agent-js-webdriverio", - "version": "5.0.3", + "version": "5.1.0", "license": "Apache-2.0", "dependencies": { - "@reportportal/client-javascript": "^5.1.1", + "@reportportal/client-javascript": "^5.1.3", "@wdio/reporter": "^7.31.1", "json-stringify-safe": "^5.0.1" }, @@ -1306,13 +1306,13 @@ } }, "node_modules/@reportportal/client-javascript": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/@reportportal/client-javascript/-/client-javascript-5.1.1.tgz", - "integrity": "sha512-GgWRODR4twqFkBMSDhsck4JZVeIJPRLMuNjbypnCJXbvZ8JYMJoMk30Mw5M9QGByAFFrpZZ7Ih9pXCsccxscSA==", + "version": "5.1.3", + "resolved": "https://registry.npmjs.org/@reportportal/client-javascript/-/client-javascript-5.1.3.tgz", + "integrity": "sha512-1/utoKnHUgiilR6Ep8pHvuNZGv5oDeI+x1/aJNu8IADoVG1U0Q4tB2trWHDIY07T/PCzrnzp6dVcCu/wLsdVRA==", "dependencies": { - "axios": "^1.6.5", - "axios-retry": "^4.0.0", - "glob": "^7.2.3", + "axios": "^1.6.8", + "axios-retry": "^4.1.0", + "glob": "^8.1.0", "ini": "^2.0.0", "uniqid": "^5.4.0", "uuid": "^9.0.1" @@ -1321,6 +1321,43 @@ "node": ">=12.x" } }, + "node_modules/@reportportal/client-javascript/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/@reportportal/client-javascript/node_modules/glob": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz", + "integrity": "sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==", + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^5.0.1", + "once": "^1.3.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/@reportportal/client-javascript/node_modules/minimatch": { + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", + "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/@sindresorhus/is": { "version": "4.6.0", "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-4.6.0.tgz", @@ -2087,19 +2124,19 @@ } }, "node_modules/axios": { - "version": "1.6.7", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.7.tgz", - "integrity": "sha512-/hDJGff6/c7u0hDkvkGxR/oy6CbCs8ziCsC7SqmhjfozqiJGc8Z11wrv9z9lYfY4K8l+H9TpjcMDX0xOZmx+RA==", + "version": "1.6.8", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.8.tgz", + "integrity": "sha512-v/ZHtJDU39mDpyBoFVkETcd/uNdxrWRrg3bKpOKzXFA6Bvqopts6ALSMU3y6ijYxbw2B+wPrIv46egTzJXCLGQ==", "dependencies": { - "follow-redirects": "^1.15.4", + "follow-redirects": "^1.15.6", "form-data": "^4.0.0", "proxy-from-env": "^1.1.0" } }, "node_modules/axios-retry": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/axios-retry/-/axios-retry-4.0.0.tgz", - "integrity": "sha512-F6P4HVGITD/v4z9Lw2mIA24IabTajvpDZmKa6zq/gGwn57wN5j1P3uWrAV0+diqnW6kTM2fTqmWNfgYWGmMuiA==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/axios-retry/-/axios-retry-4.1.0.tgz", + "integrity": "sha512-svdth4H00yhlsjBbjfLQ/sMLkXqeLxhiFC1nE1JtkN/CIssGxqk0UwTEdrVjwA2gr3yJkAulwvDSIm4z4HyPvg==", "dependencies": { "is-retry-allowed": "^2.2.0" }, @@ -2208,6 +2245,7 @@ "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, "dependencies": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -2495,7 +2533,8 @@ "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==" + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "dev": true }, "node_modules/confusing-browser-globals": { "version": "1.0.11", @@ -3621,9 +3660,9 @@ "dev": true }, "node_modules/follow-redirects": { - "version": "1.15.5", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.5.tgz", - "integrity": "sha512-vSFWUON1B+yAw1VN4xMfxgn5fTUiaOzAJCKBwIIgT/+7CuGy9+r+5gITvP62j3RmaD5Ph65UaERdOSRGUzZtgw==", + "version": "1.15.6", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.6.tgz", + "integrity": "sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA==", "funding": [ { "type": "individual", @@ -3811,6 +3850,7 @@ "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "dev": true, "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", @@ -5594,6 +5634,7 @@ "version": "3.1.2", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, "dependencies": { "brace-expansion": "^1.1.7" }, @@ -5900,6 +5941,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", + "dev": true, "engines": { "node": ">=0.10.0" } diff --git a/package.json b/package.json index 8fb69e5..11d0231 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ "test:coverage": "jest --coverage" }, "dependencies": { - "@reportportal/client-javascript": "^5.1.1", + "@reportportal/client-javascript": "^5.1.3", "@wdio/reporter": "^7.31.1", "json-stringify-safe": "^5.0.1" }, From e2d00dbb31b57d99d9f16c54c7ea0ba7a8d46b41 Mon Sep 17 00:00:00 2001 From: Ilya Hancharyk Date: Thu, 11 Apr 2024 17:53:52 +0200 Subject: [PATCH 18/22] Update changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4adc5bb..bd11109 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,5 @@ +### Changed +- `@reportportal/client-javascript` bumped to version `5.1.3`. ## [5.1.0] - 2024-02-06 ### Added From e83d7f414b9e5fa43fdd066140da06fca11a4950 Mon Sep 17 00:00:00 2001 From: Ilya Date: Fri, 21 Jun 2024 16:34:49 +0200 Subject: [PATCH 19/22] Update CODEOWNERS --- .github/CODEOWNERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 2df1f2b..4d58196 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1 +1 @@ -* @AmsterGet @AliakseiLiasnitski +* @AmsterGet From 8dae4ab3c4d78a6bbaf8e845090e79f831923973 Mon Sep 17 00:00:00 2001 From: Ilya Hancharyk Date: Wed, 26 Jun 2024 20:08:13 +0300 Subject: [PATCH 20/22] Fix launch finishing for existing launchId --- src/reporter.ts | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/src/reporter.ts b/src/reporter.ts index 96d092f..cca6a30 100644 --- a/src/reporter.ts +++ b/src/reporter.ts @@ -17,7 +17,7 @@ import WDIOReporter, { AfterCommandArgs, - BeforeCommandArgs, + BeforeCommandArgs, HookStats, RunnerStats, SuiteStats, TestStats, @@ -57,13 +57,14 @@ export class Reporter extends WDIOReporter { constructor(options: Partial) { super(options); - - const agentInfo = getAgentInfo(); - const clientConfig = getClientConfig(options); this.options = { seleniumCommandsLogLevel: 'info', + launchId: process.env.RP_LAUNCH_ID || options.launchId, ...options, }; + const agentInfo = getAgentInfo(); + const clientConfig = getClientConfig(this.options); + this.syncReporting = false; this.client = new RPClient(clientConfig, agentInfo); this.storage = new Storage(); @@ -240,11 +241,13 @@ export class Reporter extends WDIOReporter { async onRunnerEnd(): Promise { try { await this.client.getPromiseFinishAllItems(this.tempLaunchId); - const { promise } = await this.client.finishLaunch(this.tempLaunchId, { - ...(this.customLaunchStatus && { status: this.customLaunchStatus }), - }); - promiseErrorHandler(promise); - await promise; + if (!this.options.launchId) { + const { promise } = await this.client.finishLaunch(this.tempLaunchId, { + ...(this.customLaunchStatus && { status: this.customLaunchStatus }), + }); + promiseErrorHandler(promise); + await promise; + } this.tempLaunchId = null; this.customLaunchStatus = null; } catch (e) { @@ -358,7 +361,9 @@ export class Reporter extends WDIOReporter { } sendLaunchLog(log: LogRQ): void { - this.sendLog(this.tempLaunchId, log); + if (this.tempLaunchId) { + this.sendLog(this.tempLaunchId, log); + } } sendLog(tempId: string, { level, message = '', file }: LogRQ): void { From 1e188cd5df36cc5547ea76f76b7b251e32a72cac Mon Sep 17 00:00:00 2001 From: Ilya Hancharyk Date: Wed, 26 Jun 2024 20:10:20 +0300 Subject: [PATCH 21/22] Bump client version. Fix vulnerabilities --- package-lock.json | 28 ++++++++++++++-------------- package.json | 2 +- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/package-lock.json b/package-lock.json index 0635ee8..dce4ae4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,7 @@ "version": "5.1.0", "license": "Apache-2.0", "dependencies": { - "@reportportal/client-javascript": "^5.1.3", + "@reportportal/client-javascript": "~5.1.4", "@wdio/reporter": "^7.31.1", "json-stringify-safe": "^5.0.1" }, @@ -1306,9 +1306,9 @@ } }, "node_modules/@reportportal/client-javascript": { - "version": "5.1.3", - "resolved": "https://registry.npmjs.org/@reportportal/client-javascript/-/client-javascript-5.1.3.tgz", - "integrity": "sha512-1/utoKnHUgiilR6Ep8pHvuNZGv5oDeI+x1/aJNu8IADoVG1U0Q4tB2trWHDIY07T/PCzrnzp6dVcCu/wLsdVRA==", + "version": "5.1.4", + "resolved": "https://registry.npmjs.org/@reportportal/client-javascript/-/client-javascript-5.1.4.tgz", + "integrity": "sha512-Pk00dSYX8TANmEkg2CN06PxoSW1f83d1mew1M0kw5pDZOif+1cYrjy1E4HNrdLBoYhAH6oQIISvJSKc7K6A8fg==", "dependencies": { "axios": "^1.6.8", "axios-retry": "^4.1.0", @@ -2252,12 +2252,12 @@ } }, "node_modules/braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", "dev": true, "dependencies": { - "fill-range": "^7.0.1" + "fill-range": "^7.1.1" }, "engines": { "node": ">=8" @@ -3615,9 +3615,9 @@ } }, "node_modules/fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", "dev": true, "dependencies": { "to-regex-range": "^5.0.1" @@ -7456,9 +7456,9 @@ } }, "node_modules/ws": { - "version": "7.5.9", - "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.9.tgz", - "integrity": "sha512-F+P9Jil7UiSKSkppIiD94dN07AwvFixvLIj1Og1Rl9GGMuNipJnV9JzjD6XuqmAeiswGvUmNLjr5cFuXwNS77Q==", + "version": "7.5.10", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.10.tgz", + "integrity": "sha512-+dbF1tHwZpXcbOJdVOkzLDxZP1ailvSxM6ZweXTegylPny803bFhA+vqBYw4s31NSAk4S2Qz+AKXK9a4wkdjcQ==", "dev": true, "engines": { "node": ">=8.3.0" diff --git a/package.json b/package.json index 11d0231..9f3d237 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ "test:coverage": "jest --coverage" }, "dependencies": { - "@reportportal/client-javascript": "^5.1.3", + "@reportportal/client-javascript": "~5.1.4", "@wdio/reporter": "^7.31.1", "json-stringify-safe": "^5.0.1" }, From 6e2d1c3a5f6ff3c45dc5f330a6c9facffb8960d7 Mon Sep 17 00:00:00 2001 From: Ilya Hancharyk Date: Wed, 26 Jun 2024 20:12:09 +0300 Subject: [PATCH 22/22] Update changelog --- CHANGELOG.md | 4 +++- src/reporter.ts | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bd11109..e1158cb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ ### Changed -- `@reportportal/client-javascript` bumped to version `5.1.3`. +- `@reportportal/client-javascript` bumped to version `5.1.4`. +### Security +- Updated versions of vulnerable packages (braces, ws). ## [5.1.0] - 2024-02-06 ### Added diff --git a/src/reporter.ts b/src/reporter.ts index cca6a30..9cf7239 100644 --- a/src/reporter.ts +++ b/src/reporter.ts @@ -17,7 +17,7 @@ import WDIOReporter, { AfterCommandArgs, - BeforeCommandArgs, HookStats, + BeforeCommandArgs, RunnerStats, SuiteStats, TestStats,