SDK Reference
Navigation
Page navigation, snapshots, screenshots, and state observation.
page
get page(): Page
Raw Playwright Page instance. Use for advanced scenarios not covered by the OpenSteer API.
context
get context(): BrowserContext
Raw Playwright BrowserContext instance.
goto
goto(url: string, options?: GotoOptions): Promise<void>
Navigate to a URL. Waits for visual stability by default.
await opensteer.goto('https://example.com')
await opensteer.goto('https://example.com', { waitUntil: 'networkidle', settleMs: 2000 })
| Option | Type | Default | Description |
|---|---|---|---|
waitUntil | string | 'domcontentloaded' | Playwright load state |
settleMs | number | 1000 | Visual stability wait after load |
snapshot
snapshot(options?: SnapshotOptions): Promise<string>
Capture a counter-annotated HTML snapshot. See Snapshots for mode details.
const html = await opensteer.snapshot({ mode: 'action' })
const html = await opensteer.snapshot({ mode: 'extraction' })
screenshot
screenshot(options?: ScreenshotOptions): Promise<Buffer>
Capture a screenshot.
const buffer = await opensteer.screenshot()
await opensteer.screenshot({ path: 'page.png', fullPage: true })
| Option | Type | Default | Description |
|---|---|---|---|
path | string | — | File path to save |
type | 'png' | 'jpeg' | 'png' | Image format |
quality | number | — | JPEG quality (0-100) |
fullPage | boolean | false | Capture full scrollable page |
state
state(): Promise<StateResult>
Return current page URL, title, and HTML.
const { url, title, html } = await opensteer.state()
getTitle
getTitle(): Promise<string>
Return the page title.
getHtml
getHtml(selector?: string): Promise<string>
Return innerHTML of the page or a specific selector.
waitForText
waitForText(text: string, options?: WaitOptions): Promise<void>
Wait for text to appear on the page. Default timeout: 30 seconds.
await opensteer.waitForText('Welcome')
await opensteer.waitForText('Loading complete', { timeout: 10000 })
