diff --git a/tests/library/capabilities.spec.ts b/tests/library/capabilities.spec.ts index 76b25f0518..116784854f 100644 --- a/tests/library/capabilities.spec.ts +++ b/tests/library/capabilities.spec.ts @@ -408,3 +408,23 @@ it('should be able to render avif images', { })); expect(await page.evaluate(() => (window as any).error)).toBe(undefined); }); + +it('should not crash when clicking a label with a ', { + annotation: { + type: 'issue', + description: 'https://github.com/microsoft/playwright/issues/33257' + } +}, async ({ page }) => { + await page.setContent(` +
+ `); + const fileChooserPromise = page.waitForEvent('filechooser'); + await page.getByText('A second file').click(); + const fileChooser = await fileChooserPromise; + expect(fileChooser.page()).toBe(page); +});