Playwright Test Mode

Auto-Browse seamlessly integrates with Playwright’s testing framework, allowing you to combine natural language commands with Playwright’s powerful testing capabilities.

Basic Integration

Here’s how to use Auto-Browse in your Playwright tests:

import { test, expect } from "@playwright/test";
import { auto } from "auto-browse";

test("basic test example", async ({ page }) => {
	await page.goto("https://example.com");

	// Use natural language commands with Auto-Browse
	const headerText = await auto("get the header text");
	expect(headerText).toBeTruthy();

	// Mix with regular Playwright commands
	await auto('type "Hello World" in the search box');
	await page.keyboard.press("Enter");
});

Key Features

  • Natural Language Commands: Write tests using plain English
  • Page Context Detection: Automatically works with your Playwright page context
  • Seamless Integration: Mix Auto-Browse with regular Playwright commands
  • Test Organization: Perfect for fixtures, groups, and complex workflows

Next Steps