test: add a failing test for filechooser after navigation (#11381)

This commit is contained in:
Dmitry Gozman 2022-01-13 11:24:21 -08:00 committed by GitHub
parent 9d5bf0e90d
commit 93a20ee419
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 21 additions and 0 deletions

View File

@ -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']);
});