SuperAPIAI Directory

sedum

github.com · AI coding

Sedum is an open-source browser end-to-end testing tool that lets you write test steps in natural language (English) while retaining the full capabilities of TypeScript and Playwright. Each ai(...) sentence represents a step, and Sedum resolves that step on the page without selectors; between steps you can use ordinary code, such as Playwright's page and expect, test data, API calls, etc. It uses decision models for bounded tasks (such as locating the element a sentence refers to, or judging whether a claim on the page holds), using TypeSafe Jev by default, with Cloudflare Clef as an option, returning probabilities rather than free text. Clicks, typing, waits, assertions, and exit codes are executed deterministically by Playwright. The project is currently pre-alpha; the first alpha version is published on npm as sedum-cli, the test format may change before 1.0, Windows support is experimental, and Linux and macOS have been verified. It requires Node.js 20.19 or later, plus credentials for TypeSafe or a compatible endpoint, or Cloudflare Clef. It supports TypeScript test files (*.test.ts) and YAML test files (*.test.yaml), can run in parallel, shard, retry, set timeouts, use reporters, and run in CI. It provides an agent skill for Claude Code and Codex to help investigate tests and fix failures. It is licensed under MIT.

Open website Alternatives
PricingOpen source开源项目(可免费自部署)
PlatformsmacOS · Linux

About this tool

Sedum is an open-source browser end-to-end (e2e) testing tool whose goal is to write browser tests in plain English while retaining the full capabilities of TypeScript, and to make running the entire test suite on every pull request (PR) cost as little as a few dollars per month instead of thousands.

Purpose

Sedum is used to write and run browser end-to-end tests. Test steps can be described in natural language sentences; each ai(...) sentence is a step, and Sedum resolves that step on the page without writing selectors. Between steps you can write ordinary code, including Playwright's page and expect, test data from any library, API calls for seeding or skipping setup, and helper functions.

Key capabilities

  • Natural language steps: each ai(...) sentence is resolved by Sedum on the page, with no selectors needed.
  • Retains TypeScript capabilities: ordinary code can be used between steps, such as Playwright's page and expect, test data, API calls, and helper functions.
  • Decision models: Sedum uses decision models for bounded tasks, such as finding the element a sentence refers to or judging whether a claim holds on the page. It uses TypeSafe Jev by default, with Cloudflare Clef available as a text provider. Both return probabilities rather than free text.
  • Deterministic execution: clicks, typing, waits, assertions, and exit codes are executed deterministically by Playwright.
  • Probabilistic testing: each claim is scored against a configured threshold and checked for contradictory evidence; borderline passes are flagged rather than silently turning green.
  • Transparency: prompts, scoring, and caching are all in the repository, so you can see what is sent to the model and what is returned.
  • Failure reports: when a test fails, you can have Sedum generate a report for coding agents such as Claude Code or Cursor; the report is ordered by urgency and includes the sentence with its file and line number, the score, the page text judged by the model, the elements considered, a screenshot, and the command to rerun only that test. Page text is fenced and marked as untrusted to prevent the page from injecting instructions.
  • Test formats: supports TypeScript test files (.test.ts) and YAML test files (.test.yaml); both formats can run in parallel in the same project.
  • Secret handling: wrap passwords and tokens with secret(); they are typed in but not sentGive the model or display in the report.
  • Variables: write {{name}} in the sentence and pass the value separately, so the sentence stays consistent across runs and can be checked before running.
  • Environment variables: $VAR reads an environment variable and treats it as a secret.
  • Modules: put shared steps in *.module.yaml files and call them with use:.
  • CLI commands: support filters, parallel runs and sharding, retries, timeouts, reporters, and exit codes.
  • CI runs: support GitHub Actions, GitLab, and Jenkins, providing JUnit and job summaries.
  • Project configuration: configure environments, thresholds, and .env via sedum.config.yaml.
  • Agent skill: provides investigation and test gardening skills for Claude Code and Codex, using the Sedum CLI and authenticated Cloud history to investigate specific tests and triage failures, recovered retries, slow tests, and regressions. No MCP server required.

Usage

Requires Node.js 20.19 or later, and credentials for TypeSafe (default), a compatible TypeSafe endpoint, or Cloudflare Clef.

For compatible providers, set TYPESAFE_BASE_URL to their API root and TYPESAFE_API_KEY to that provider's key. If their model name differs from the default, set TYPESAFE_DEFAULT_MODEL.

To use Cloudflare Workers AI, choose provider: {name: clef, model: clef} (or clef-flash), and set CLOUDFLARE_ACCOUNT_ID and CLOUDFLARE_AUTH_TOKEN.

The example logs in to a demo store. To see a failure, change its last step to an incorrect assertion, such as verify an error message says the password is incorrect, and run it again: it will fail with exit code 1. If anything is missing, npx sedum doctor will explain what is missing and how to fix it.

Tests are test() in *.test.ts files. Their bodies receive ai for pure English steps, and Playwright's page and context for everything else. A file can contain multiple tests, and each test gets a new browser context.

Tests that do not need code can also be *.test.yaml files containing a list of sentences.

Install Sedum's investigation and test gardening skills into the project:

npx sedum skill install

The skill uses the Sedum CLI and authenticated Cloud history to investigate specific tests and triage failures, recovered retries, slow tests, and regressions. It does not require an MCP server.

When to use

  • Teams that want to run browser e2e tests on every PR but are concerned about cost.
  • Developers who want to write test steps in natural language while retaining the power of TypeScript and Playwright.
  • Testing scenarios that need probabilistic judgments and a transparent scoring mechanism.
  • Teams using coding agents such as Claude Code or Cursor to help fix test failures.
  • Projects that need to run tests in CI and generate JUnit reports.

Limitations

  • Current status is pre-alpha. The first alpha version is published on npm as sedum-cli. The test format may change before 1.0.
  • Windows support is experimental; Linux and macOS are verified.
  • Requires Node.js 20.19 or later.
  • Requires credentials for TypeSafe (default), a compatible TypeSafe endpoint, or Cloudflare Clef.
  • Cloudflare Clef is currently plain-text scope only.
  • Planned 0.1 alpha features include a GitHub Action and launching the app before a run, which are not yet available.
  • Licensed under MIT.
Up/Down to navigate · Enter to open · ESC to closeBrowse all tools