Skip to content

First steps

This page walks you from a blank project to a passing agent test in under five minutes. For installation, see Getting started → Installation.

Terminal window
$ bunx blop init

This creates tests/homepage.blop.ts:

import { agentTest, describe } from "blop";
describe("homepage", () => {
agentTest("loads", async ({ agent }) => {
await agent.goto("/");
await agent.goal("Verify the homepage loads and the primary user action is visible.");
});
});

agent.goto() and agent.goal() don’t run anything immediately — they build a numbered goal list the agent receives when the runner reaches the test.

Terminal window
$ bunx blop test --base-url http://localhost:3000

What happens:

  1. Blop discovers any **/*.blop.ts spec under the current directory.
  2. It launches a Playwright browser (Chromium by default).
  3. The agent receives your goal and a curated set of browser tools.
  4. The agent navigates, inspects, asserts, and finally calls finish_test.
  5. Blop writes a structured run result to .blop/.

After a run, the report directory (default: .blop/) contains:

File Description
.blop/results.json Structured BlopRunResult with every test outcome
.blop/events.jsonl One agent event per line — useful for debugging
.blop/report.xml JUnit-compatible XML for CI consumers
.blop/screenshots/ Screenshots captured during the run

See Reporters & output to choose a format and consume the result schema downstream.

Drop a blop.config.ts at your project root to avoid passing flags every run:

import type { BlopConfig } from "blop";
export default {
baseUrl: "http://localhost:3000",
browser: "chromium",
reporter: "all",
include: ["tests/**/*.blop.ts"],
} satisfies BlopConfig;

CLI flags always override config values. Full options live in Configuration.

While iterating on a spec:

Terminal window
$ bunx blop watch tests/

Reruns affected tests on file change. Polls every second. Press Ctrl+C to stop.