fix: exclude `tracesDir` option from `launchOptions` fixture (#24086)

Fixes https://github.com/microsoft/playwright/issues/23645
This commit is contained in:
Andrey Lushnikov 2023-07-06 13:31:44 -07:00 committed by GitHub
parent 3536e81d77
commit 9af2b518f2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 19 additions and 2 deletions

View File

@ -3530,7 +3530,7 @@ export interface PlaywrightWorkerOptions {
* ```
*
*/
launchOptions: LaunchOptions;
launchOptions: Omit<LaunchOptions, 'tracesDir'>;
/**
* **Usage**
*

View File

@ -480,3 +480,20 @@ test('should have correct types for the config', async ({ runTSC }) => {
});
expect(result.exitCode).toBe(0);
});
test('should not allow tracesDir in launchOptions', async ({ runTSC }) => {
const result = await runTSC({
'playwright.config.ts': `
import { defineConfig } from '@playwright/test';
export default defineConfig({
use: {
launchOptions: {
tracesDir: 'foo',
},
},
});
`
});
expect(result.exitCode).not.toBe(0);
});

View File

@ -203,7 +203,7 @@ export interface PlaywrightWorkerOptions {
defaultBrowserType: BrowserName;
headless: boolean;
channel: BrowserChannel | undefined;
launchOptions: LaunchOptions;
launchOptions: Omit<LaunchOptions, 'tracesDir'>;
connectOptions: ConnectOptions | undefined;
screenshot: ScreenshotMode | { mode: ScreenshotMode } & Pick<PageScreenshotOptions, 'fullPage' | 'omitBackground'>;
trace: TraceMode | /** deprecated */ 'retry-with-trace' | { mode: TraceMode, snapshots?: boolean, screenshots?: boolean, sources?: boolean, attachments?: boolean };