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

pickle-test-runner

v2.2.5

Published

[![Build Status](https://app.travis-ci.com/Jswk1/pickle.svg?branch=master)](https://app.travis-ci.com/Jswk1/pickle)

Downloads

1,477

Readme

Build Status

About

Lighweight version of CucumberJS library. Supports real-time test debugging.

API

defineStep(pattern: string, options: IOptions, cb: Function)

defineStep(pattern: string, cb: Function)


IOptions:

{
    timeoutMS?: number; // (default 10000ms)
}

Examples:

defineStep("It should open a browser.", { timeoutMS: 5000 }, async function () {
    // step body
});

defineStep("It should open a browser.", async function () {
    // step body
});

defineStep("It should open a browser {int} times.", async function (count: number) {
    /**
     * For 'It should open a browser 5 times.'
     * count will be '5'
     */
});

defineStep("It should open a display message {string}.", async function (message: string) {
    /**
     * For 'It should open a display message "An error has occured!".'
     * message will be 'An error has occured!'
     */

    this.variables["message"] = message; // Transfer variables between steps
});

defineStep(/It can also use regexes\. Look what I found\: ([a-z]+)\./, async function (message: string) {
    /**
     * For 'It can also use regexes. Look what I found: test.'
     * message will be 'test'
     */

    this.variables["message"] = message; // Transfer variables between steps
});

Default variable types

  • int - {int}
  • decimal - {decimal}
  • string - {string}

defineExpression(expr: IStepExpressionDef)


IStepExpressionDef:

{
    key: string; // Unique
    pattern: RegExp;
    parser: (value: any) => any; // Used to convert to target type
}

Example:

// Definition
defineExpression({
    key: "bool",
    pattern: /true|false/,
    parser: v => v === "true" ? true : v === "false" ? false : new Error("Value is in incorrect format.");
});

// Usage
defineStep("Checkbox state is set to {bool}.", async function (state: boolean) {
    /**
     * For 'Checkbox state is set to true.'
     * state will be 'true'
     */
});

CLI

Command line usage:

pickle [(-r, --require <glob_expr>), (-j, --junit <xml_path>), (-o, --output <log_path>), -d] <feature_path>

Parameters:

  • -r <glob_expr> --require <glob_expr> - Path to directory with all step definitions. Should end with *.js or (preferably) *.ts
  • -j <xml_path> --junit <xml_path> - Path to save the JUnit xml with test execution summary
  • -o <log_path> --output <log_path> - Path to save the test execution log
  • -d --debug - Execute test in debug mode. For details please take a look a the Debugger section.
  • --trace-size <number> - Increase the error stack trace size. Default is 20.

Examples:

Run only

pickle -r ./Flows/**/*.js ./test.feature

Run + generate junit xml + generate log file

pickle -r ./Flows/**/*.js -j ./junit.xml -o ./Output.log ./test.feature

Same as above but more verbose

pickle --require ./Flows/**/*.js --junit ./junit.xml --output ./Output.log ./test.feature

Debugger

Pickle test runner is delivered with web based debugging tool which allows running features in step by step mode. Features:

  • Run feature steps and pause at any time
  • Step Breakpoints
  • Ability to edit test variables during execution
  • On-demand reload of source files. Useful when step definitions are adjusted and you want to continue the test where it failed.

The source for Pickle Debugger is available in separate repository. The compiled bundle.js and index.html file is built and included in Pickle Test Runner.

https://github.com/Jswk1/pickle-debugger