Socket
Socket
Sign inDemoInstall

allure-js-parser

Package Overview
Dependencies
26
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    allure-js-parser

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


Version published
Weekly downloads
22K
decreased by-8.7%
Maintainers
1
Install size
1.19 MB
Created
Weekly downloads
 

Readme

Source

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',
      },
    ]

Keywords

FAQs

Last updated on 18 Jul 2023

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc