Socket
Socket
Sign inDemoInstall

@rpii/wdio-report-events

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@rpii/wdio-report-events

Abstracts the event driven messaging to pass screenshots, videos and log data to the report module


Version published
Weekly downloads
128K
increased by7.98%
Maintainers
1
Weekly downloads
 
Created

What is @rpii/wdio-report-events?

@rpii/wdio-report-events is a WebdriverIO plugin that provides event-driven reporting capabilities. It allows users to hook into various WebdriverIO events and generate custom reports based on those events.

What are @rpii/wdio-report-events's main functionalities?

Event Listening

This feature allows users to listen to specific WebdriverIO events such as 'test:pass' and 'test:fail'. The code sample demonstrates how to create a custom reporter that logs messages when tests pass or fail.

const { WdioReporter } = require('@rpii/wdio-report-events');

class CustomReporter extends WdioReporter {
  constructor(options) {
    super(options);
    this.on('test:pass', this.onTestPass);
    this.on('test:fail', this.onTestFail);
  }

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

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

module.exports = CustomReporter;

Custom Reporting

This feature allows users to create custom reports by hooking into WebdriverIO events. The code sample shows how to create a reporter that writes test results to a file.

const { WdioReporter } = require('@rpii/wdio-report-events');
const fs = require('fs');

class FileReporter extends WdioReporter {
  constructor(options) {
    super(options);
    this.on('test:end', this.onTestEnd);
  }

  onTestEnd(test) {
    const report = `Test: ${test.title} - Status: ${test.state}`;
    fs.appendFileSync('test-report.txt', report + '\n');
  }
}

module.exports = FileReporter;

Other packages similar to @rpii/wdio-report-events

Keywords

FAQs

Package last updated on 06 Jan 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