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 🙏

© 2026 – Pkg Stats / Ryan Hefner

easy-jev-natural-test

v0.1.0

Published

Run natural-language test case trees with Jev and Playwright

Readme

@hartk/natural-test

Run natural-language E2E cases directly from a testCaseTree with TypeSafe Jev and Playwright. The primary output is a per-case result, not generated test code.

Install

From another local project, install the package directory or the tarball produced by pnpm pack:

pnpm add file:/absolute/path/to/packages/natural-test playwright
pnpm exec playwright install chromium

After the package is published, pnpm add @hartk/natural-test playwright can be used instead. The package is not published by this repository change.

Node.js 20 or newer is required. Configure TYPESAFE_API_KEY on the server or pass apiKey to runTestCaseTree. Do not call this package from browser-side code.

Use

import { runTestCaseTree } from '@hartk/natural-test';

const result = await runTestCaseTree({
  url: 'http://localhost:3000/login',
  tree: {
    nodes: [
      { id: 'root', parentId: null, kind: 'root', title: '登录' },
      {
        id: 'login-error', parentId: 'root', kind: 'case', type: 'e2e',
        title: '错误密码提示',
        steps: ['在邮箱输入框填写用户邮箱', '在密码输入框填写错误密码', '点击登录按钮'],
        inputData: '{"邮箱":"[email protected]","密码":"wrong-password"}',
        expectedResult: '页面显示密码错误提示',
      },
    ],
  },
  traceDir: './test-artifacts',
});

console.log(result.cases[0].outcome); // passed | failed | blocked

The input shape is a structural subset of hartk's TestCaseTree; other projects can use it without importing hartk. Only kind: 'case' and type: 'e2e' nodes run. Each case gets a fresh Playwright browser context. storageState or beforeCase can establish authentication. The URL origin is the only allowed origin by default; set allowedOrigins if a case intentionally leaves it.

Jev selects an operation and a target from the currently observed controls. It cannot provide selectors, JavaScript, or input text. Input values come from inputData, quoted step text, or the caller's resolveInput callback. Unknown values block the case. A separate Jev judgment checks whether the final visible page state supports expectedResult; uncertain evidence produces blocked, not passed. The default action and verification probability thresholds are provisional; evaluate them on representative cases before relying on them as a release gate.

DecisionProvider is injectable, so projects can use another TypeSafe transport or test the runner without network calls. traceDir saves a Playwright trace for each case. The result includes stable caseId, outcome, action log, reason, observed page state, verification probabilities, and trace path.

Current boundaries

The runner supports click, fill, and native select on visible controls. It does not yet handle frames, shadow roots, file uploads, drag and drop, arbitrary keyboard widgets, or visual assertions. A multi-action natural-language step has a bounded action budget. If a case needs unsupported actions or its expected result cannot be observed in page text, title, or URL, it returns blocked for review.