From c0c1f0cfe0396fcbbb48e41853d0289656902d6b Mon Sep 17 00:00:00 2001 From: Yury Semikhatsky Date: Fri, 22 Nov 2024 12:36:39 -0800 Subject: [PATCH] fix(webkit): do not auto play audio without user gesture Fixes https://github.com/microsoft/playwright/issues/33590 --- packages/playwright-core/browsers.json | 2 +- tests/library/capabilities.spec.ts | 33 ++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/packages/playwright-core/browsers.json b/packages/playwright-core/browsers.json index b1d8b9487e..e4b95c9a59 100644 --- a/packages/playwright-core/browsers.json +++ b/packages/playwright-core/browsers.json @@ -33,7 +33,7 @@ }, { "name": "webkit", - "revision": "2108", + "revision": "2110", "installByDefault": true, "revisionOverrides": { "debian11-x64": "2105", diff --git a/tests/library/capabilities.spec.ts b/tests/library/capabilities.spec.ts index 116784854f..2360f9307b 100644 --- a/tests/library/capabilities.spec.ts +++ b/tests/library/capabilities.spec.ts @@ -428,3 +428,36 @@ it('should not crash when clicking a label with a ', { const fileChooser = await fileChooserPromise; expect(fileChooser.page()).toBe(page); }); + +it('should not auto play audio', { + annotation: { + type: 'issue', + description: 'https://github.com/microsoft/playwright/issues/33590' + } +}, async ({ page }) => { + await page.route('**/*', async (route) => { + route.fulfill({ + status: 200, + contentType: 'text/html', + body: ` + +
+ `, + }); + }); + await page.goto('http://127.0.0.1/audio.html'); + await expect(page.locator('#log')).toHaveText('State: suspended'); +});