npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

cypress-mochawesome-csv-united-report

v1.2.3

Published

CLI tool to generate a united CSV report from Cypress Mochawesome reports.

Downloads

724

Readme

Cypress Mochawesome CSV United Report

Cypress Mochawesome CSV United Report is a command-line tool that merges all Cypress Mochawesome JSON reports into a customized CSV file. The reports should be located in the cypress/reports folder within a Cypress project.

Features

  • Merges multiple JSON files into one CSV report.
  • Automatically handles file naming conflicts for CSV output.
  • Extracts relevant data from Mochawesome reports (time, suite, test case, pass/fail status, etc.).
  • Customizable delimiter for CSV formatting.

Prerequisites

  • Node.js version 14.0.0 or higher.
  • Typescript setup in your project (if you're modifying the source code).

Installation

To install the package locally, run the following command in your Cypress project root:

npm install cypress-mochawesome-csv-united-report
  • To Install it globally
npm install -g cypress-mochawesome-csv-united-report

Usage

  • Once installed, you can generate a CSV report by running the following command:
npx cmur

Command Breakdown

  • cmur: This will merge all the JSON files located in the cypress/reports directory and create a CSV report.

Custom CSV File Location

  • By default, the merged CSV file will be saved to cypress/reports/cmur_report.csv. If a file with that name already exists, a new file with a unique name (e.g., cmur_report+1.csv, cmur_report+2.csv, etc.) will be created automatically.

Example

Assuming your cypress/reports directory contains the following Mochawesome JSON files:

  • cypress/reports/test-results-1.json
  • cypress/reports/test-results-2.json

Running npx cmur will generate a CSV file at:

  • cypress/reports/cmur_report.csv

  • The CSV file will include data from both JSON files, containing fields such as:

    • time: Timestamp of the test report.
    • suite: Test suite name.
    • test_case: Individual test case name.
    • duration: Duration of the test.
    • speed: Speed of the test execution.
    • state: Test state (passed, failed, pending).
    • pass: Count of passed tests.
    • fail: Count of failed tests.
    • pending: Count of pending tests.
    • context: Additional context, if available.
    • code: Test code snippet, if provided.
    • err: Error details, if any.
    • isHook: Indicates if the test is a hook.
    • skipped: Whether the test was skipped.

CSV Formatting

  • The default delimiter used in the CSV file is the Star Symbol (*) . You can modify this by adjusting the source code.
  • The generated CSV will escape the delimiter and any newlines in the fields to ensure proper formatting.

License

  • This project is licensed under the MIT License. See the LICENSE file for more details.

Author

  • Mohamed Said Ibrahim