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

@dwp/casa-spiderplan

v4.0.2

Published

A test runner that crawls over your CASA Plan to provide assurance that it's working as it should.

Downloads

998

Readme

Spiderplan 🕷️

Does whatever a Spiderplan can

A test runner that crawls over your CASA Plan to provide assurance that it's working as it should.

Features:

  • Traverses an end-to-end journey across your service in seconds (or less)
  • Tests journeys through the eyes of real users
  • Run exactly the same tests for all supported languages
  • Executes your whole application middleware/route stack for a true reflection of interactions
  • Supports concurrent test execution across multiple threads
  • Reports include a coverage indicator, listing any waypoints you may have missed from your Plan
  • When a field selectors doesn't work, a list of suggested CSS selectors will be presented for you to try instead
  • Supports a plugin mechanism to extend functionality

This is not a replacement for browser testing as, for performance reasons, it will not execute any JavaScript, or take into account any CSS rendering. Its intent is to get through a user journey as efficiently as possible so that journey, error and content tests can be completed quickly and at scale. For the majority of services this should be sufficient as services should not be reliant on JavaScript as per the GOVUK Service Standards.

Pre-requisites

  • NodeJS 18+

Getting started

Install the tool:

npm i -DE @dwp/casa-spiderplan

There's quite a bit of initial setup required, but once done your efforts are rewarded with a super-simple way to write tests.

Our setup guide takes you through the steps from the point of view of an example CASA application.

Writing tests

Tests generally comprise of two parts:

  • A Persona describing a journey through your Plan
  • One or more nunjucks templates describing the expected content for each page in that journey

And at the end of each test you will have coverage for:

  • The routes between waypoints
  • Confirmation that errors are triggered when given certain inputs
  • Error messages
  • Page content

Read through our documentation for Personas and Nunjucks to get started.

Running tests

Assuming you have installed the tool locally, you can execute your Personas using something like this:

# Runs all Personas found in the `./personas/` directory tree.
# Note that it's important to encapsulate any glob paths in quotes.
./node_modules/.bin/casa-spiderplan --worker-init bootstrap.js --language en './personas/**/*.yaml'

Plugins

The test runner supports a number of hooks at key points of the test lifecycle. These can be used to create plugins that alter or enhance the behaviour of those tests.

Read our guide on how to create your own plugins, or check out some others already available:

  • ZAP
  • A11Y