From c025bc6c46f71179787f99f416e67f82f454a276 Mon Sep 17 00:00:00 2001 From: "microsoft-playwright-automation[bot]" <203992400+microsoft-playwright-automation[bot]@users.noreply.github.com> Date: Thu, 2 Jul 2026 11:32:11 +0200 Subject: [PATCH 1/3] feat(webkit): roll to r2321 (#41582) Co-authored-by: microsoft-playwright-automation[bot] <203992400+microsoft-playwright-automation[bot]@users.noreply.github.com> --- packages/playwright-core/browsers.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/playwright-core/browsers.json b/packages/playwright-core/browsers.json index c1af96ccba44c..512a62a7d73cf 100644 --- a/packages/playwright-core/browsers.json +++ b/packages/playwright-core/browsers.json @@ -45,7 +45,7 @@ }, { "name": "webkit", - "revision": "2319", + "revision": "2321", "installByDefault": true, "revisionOverrides": { "mac14": "2251", From a92e459afb2b27c6b046a09663ae363a48f6b3ef Mon Sep 17 00:00:00 2001 From: Dmitry Gozman Date: Thu, 2 Jul 2026 11:10:15 +0100 Subject: [PATCH 2/3] chore: consistently use TestAnnotation type (#41588) --- packages/playwright/src/common/ipc.ts | 8 ++++---- packages/playwright/types/testReporter.d.ts | 6 +++--- utils/generate_types/overrides-testReporter.d.ts | 6 +++--- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/packages/playwright/src/common/ipc.ts b/packages/playwright/src/common/ipc.ts index 27fa4287fe552..6cc0436d33b5f 100644 --- a/packages/playwright/src/common/ipc.ts +++ b/packages/playwright/src/common/ipc.ts @@ -19,7 +19,7 @@ import util from 'util'; import { serializeCompilationCache } from '../transform/compilationCache'; import type { ConfigLocation, FullConfigInternal } from './config'; -import type { ReporterDescription, TestInfoError, TestStatus } from '../../types/test'; +import type { ReporterDescription, TestInfoError, TestStatus, TestAnnotation } from '../../types/test'; import type { SerializedCompilationCache } from '../transform/compilationCache'; export type ConfigCLIOverrides = { @@ -116,7 +116,7 @@ export type TestEndPayload = { errors: TestInfoErrorPayload[]; hasNonRetriableError: boolean; expectedStatus: TestStatus; - annotations: { type: string, description?: string }[]; + annotations: TestAnnotation[]; timeout: number; }; @@ -136,13 +136,13 @@ export type StepEndPayload = { wallTime: number; // milliseconds since unix epoch error?: TestInfoErrorPayload; suggestedRebaseline?: string; - annotations: { type: string, description?: string }[]; + annotations: TestAnnotation[]; }; export type TestEntry = { testId: string; retry: number; - planAnnotations: { type: string, description?: string, location?: { file: string, line: number, column: number } }[]; + planAnnotations: TestAnnotation[]; }; export type RunPayload = { diff --git a/packages/playwright/types/testReporter.d.ts b/packages/playwright/types/testReporter.d.ts index 785f8800cc504..47e406bcd1d82 100644 --- a/packages/playwright/types/testReporter.d.ts +++ b/packages/playwright/types/testReporter.d.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import type { TestStatus, Metadata, PlaywrightTestOptions, PlaywrightWorkerOptions, ReporterDescription, FullConfig, FullProject, Location, WorkerInfo } from './test'; +import type { TestStatus, Metadata, PlaywrightTestOptions, PlaywrightWorkerOptions, ReporterDescription, FullConfig, FullProject, Location, WorkerInfo, TestAnnotation } from './test'; export type { FullConfig, FullProject, TestStatus, Location, WorkerInfo } from './test'; /** @@ -300,7 +300,7 @@ export interface JSONReportSpec { export interface JSONReportTest { timeout: number; - annotations: { type: string, description?: string }[], + annotations: TestAnnotation[], expectedStatus: TestStatus; projectName: string; projectId: string; @@ -332,7 +332,7 @@ export interface JSONReportTestResult { body?: string; contentType: string; }[]; - annotations: { type: string, description?: string }[]; + annotations: TestAnnotation[]; errorLocation?: Location; } diff --git a/utils/generate_types/overrides-testReporter.d.ts b/utils/generate_types/overrides-testReporter.d.ts index a4376aabca5b0..26633625a568f 100644 --- a/utils/generate_types/overrides-testReporter.d.ts +++ b/utils/generate_types/overrides-testReporter.d.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import type { TestStatus, Metadata, PlaywrightTestOptions, PlaywrightWorkerOptions, ReporterDescription, FullConfig, FullProject, Location, WorkerInfo } from './test'; +import type { TestStatus, Metadata, PlaywrightTestOptions, PlaywrightWorkerOptions, ReporterDescription, FullConfig, FullProject, Location, WorkerInfo, TestAnnotation } from './test'; export type { FullConfig, FullProject, TestStatus, Location, WorkerInfo } from './test'; /** @@ -95,7 +95,7 @@ export interface JSONReportSpec { export interface JSONReportTest { timeout: number; - annotations: { type: string, description?: string }[], + annotations: TestAnnotation[], expectedStatus: TestStatus; projectName: string; projectId: string; @@ -127,7 +127,7 @@ export interface JSONReportTestResult { body?: string; contentType: string; }[]; - annotations: { type: string, description?: string }[]; + annotations: TestAnnotation[]; errorLocation?: Location; } From 86b70b67dc666cc5dc88f1921c5ee87eb00b99d0 Mon Sep 17 00:00:00 2001 From: Simon Knott Date: Thu, 2 Jul 2026 12:35:05 +0200 Subject: [PATCH 3/3] fix(tsconfig): fail loudly when extends/references can't be resolved (#41571) --- docs/src/test-typescript-js.md | 2 +- .../src/transform/tsconfig-loader.ts | 9 +++-- tests/playwright-test/resolver.spec.ts | 40 +++++++++++++++++++ 3 files changed, 47 insertions(+), 4 deletions(-) diff --git a/docs/src/test-typescript-js.md b/docs/src/test-typescript-js.md index 8000d90f2ee1c..6a83c061173e6 100644 --- a/docs/src/test-typescript-js.md +++ b/docs/src/test-typescript-js.md @@ -28,7 +28,7 @@ npx tsc -p tsconfig.json --noEmit -w ## tsconfig.json -Playwright will pick up `tsconfig.json` for each source file it loads. Note that Playwright **only supports** the following tsconfig options: `allowJs`, `baseUrl`, `paths` and `references`. +Playwright will pick up `tsconfig.json` for each source file it loads. Note that Playwright **only supports** the following tsconfig options: `allowJs`, `baseUrl`, `paths`, `references` and `extends`. We recommend setting up a separate `tsconfig.json` in the tests directory so that you can change some preferences specifically for the tests. Here is an example directory structure. diff --git a/packages/playwright/src/transform/tsconfig-loader.ts b/packages/playwright/src/transform/tsconfig-loader.ts index 7345fe4e0fd66..3dc9d7e89d9fb 100644 --- a/packages/playwright/src/transform/tsconfig-loader.ts +++ b/packages/playwright/src/transform/tsconfig-loader.ts @@ -61,7 +61,8 @@ export function loadTsConfig(configPath: string): LoadedTsConfig[] { } } -function resolveConfigFile(baseConfigFile: string, referencedConfigFile: string) { +function resolveConfigFile(baseConfigFile: string, referencedConfigFile: string, kind: 'extends' | 'references') { + const originalReferencedConfigFile = referencedConfigFile; if (!referencedConfigFile.endsWith('.json')) referencedConfigFile += '.json'; const currentDir = path.dirname(baseConfigFile); @@ -69,6 +70,8 @@ function resolveConfigFile(baseConfigFile: string, referencedConfigFile: string) // TODO: I don't see how this makes sense, delete in the next minor release. if (referencedConfigFile.includes('/') && referencedConfigFile.includes('.') && !fs.existsSync(resolvedConfigFile)) resolvedConfigFile = path.join(currentDir, 'node_modules', referencedConfigFile); + if (!fs.existsSync(resolvedConfigFile)) + throw new Error(`Failed to resolve "${kind}" path "${originalReferencedConfigFile}" referenced from ${baseConfigFile}`); return resolvedConfigFile; } @@ -95,7 +98,7 @@ function innerLoadTsConfig( const extendsArray = Array.isArray(parsedConfig.extends) ? parsedConfig.extends : (parsedConfig.extends ? [parsedConfig.extends] : []); for (const extendedConfig of extendsArray) { - const extendedConfigPath = resolveConfigFile(configFilePath, extendedConfig); + const extendedConfigPath = resolveConfigFile(configFilePath, extendedConfig, 'extends'); const base = innerLoadTsConfig(extendedConfigPath, references, visited); // Retain result instance, so that caching works. Object.assign(result, base, { tsConfigPath: configFilePath }); @@ -120,7 +123,7 @@ function innerLoadTsConfig( } for (const ref of parsedConfig.references || []) - references.push(innerLoadTsConfig(resolveConfigFile(configFilePath, ref.path), references, visited)); + references.push(innerLoadTsConfig(resolveConfigFile(configFilePath, ref.path, 'references'), references, visited)); if (path.basename(configFilePath) === 'jsconfig.json' && result.allowJs === undefined) result.allowJs = true; diff --git a/tests/playwright-test/resolver.spec.ts b/tests/playwright-test/resolver.spec.ts index 0c4de8a501bae..765897bbe67fd 100644 --- a/tests/playwright-test/resolver.spec.ts +++ b/tests/playwright-test/resolver.spec.ts @@ -587,6 +587,43 @@ test('should resolve paths relative to the originating config when extending and expect(result.exitCode).toBe(0); }); +test('should fail loudly when extends path cannot be resolved', async ({ runInlineTest }) => { + test.info().annotations.push({ type: 'issue', description: 'https://github.com/microsoft/playwright/issues/41543' }); + + const result = await runInlineTest({ + 'tsconfig.json': `{ + "extends": "./tsconfig.bas.json", + }`, + 'a.test.ts': ` + import { test, expect } from '@playwright/test'; + test('test', () => {}); + `, + }); + + expect(result.exitCode).toBe(1); + expect(result.output).toContain('Failed to resolve "extends" path "./tsconfig.bas.json"'); +}); + +test('should fail loudly when references path cannot be resolved', async ({ runInlineTest }) => { + test.info().annotations.push({ type: 'issue', description: 'https://github.com/microsoft/playwright/issues/41543' }); + + const result = await runInlineTest({ + 'tsconfig.json': `{ + "files": [], + "references": [ + { "path": "./tsconfig.doesnotexist.json" } + ] + }`, + 'a.test.ts': ` + import { test, expect } from '@playwright/test'; + test('test', () => {}); + `, + }); + + expect(result.exitCode).toBe(1); + expect(result.output).toContain('Failed to resolve "references" path "./tsconfig.doesnotexist.json"'); +}); + test('should respect tsconfig project references', async ({ runInlineTest }) => { test.info().annotations.push({ type: 'issue', description: 'https://github.com/microsoft/playwright/issues/29256' }); @@ -599,6 +636,9 @@ test('should respect tsconfig project references', async ({ runInlineTest }) => { "path": "./tsconfig.test.json" } ] }`, + 'tsconfig.app.json': `{ + "compilerOptions": {}, + }`, 'tsconfig.test.json': `{ "compilerOptions": { "baseUrl": ".",