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

hermiona-allure-legacy

v1.0.4

Published

Allure plugin for CodeceptJS

Downloads

3

Readme

Allure Plugin

Allure plugin for CodeceptJS via allure-commons v1

Warning This plugin was deprecated in CodeceptJS as to allure-commons v1 was not maintained anymore. Documentation and source code was moved into this repository. At this moment we don't plan to migrate it to Allure v2 but community can create their own implementations

Enables Allure reporter.

Usage

To start please install allure-commandline package (which requires Java 8)

npm install -g allure-commandline --save-dev

Add this plugin to config file:

plugins: {
  allure: {
    enabled: true,
    require: '@codeceptjs/allure-legacy',
  }
}

By default, allure reports are saved to output directory. Launch Allure server and see the report like on a screenshot above:

allure serve output

Configuration

  • outputDir - a directory where allure reports should be stored. Standard output directory is set by default.
  • enableScreenshotDiffPlugin - a boolean flag for add screenshot diff to report. To attach, tou need to attach three files to the report - "diff.png", "actual.png", "expected.png". See Allure Screenshot Plugin

Public API

There are few public API methods which can be accessed from other plugins.

const allure = codeceptjs.container.plugins('allure');

allure object has following methods:

  • addAttachment(name, buffer, type) - add an attachment to current test / suite
  • addLabel(name, value) - adds a label to current test
  • addParameter(kind, name, value) - adds a parameter to current test
  • createStep(name, stepFunc) - create a step, stepFunc could consist an attachment Example of usage:
    allure.createStep('New created step', () => {
      allure.addAttachment(
        'Request params',
        '{"clientId":123, "name":"Tom", "age":29}',
        'application/json'
      );
    });

Created Step Image

  • addScreenDiff(name, expectedImg, actualImg, diffImg) - add a special screen diff block to the current test case image must be a string representing the contents of the expected image file encoded in base64 Example of usage:
const expectedImg = fs.readFileSync('expectedImg.png', { encoding: 'base64' });
...
allure.addScreenDiff('Screen Diff', expectedImg, actualImg, diffImg);

Overlay Diff

  • severity(value) - adds severity label
  • epic(value) - adds epic label
  • feature(value) - adds feature label
  • story(value) - adds story label
  • issue(value) - adds issue label
  • setDescription(description, type) - sets a description

addAttachment

Add an attachment to the current test case

Parameters

  • name [string][1] Name of the attachment
  • buffer [Buffer][2] Buffer of the attachment
  • type [string][1] MIME type of the attachment

addLabel

Adds a label with the given name and value to the current test in the Allure report

Parameters

  • name [string][1] name of the label to add
  • value [string][1] value of the label to add

addParameter

Adds a parameter with the given kind, name, and value to the current test in the Allure report

Parameters

  • kind [string][1] kind of the parameter to add
  • name [string][1] name of the parameter to add
  • value [string][1] value of the parameter to add

addScreenDiff

Add a special screen diff block to the current test case

Parameters

  • name [string][1] Name of the screen diff block
  • expectedImg [string][1] string representing the contents of the expected image file encoded in base64
  • actualImg [string][1] string representing the contents of the actual image file encoded in base64
  • diffImg [string][1] string representing the contents of the diff image file encoded in base64. Could be generated by image comparison lib like "pixelmatch" or alternative

createStep

A method for creating a step in a test case.

Parameters

  • name [string][1] The name of the step.
  • stepFunc [Function][3] The function that should be executed for this step. (optional, default ()=>{})

Returns any The result of the step function.

setDescription

Set description for the current test case

Parameters

  • description [string][1] Description for the test case
  • type [string][1] MIME type of the description (optional, default 'text/plain')

allure

Allure reporter

![][4]

Parameters

  • config

allure

Creates an instance of the allure reporter

Parameters

  • config Config Configuration for the allure reporter (optional, default {outputDir:global.output_dir})

Returns [Object][9] Instance of the allure reporter