KC's Workspace
    Preparing search index...
    interface ResolvedBrowserOptions {
        api: ApiConfig;
        commands?: Record<string, BrowserCommand<any, any>>;
        connectTimeout?: number;
        enabled: boolean;
        expect?: { toMatchScreenshot?: undefined };
        fileParallelism: boolean;
        headless: boolean;
        instances?: BrowserInstanceOption[];
        isolate: boolean;
        locators: { testIdAttribute: string };
        name: string;
        orchestratorScripts?: BrowserScript[];
        provider?: BrowserProviderOption<object>;
        screenshotDirectory?: string;
        screenshotFailures: boolean;
        testerHtmlPath?: string;
        trace: {
            mode: BrowserTraceViewMode;
            screenshots?: boolean;
            snapshots?: boolean;
            tracesDir?: string;
        };
        trackUnhandledErrors?: boolean;
        ui: boolean;
        viewport: { height: number; width: number };
    }

    Hierarchy (View Summary)

    Index

    Properties

    Serve API options.

    The default port is 63315.

    commands?: Record<string, BrowserCommand<any, any>>

    Commands that will be executed on the server via the browser import("vitest/browser").commands API.

    connectTimeout?: number

    Timeout for connecting to the browser

    30000
    
    enabled: boolean

    if running tests in the browser should be the default

    false
    
    expect?: { toMatchScreenshot?: undefined }
    fileParallelism: boolean

    Run test files in parallel if provider supports this option This option only has effect in headless mode (enabled in CI by default)

    // Same as "test.fileParallelism"
    

    use top-level fileParallelism instead

    headless: boolean

    enable headless mode

    process.env.CI
    
    instances?: BrowserInstanceOption[]

    Configurations for different browser setups

    isolate: boolean

    Isolate test environment after each test

    true
    

    use top-level isolate instead

    locators: { testIdAttribute: string }

    Locator options

    name: string
    orchestratorScripts?: BrowserScript[]

    Scripts injected into the main window.

    provider?: BrowserProviderOption<object>

    Browser provider

    import { playwright } from '@vitest/browser-playwright'
    export default defineConfig({
    test: {
    browser: {
    provider: playwright(),
    },
    },
    })
    screenshotDirectory?: string

    Directory where screenshots will be saved when page.screenshot() is called If not set, all screenshots are saved to screenshots directory in the same folder as the test file. If this is set, it will be resolved relative to the project root.

    __screenshots__
    
    screenshotFailures: boolean

    Should Vitest take screenshots if the test fails

    !browser.ui
    
    testerHtmlPath?: string

    Path to the index.html file that will be used to run tests.

    trace: {
        mode: BrowserTraceViewMode;
        screenshots?: boolean;
        snapshots?: boolean;
        tracesDir?: string;
    }

    Generate traces that can be viewed on https://trace.playwright.dev/

    This option is supported only by playwright provider.

    trackUnhandledErrors?: boolean

    Enables tracking uncaught errors and exceptions so they can be reported by Vitest.

    If you need to hide certain errors, it is recommended to use onUnhandledError option instead.

    Disabling this will completely remove all Vitest error handlers, which can help debugging with the "Pause on exceptions" checkbox turned on.

    true
    
    ui: boolean

    Show Vitest UI

    !process.env.CI
    
    viewport: { height: number; width: number }

    Default viewport size