/** * QA360 Playwright Native Adapter * * Zero-overhead adapter that uses Playwright's native API directly. * This bypasses any wrapper logic and gives full access to Playwright's capabilities. * * Benefits: * - Zero performance overhead * - Full Playwright API access * - Native video/trace/screenshot support * - Direct access to browser context, page, locators */ import { Browser, BrowserContext, Page, Locator } from '@playwright/test'; import type { WebTarget, PackBudgets, UiTestDefinition, UiTestStep } from '../types/pack-v1.js'; export interface PlaywrightNativeConfig { target: WebTarget; budgets?: PackBudgets; timeout?: number; browser?: 'chromium' | 'firefox' | 'webkit'; headless?: boolean; slowMo?: number; devtools?: boolean; device?: 'desktop' | 'tablet' | 'mobile' | 'custom'; viewport?: { width: number; height: number; }; userAgent?: string; locale?: string; timezone?: string; screenshots?: 'always' | 'only-on-failure' | 'never'; video?: 'always' | 'retain-on-failure' | 'never'; trace?: 'always' | 'retain-on-failure' | 'never' | 'on-first-failure'; bail?: number; workers?: number; ignoreHTTPSErrors?: boolean; acceptDownloads?: boolean; bypassCSP?: boolean; } export interface PlaywrightNativeResult { success: boolean; duration: number; artifacts?: { screenshots: string[]; videos: string[]; traces: string[]; }; error?: string; coverage?: { lines: number; statements: number; branches: number; functions: number; }; } export interface PlaywrightNativeStepResult { step: UiTestStep; success: boolean; duration: number; error?: string; screenshot?: string; } /** * Playwright Native Adapter * * Provides zero-overhead access to Playwright with automatic * artifact collection (screenshots, videos, traces). */ export declare class PlaywrightNativeAdapter { private config; private browser?; private context?; private page?; private artifacts?; private assertions?; private testResults; private failureCount; constructor(config: PlaywrightNativeConfig); /** * Run a single E2E test with full Playwright native access */ runTest(test: UiTestDefinition): Promise; /** * Execute a single step using Playwright native API */ private executeStep; /** * Execute action using Playwright native API */ private executeAction; /** * Setup browser with trace context */ private setup; /** * Teardown and save artifacts */ private teardown; /** * Get artifact paths for result */ private getArtifactPaths; /** * Get direct access to Playwright objects */ getBrowser(): Browser | undefined; getContext(): BrowserContext | undefined; getPage(): Page | undefined; /** * Get locator for direct manipulation */ locator(selector: string): Locator; } /** * Create a Playwright Native Adapter */ export declare function createPlaywrightNativeAdapter(config: PlaywrightNativeConfig): PlaywrightNativeAdapter; /** * Create adapter from WebTarget (convenience function) */ export declare function createFromTarget(target: WebTarget, options?: Partial): PlaywrightNativeAdapter;