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

@progress/roadkill

v0.2.2

Published

> WebDriver for the Masses

Downloads

1,620

Readme

Roadkill

WebDriver for the Masses

Version: Alpha! Not ready for use public adoption yet.

A node.js testing solution over the WebDriver protocol. Will also consider WebDriver BiDi.

Powered by:

A WebDriver based slim testing framework. Closes the gaps between QAs and Front-End developers by:

  • Sharing the same TypeScript or JavaScript language with Angular, React and Vue front-end developers
  • Stay within the nodejs ecosystem
  • Skill-transfer between QAs and Front-End devs
  • Share the lightweight VSCode IDE
  • Compile-time type-checking

jest-environment

The @progress/roadkill ships with a jest environment geared toward e2e.

To enable it set your jest environment in your jest config from the demo package.json to:

{
  "scripts": {
    "test": "node --experimental-vm-modules ../../node_modules/jest/bin/jest.js --detectOpenHandles --forceExit"
  },
  "jest": {
    "preset": "ts-jest/presets/default-esm",
    "testEnvironment": "@progress/roadkill/jest-environment.ts",
  }
}

The output will be printed on-the-go, and the console.log mocking will be disabled.

On test start and test done console.group will be put on stack, so console.logs could be easily referenced to a particular test.

Errors will be logged out with complete stack at the time of their appearance.

The environment also adds support to detect test and hook state. Use @progress/roadkill/utils.ts to import getState(), that gives a test or hook bound signal that is fired before timeout. It also allows us to write up cleanup on fail:

import { getState } from "@progress/roadkill/utils.js";

afterEach(async () => {
    const { signal, test, hook } = getState();
    if (test && test.status == "fail") {
        console.log("post-mortem collecting test failure artifacts for: " + test.names.join(" > "));
        // For example try to capture screenshot from session...
    }
});

Example test run output log:

Test Run
  Run
    w3schools
      - w3schools > navigate to js statements page ... , at w3schools.test.ts:41:5
        WebDriverMethodError: Failed to click element.
            at Element.click (/Users/cankov/git/telerik/roadkill/packages/@progress/roadkill/webdriver.ts:1308:19)
            at processTicksAndRejections (node:internal/process/task_queues:95:5)
            ... 2 lines matching cause stack trace ...
            at processTimers (node:internal/timers:507:7)
            at Object.<anonymous> (/Users/cankov/git/telerik/roadkill/examples/jest-web/w3schools.test.ts:55:9) {
          [cause]: WebDriverRequestError: WebDriver API call failed.
              at WebDriverClient.request (/Users/cankov/git/telerik/roadkill/packages/@progress/roadkill/webdriver.ts:537:76)
              at processTicksAndRejections (node:internal/process/task_queues:95:5)
              ... 2 lines matching cause stack trace ...
              at processTimers (node:internal/timers:507:7)
              at Element.click (/Users/cankov/git/telerik/roadkill/packages/@progress/roadkill/webdriver.ts:1306:20)
              at Object.<anonymous> (/Users/cankov/git/telerik/roadkill/examples/jest-web/w3schools.test.ts:55:9) {
            address: 'http://localhost:5027',
            command: 'POST /session/fb44c2e79fd1887be5d08a9be3374455/element/3D083E2E34E065F985F036327C7A6530_element_12/click',
            sessionId: 'fb44c2e79fd1887be5d08a9be3374455',
            elementId: '3D083E2E34E065F985F036327C7A6530_element_12',
            [cause]: TestTimeout [Error]: Exceeded timeout of 20000 ms for a test.
                at Object.fetch (node:internal/deps/undici/undici:14062:11)
                at processTicksAndRejections (node:internal/process/task_queues:95:5)
                at runNextTicks (node:internal/process/task_queues:64:3)
                at listOnTimeout (node:internal/timers:533:9)
                at processTimers (node:internal/timers:507:7)
                at WebDriverClient.request (/Users/cankov/git/telerik/roadkill/packages/@progress/roadkill/webdriver.ts:525:30)
                at Element.click (/Users/cankov/git/telerik/roadkill/packages/@progress/roadkill/webdriver.ts:1306:20)
                at Object.<anonymous> (/Users/cankov/git/telerik/roadkill/examples/jest-web/w3schools.test.ts:55:9)
          }
        }
      ✗ w3schools > navigate to js statements page (20.041sec.)
      ◯ w3schools > pending test, at w3schools.test.ts:65:10
      ✗ w3schools > timeouted test (205ms.), at w3schools.test.ts:68:5
        Error: Delay was aborted.
            at delay (/Users/cankov/git/telerik/roadkill/packages/@progress/roadkill/utils.ts:33:15)
            at runNextTicks (node:internal/process/task_queues:60:5)
            at listOnTimeout (node:internal/timers:533:9)
            at processTimers (node:internal/timers:507:7)
            at Object.<anonymous> (/Users/cankov/git/telerik/roadkill/examples/jest-web/w3schools.test.ts:69:9) {
          [cause]: TestTimeout [Error]: Exceeded timeout of 200 ms for a test.
              at Timeout._onTimeout (/Users/cankov/git/telerik/roadkill/packages/@progress/roadkill/jest-environment.ts:527:42)
              at listOnTimeout (node:internal/timers:564:17)
              at processTimers (node:internal/timers:507:7)
        }
      - afterAll, at w3schools.test.ts:30:5
        post-mortem collecting test failure artifacts for: w3schools > timeouted test
      ✓ afterAll
      ✗ afterAll, at w3schools.test.ts:38:5
        WebDriverRequestError: WebDriver API call failed.
            at WebDriverClient.request (/Users/cankov/git/telerik/roadkill/packages/@progress/roadkill/webdriver.ts:537:76)
            at processTicksAndRejections (node:internal/process/task_queues:95:5)
            ... 2 lines matching cause stack trace ...
            at processTimers (node:internal/timers:507:7)
            at Object.<anonymous> (/Users/cankov/git/telerik/roadkill/examples/jest-web/w3schools.test.ts:38:26) {
          address: 'http://localhost:5027',
          command: 'DELETE /session/fb44c2e79fd1887be5d08a9be3374455',
          sessionId: 'fb44c2e79fd1887be5d08a9be3374455',
          [cause]: HookTimeout [Error]: Exceeded timeout of 5000 ms for a hook.
              at Object.fetch (node:internal/deps/undici/undici:14062:11)
              at processTicksAndRejections (node:internal/process/task_queues:95:5)
              at runNextTicks (node:internal/process/task_queues:64:3)
              at listOnTimeout (node:internal/timers:533:9)
              at processTimers (node:internal/timers:507:7)
              at WebDriverClient.request (/Users/cankov/git/telerik/roadkill/packages/@progress/roadkill/webdriver.ts:525:30)
              at Object.<anonymous> (/Users/cankov/git/telerik/roadkill/examples/jest-web/w3schools.test.ts:38:26)
        }