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

pwmochawesome

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pwmochawesome

A playwright custom reporter that integrates with mochawesome reporter

  • 1.1.0
  • npm
  • Socket score

Version published
Weekly downloads
2.3K
decreased by-42.6%
Maintainers
1
Weekly downloads
 
Created
Source

Playwright Mochawesome Reporter

Using playwright test runner to get info about executed tests, it can generate JSON and HTML with Mochawesome pattern and style. Main goal of this project is to provide an alternative for default reporter for Playwright.

Installation

npm install pwmochawesome --save-dev

Usage

According to how Playwright is coded, to use a custom reporter as a package you need to create a file inside your project to import this package like this:

{project folder}/report.js

const pwmochawesome = require('pwmochawesome');

module.exports = pwmochawesome;

Then you can configure it inside your playwright config file:

{project folder}/playwright.config.js

const config = {
  reporter: [ [ './report.js' ] ],
};

module.exports = config;

Note that we reference our previously created file report.js inside reporter property of configuration. With this we can use our custom reporter.

Options

optiondefaultdescription
outputJSONfalseDefines whether or not to generate a .json file containing the test results
outputFileName'mochawesome.json'Defines the name of the .json file if it is enabled
generateHTMLtrueDefines whether to generate a report in HTML
reportDir'mochawesome-report'Determines the name of the folder that will contain the test results
reportTitle'Playwright Mochawesome'Title that the html report will use
chartsfalseWhether to show charts in html report

How to pass options to reporter: {project folder}/playwright.config.js

const config = {
  reporter: [ [ 
      './report.js', {
        outputJSON: true,
        outputFileName: 'result.json'
      } 
  ] ],
};

module.exports = config;

Information

This project is tested and confirmed to work with @playwright/test: 1.20.2. If you have more recent version and this package don't work, please create a bug or contribute with pull request.

Version compatibility:

Playwright Mochawesome ReporterMochawesomeMarge
1.0.07.0.16.2.0

Keywords

FAQs

Package last updated on 10 Jan 2024

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