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

playwright-testmo-reporter

v1.11.0

Published

A Playwright Reporter for the Testmo SaaS.

Downloads

46,965

Readme

npm npm Libraries.io dependency status for latest release Sonar Violations (long format)

Playwright Testmo Reporter

Playwright Testmo Reporter is a specialized test reporter designed for integration with the Testmo test management SaaS platform. It's crafted to generate a JUnit XML file that includes test steps, links to attachments, and details of fails, passes, etc. The project is written in TypeScript and aims to provide a seamless and lightweight experience.

Features

  • JUnit XML File Generation: Includes detailed test steps, attachments, and statuses.
  • Easy Integration: Only requires a simple installation and configuration.
  • Lightweight: Utilizes a single dependency (fast-xml-parser) to generate XML data.
  • Well-maintained Code: Adheres to coding standards and continuously receives updates.
  • Verified Implementation: Contacts with Testmo to ensure the implementation meets quality standards.

Installation

Installing the Playwright Testmo Reporter is a breeze. Simply run the following command:

npm install --save-dev playwright-testmo-reporter

Configuration

To configure the reporter, add it to your playwright.config.ts file. That's all you need to do to set it up!

Example playwright.config.ts file:

import { TestmoReporterOptions } from "playwright-testmo-reporter";
...
reporter: [
    [
      'playwright-testmo-reporter',
      {
        outputFile: 'testmo/testmo.xml', // Optional: Output file path. Defaults to 'testmo.xml'.
        embedBrowserType: false, // Optional: Embed browser type in the XML file. Defaults to false.
        embedTestSteps: true, // Optional: Embed test steps in the XML file. Defaults to true.
        testStepCategories: ["hook","expect","pw:api","test.step"], // Optional: Test step categories to include in the XML file. Defaults to ["hook","expect","pw:api","test.step"]. Possible options are "hook", "expect", "pw:api", "test.step".
        testTitleDepth: 1, // Optional: Test case title depth to report in the XML file. Defaults to 1. Increase this to 2 include suite name. Increase this even further to include the path.
        includeTestSubFields: false, // Optional: Include test sub fields in the XML file. Defaults to false.
        attachmentBasePathCallback: (basePath) => `http://playwright-s3.services.mycompany.example:9000/test/${TEST_RUN_UUID}/` + basePath.split(/[\\/]/g).join('/'), // Optional: Specify a callback which accepts and returns a string to generate a custom attachment base path. Useful for referring to an artifact storage location for example.
      } satisfies TestmoReporterOptions
    ]
]
...

Or for JavaScript, example playwright.config.js file:

...
reporter: [
    [
      'playwright-testmo-reporter',
      {
        outputFile: 'testmo/testmo.xml', // Optional: Output file path. Defaults to 'testmo.xml'.
        embedBrowserType: false, // Optional: Embed browser type in the XML file. Defaults to false.
        embedTestSteps: true, // Optional: Embed test steps in the XML file. Defaults to true.
        testStepCategories: ["hook","expect","pw:api","test.step"], // Optional: Test step categories to include in the XML file. Defaults to ["hook","expect","pw:api","test.step"]. Possible options are "hook", "expect", "pw:api", "test.step".
        testTitleDepth: 1, // Optional: Test case title depth to report in the XML file. Defaults to 1. Increase this to 2 include suite name. Increase this even further to include the path.
        includeTestSubFields: false, // Optional: Include test sub fields in the XML file. Defaults to false.
        attachmentBasePathCallback: (basePath) => `http://playwright-s3.services.mycompany.example:9000/test/${TEST_RUN_UUID}/` + basePath.split(/[\\/]/g).join('/'), // Optional: Specify a callback which accepts and returns a string to generate a custom attachment base path. Useful for referring to an artifact storage location for example.
      }
    ]
]
...

Usage

Once installed and configured, all you have to do is run your tests:

# Run all tests
npx playwright test

The rest works like magic. You'll have the JUnit XML file generated with all the required details.

After the tests have run, you need to use the Testmo CLI tool to import the data into Testmo.

Dependencies

  • Required: fast-xml-parser
  • Peer Dependencies: @playwright/test, playwright-core (usually already installed in a Playwright project)

NPM Package

You can find the package on NPM at playwright-testmo-reporter.

Support

For any issues, queries, or contributions, please refer to the official repository or reach out to the Testmo contacts provided in the package documentation.

License

Please refer to the license file in the repository for information on the usage terms and conditions.

Happy Testing with Playwright and Testmo! 🚀