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

allure-js-parser

v0.0.10

Published

allure-js-parser

Downloads

105,736

Readme

allure-js-parser

The package allows you to parse allure-results raw files and convert them into a typed object.

With this object, you have the flexibility to perform various operations on the test results, such as generating a summary of tests, calculating statistics, or building a custom report.

Installation

You can install allure-js-parser as a development dependency using npm:

npm i --save-dev allure-js-parser

Usage

Provide the folder path where your allure-results files are stored (JSON files).

For example:

import { parseAllure } from 'allure-js-parser';

const tests = parseAllure('allure-results');

Once parsed, you can utilize the tests object to filter specific tests or generate statistics based on your requirements.

For instance, here's an example that filters all tests with the "regression" tag:

const regressionTests = tests.filter(t => t.labels.some(t => t.name === 'tag' && t.value === 'regression'))

The tests object is strongly typed, making it easy to access any desired data from it.

You can extract information such as test names, statuses, labels, attachments, or any other relevant details.

Feel free to explore the tests object and leverage its rich data structure to suit your needs.

Structure

Resulted object will look like:

 [
      {
        attachments: [],
        fullName: 'fruits apples should wight ~100-400 gramms',
        historyId: 'c1586ad8-4dc1-5ba0-88c4-793f3636a961',
        labels: [
          {
            name: 'framework',
            value: 'JEST overridden',
          },
          {
            name: 'language',
            value: 'typescript/javascript',
          },
        ],
        links: [],
        name: 'should wight ~100-400 gramms',
        parameters: [],
        parent: {
          name: 'apples',
          uuid: '25d4c594-8978-4e65-9698-a83022ab4068',
          afters: [],
          befores: [],
          parent: {
            name: 'fruits',
            uuid: '3318fde9-9137-4f60-8111-5454f8c62262',
            afters: [],
            befores: [],
          },
        },
        stage: 'finished',
        start: 1685684498584,
        status: 'passed',
        statusDetails: {},
        steps: [
          {
            attachments: [],
            name: '2023-06-02 05:41:38.585 | NON_DEFAULT',
            parameters: [],
            stage: 'finished',
            start: 1685684498585,
            status: 'passed',
            statusDetails: {},
            steps: [],
            stop: 1685684498585,
          },
        ],
        stop: 1685684498586,
        uuid: '0843001b-832b-4621-a096-17a64642ef20',
      },
      {
        attachments: [],
        fullName: 'fruits apples should have stick',
        historyId: 'e66fdf04-03b5-5235-9e12-a14a415316f8',
        labels: [
          {
            name: 'tag',
            value: 'regression',
          },
          {
            name: 'framework',
            value: 'JEST overridden',
          },
          {
            name: 'language',
            value: 'typescript/javascript',
          },
        ],
        links: [],
        name: 'should have stick',
        parameters: [],
        parent: {
          name: 'apples',
          uuid: '25d4c594-8978-4e65-9698-a83022ab4068',
          afters: [],
          befores: [],
          parent: {
            name: 'fruits',
            uuid: '3318fde9-9137-4f60-8111-5454f8c62262',
            afters: [],
            befores: [],
          },
        },
        stage: 'finished',
        start: 1685684498567,
        status: 'passed',
        statusDetails: {},
        steps: [
          {
            attachments: [],
            name: '2023-06-02 05:41:38.568 | NON_DEFAULT',
            parameters: [],
            stage: 'finished',
            start: 1685684498568,
            status: 'passed',
            statusDetails: {},
            steps: [],
            stop: 1685684498569,
          },
        ],
        stop: 1685684498583,
        uuid: '523b0bed-891f-4f7a-91d2-c1f52af87b32',
      },
    ]