![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
wdio-reportportal-reporter
Advanced tools
A WebdriverIO reporter plugin to report results to Report Portal(http://reportportal.io/).
The easiest way is to keep wdio-reportportal-reporter
as a devDependency in your package.json
.
{
"devDependencies": {
"wdio-reportportal-reporter": "~0.0.23",
"wdio-reportportal-service": "~0.0.1"
}
}
You can simple do it by:
npm install wdio-reportportal-reporter wdio-reportportal-service --save-dev
Instructions on how to install WebdriverIO
can be found here.
Configure the output directory in your wdio.conf.js file:
const reportportal = require('wdio-reportportal-reporter');
const RpService = require("wdio-reportportal-service");
//how much time will wait till launch finishes. default 5000 ms
const rpService = new RpService(4000);
exports.config = {
// ...
services: [rpService],
reporters: [reportportal],
reporterOptions: {
reportportal: {
rpConfig: {
token: '00000000-0000-0000-0000-00000000000',
endpoint: 'https://reportportal-url/api/v1',
launch: 'launch_name',
project: 'project_name',
mode: 'DEFAULT',
debug: false,
description: "Launch description text",
tags: ["tags", "for", "launch"],
},
enableSeleniumCommandReporting: false,
enableScreenshotsReporting: false,
seleniumCommandsLogLevel: 'debug',
screenshotsLogLevel: 'info',
enableRetriesWorkaround: false,
parseTagsFromTestTitle: false,
}
},
// ...
}
Api methods can be accessed using:
const reporter = require('wdio-reportportal-reporter')
reporter.sendLog(level, message)
– send log to current suite\test item.
level
(string) - log level. Values ['trace', 'debug', 'info', 'warn', 'error'].message
(String)– log message content.reporter.sendFile(level, name, content, [type])
– send file to current suite\test item.
level
(string) - log level. Values ['trace', 'debug', 'info', 'warn', 'error'].name
(string)– file name.content
(String) – attachment contenttype
(String, optional) – attachment MIME-type, image/png
by defaultreporter.sendLogToTest(test, level, message)
- send log to specific test.
test
(object) - test object from afterTest\afterStep
wdio hooklevel
(string) - log level. Values ['trace', 'debug', 'info', 'warn', 'error'].message
(String)– log message content.reporter.sendFileToTest(test, level, name, content, [type])
– send file to to specific test.
test
(object) - test object from afterTest\afterStep
wdio hooklevel
(string) - log level. Values ['trace', 'debug', 'info', 'warn', 'error'].name
(string)– file name.content
(String) – attachment contenttype
(string, optional) – attachment MIME-type, image/png
by defaultPay attention: sendLog
\sendFile
sends log to current running test item. It means if you send log without active test(e.g from hooks or on suite level) it will not be reported Report Portal UI.
Methods sendLogToTest
\sendFileToTest
are useful when you need to send screenshots or logs to the failed test item from wdio afterTest hook.
Mocha example:
const reporter = require('wdio-reportportal-reporter');
exports.config = {
...
afterTest: async function afterTest(test) {
if (test.passed === false) {
const screenshot = await browser.saveScreenshot();
reporter.sendFileToTest(test, 'error', 'failed.png', screenshot);
}
}
...
Real launchId is available by static variable on reporter: reporter.launchId
For example:
const reporter = require('wdio-reportportal-reporter');
exports.config = {
...
onComplete: function onComplete() {
console.log(`Launch id is: ${reporter.launchId}`);
},
...
It works out of the box if you setup and use wdio-reportportal-service
. But if you want you may use following code
const reporter = require('wdio-reportportal-reporter');
exports.config = {
...
onComplete: async function onComplete() {
// default timeout is 5000 ms. Returns false if launch was not finished till timeout
const isLaunchFinished = await reporter.waitLaunchFinished(10000);
if(!isLaunchFinished) {
console.warn('Launch has not been finished');
}
console.log('Launch finished');
}
...
This project is licensed under the MIT License - see the LICENSE.md file for details
FAQs
A WebdriverIO v6 plugin. Report results to Report Portal.
The npm package wdio-reportportal-reporter receives a total of 19,990 weekly downloads. As such, wdio-reportportal-reporter popularity was classified as popular.
We found that wdio-reportportal-reporter demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.