runners brings execution, reliability, and distribution to async TypeScript.
Build tests and checks that can run locally, in CI, or distributed across regions with ease.
import type { Runner } from "runners";
import { withPlaywright } from "runners/playwright";
import { z } from "zod";
export const ExampleTitleInputSchema = z.object({ url: z.string()});
export const exampleTitleVisibleTest: Runner<
typeof ExampleTitleInputSchema,
typeof ExampleTitleOutputSchema
> = async (ctx, input) => {
"use runner";
const { page, url, log } = await withPlaywright(ctx, input.url);
log("Checking page title", { url });
const title = await page.title();
const ok = title.length > 0;
return {
name: "example_title_visible",
status: ok ? "pass" : "fail",
details: { title },
};
};