Class: PlaywrightAdapter
Defined in: packages/uimatch-core/src/adapters/playwright.ts:19
Playwright implementation of BrowserAdapter. Uses Chromium to capture screenshots and extract computed styles.
Supports browser reuse via browser pool for improved performance.
Implements
Constructors
Constructor
new PlaywrightAdapter(options?): PlaywrightAdapter;
Defined in: packages/uimatch-core/src/adapters/playwright.ts:26
Parameters
options?
reuseBrowser?
boolean
Returns
PlaywrightAdapter
Methods
captureTarget()
captureTarget(opts): Promise<CaptureResult>;
Defined in: packages/uimatch-core/src/adapters/playwright.ts:45
Captures a screenshot and computed styles of a web page element.
Parameters
opts
Configuration options
Returns
Promise<CaptureResult>
Screenshot, styles, and bounding box
Throws
If url or html is missing, or element not found
Example
const adapter = new PlaywrightAdapter();
const result = await adapter.captureTarget({
url: 'https://example.com',
selector: '#button',
});