New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More

wdio-reportportal-reporter

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

wdio-reportportal-reporter

A WebdriverIO plugin. Report results to Report Portal.

92

Supply Chain Security

100

Quality

77

Maintenance

100

Vulnerabilities

100

License



Version published
Weekly downloads
24K
decreased by-19.52%
Maintainers
1
Weekly downloads
 
Created
Issues
22

WDIO Report Portal Reporter

Greenkeeper badge Build Status

A WebdriverIO reporter plugin to report results to Report Portal(http://reportportal.io/).

Installation

The easiest way is to keep wdio-reportportal-reporter as a devDependency in your package.json.

{
  "devDependencies": {
    "wdio-reportportal-reporter": "~0.0.15"
  }
}

You can simple do it by:

npm install wdio-reportportal-reporter --save-dev

Instructions on how to install WebdriverIO can be found here.

Configuration

Configure the output directory in your wdio.conf.js file:

const reportportal = require('wdio-reportportal-reporter');

exports.config = {
  // ...
  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
        },
        enableSeleniumCommandReporting: false,
        enableScreenshotsReporting: false,
        seleniumCommandsLogLevel: 'debug',
        screenshotsLogLevel: 'info',
        enableRetriesWorkaround: false,
        parseTagsFromTestTitle: false,
        debug: false
      }
    },
  // ...
}

Additional API

Api methods can be accessed using:

const reporter = require('wdio-reportportal-reporter')

Methods description

  • 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 content
    • type (String, optional) – attachment MIME-type, image/png by default
  • reporter.sendLogToTest(test, level, message) - send log to specific test.
    • test (object) - test object from afterTest\afterStep wdio hook
    • level (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 hook
    • level (string) - log level. Values ['trace', 'debug', 'info', 'warn', 'error'].
    • name (string)– file name.
    • content (String) – attachment content
    • type (string, optional) – attachment MIME-type, image/png by default

Pay 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-allure-reporter');

exports.config = {
...
  afterTest: async function afterTest(test) {
    if (test.passed === false) {
      const screenshot = await browser.saveScreenshot();
      reporter.sendFileToTest(test, 'error', 'failed.png', screenshot);
    }
  },
  ...

License

This project is licensed under the MIT License - see the LICENSE.md file for details

FAQs

Package last updated on 29 Oct 2018

Did you know?

Socket

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.

Install

Related posts