Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@wdio/reporter

Package Overview
Dependencies
Maintainers
3
Versions
251
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@wdio/reporter

A WebdriverIO utility to help reporting all events

  • 8.23.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.1M
increased by7.61%
Maintainers
3
Weekly downloads
 
Created

What is @wdio/reporter?

@wdio/reporter is a WebdriverIO plugin that allows you to create custom reporters for your test results. It provides a framework for capturing and displaying test results in various formats, making it easier to analyze and share test outcomes.

What are @wdio/reporter's main functionalities?

Custom Reporter Creation

This feature allows you to create custom reporters by extending the base Reporter class. You can override methods like onTestPass and onTestFail to customize the behavior when tests pass or fail.

const { Reporter } = require('@wdio/reporter');

class MyCustomReporter extends Reporter {
    constructor(options) {
        super(options);
    }

    onTestPass(test) {
        console.log(`Test passed: ${test.title}`);
    }

    onTestFail(test) {
        console.log(`Test failed: ${test.title}`);
    }
}

module.exports = MyCustomReporter;

Integration with WebdriverIO

This feature demonstrates how to integrate a custom reporter with WebdriverIO by adding it to the reporters array in the WebdriverIO configuration file.

const MyCustomReporter = require('./path/to/MyCustomReporter');

exports.config = {
    reporters: [[MyCustomReporter, { outputDir: './results' }]],
    // other WebdriverIO config options
};

Output Formatting

This feature allows you to format the output of your test results. In this example, the results are formatted as a JSON string with indentation for better readability.

class MyCustomReporter extends Reporter {
    constructor(options) {
        super(options);
    }

    onRunnerEnd(runner) {
        const results = this.results;
        const formattedResults = JSON.stringify(results, null, 2);
        console.log(`Test results: ${formattedResults}`);
    }
}

module.exports = MyCustomReporter;

Other packages similar to @wdio/reporter

Keywords

FAQs

Package last updated on 17 Nov 2023

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc