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

pupcheck

v0.2.1

Published

E2E test scripting through puppeteer

Downloads

333

Readme

Pupcheck

Simple file format for puppeteer-based End-to-end tests:

goto https://saltcorn.com
status 200
contains platform for building database
containsnot platform for building databse

Command line tool

run with

npx pupcheck

pupcheck [-Hhv] [file ...]

Command line switches:

  -H         : Headful; open browser window
  -v         : verbose
  -h, --help : help

Chrome or chromium need to be installed and accessible. If this is in a non-standard location, set the PUPPETEER_CHROMIUM_BIN environment variable.

Set the base URL with the PUPCHECK_BASE_URL environment variable. Then you can use a relative URL; for example

goto /

Upgrade

npx clear-npx-cache to delete an old version of pupcheck installed with npx, then run npx pupcheck0 again.

pupcheck file commands

The pupcheck file consists of a number of one-word commands, followed by the arguments to that command. If the command takes a free text argument, this will be the last argument and will consist of the rest of the line.

The command is case insensitive, so you can use camelCase.

# This is a comment but only if # is first character

If your selector has a space due to choosing a child element, wrap in parentheses.

Permitted commands

  • goto {url}

    Navigate to this URL

    Example: goto https://google.com

  • status {status code}

    Assert this status code

    Example: status 200

  • contains {contents}

    Assert this is in the page contents

    Example: contains Tasks completed

  • containsnot {contents} (also contains_not)

    Assert this is in not in the page contents

    Example: containsNot An error occurred

  • click {selector}

    Click the selected element and wait for navigation to complete

    Example: click button#click_me

  • waitfor {selector} (also wait_for)

    Wait until this element becomes present

    Example: waitfor button#click_me

  • type {selector} {text}

    Type the text into the selected input element.

    Examples: type input#full_name John Smith, type (#question-name input) Walt Whitman

  • slowlytype {selector} {text} (also slowly_type)

    Type the text SLOWLY into the selected input element.

    Examples: slowly_type input#full_name John Smith, slowlyType (#question-name input) Walt Whitman

  • select {selector} {value}

    Set the value of a drop-down <select> element

    Examples: select select#role 5

  • erase {selector} {nchars}

    Erase characters from the selected input element.

    Examples: erase input#full_name 9

  • evaltrue {js-expr-string} (also eval_true)

    Assert that this expression must evaluate to true

    Examples: eval_true $("input#full_name").val()==="Miles Davis"

  • sleep {milliseconds}

    Sleep for this many milliseconds

    Example: sleep 1000

Example pupcheck file

example.pch contents:

goto https://example.com/

# Login
type input#id_username [email protected]
type input#id_password grehq4hhq32534534t
click input[type=submit]

# Check dashboard loads
contains Tasks completed

How to run:

npx pupcheck example.pch