@twai/tool-browser
v0.0.7
Published
Browser automation tool for TWAI (Test With AI) testing framework
Downloads
770
Readme
@twai/tool-browser
Browser automation tool for the TWAI (Test With AI) testing framework.
Installation
pnpm add @twai/tool-browserUsage
import { BrowserTool, createBrowserTools } from "@twai/tool-browser";
const browser = new BrowserTool({
baseUrl: "http://localhost:3000",
headless: true,
});
// Direct usage
await browser.navigate("/login");
await browser.type("#email", "[email protected]");
await browser.click("button[type=submit]");
await browser.screenshot("login.png");
// As AI tool definitions
const tools = createBrowserTools(browser);Exports
BrowserTool- Browser automation classcreateBrowserTools- Create AI tool definitions- Types:
BrowserOptions,ElementInfo,PageInfo
