Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.
TypeScript automationchromechromiume2e-testingelectronend-to-end-testingfirefoxjavascriptplaywrighttesttest-automationtestingtesting-toolswebwebkit
test: add a failing test for filechooser after navigation (#11381)
Dmitry Gozman93a20ee41942
diff --git a/tests/page/page-set-input-files.spec.ts b/tests/page/page-set-input-files.spec.tsindex 4a14730e90..520ca5a5b1 100644--- a/tests/page/page-set-input-files.spec.ts+++ b/tests/page/page-set-input-files.spec.ts@@ -397,3 +397,24 @@ it('should work for "webkitdirectory"', async ({ page, server }) => {]);expect(fileChooser.isMultiple()).toBe(true);});++it('should emit event after navigation', async ({ page, server, browserName }) => {+ it.info().annotations.push({ type: 'issue', description: 'https://github.com/microsoft/playwright/issues/11375' });+ it.fixme(browserName === 'chromium' || browserName === 'webkit');++ const logs = [];+ page.on('filechooser', () => logs.push('filechooser'));+ await page.goto(server.PREFIX + '/empty.html');+ await page.setContent(`<input type=file>`);+ await Promise.all([+ page.waitForEvent('filechooser'),+ page.click('input'),+ ]);+ await page.goto(server.CROSS_PROCESS_PREFIX + '/empty.html');+ await page.setContent(`<input type=file>`);+ await Promise.all([+ page.waitForEvent('filechooser'),+ page.click('input'),+ ]);+ expect(logs).toEqual(['filechooser', 'filechooser']);+});