Auto-Browse seamlessly integrates with Playwright’s testing framework, allowing you to combine natural language commands with Playwright’s powerful testing capabilities.
Here’s how to use Auto-Browse in your Playwright tests:
Copy
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");});