mirror of
https://github.com/microsoft/playwright.git
synced 2025-06-26 21:40:17 +00:00
test: init script runs onces in iframes (#27057)
Failing test for #26992.
This commit is contained in:
parent
ce43ea7d99
commit
1424185c23
@ -83,3 +83,19 @@ it('should work after a cross origin navigation', async ({ page, server }) => {
|
|||||||
await page.goto(server.PREFIX + '/tamperable.html');
|
await page.goto(server.PREFIX + '/tamperable.html');
|
||||||
expect(await page.evaluate(() => window['result'])).toBe(123);
|
expect(await page.evaluate(() => window['result'])).toBe(123);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('init script should run only once in iframe', async ({ page, server, browserName }) => {
|
||||||
|
it.info().annotations.push({ type: 'issue', description: 'https://github.com/microsoft/playwright/issues/26992' });
|
||||||
|
it.fixme(browserName === 'webkit');
|
||||||
|
const messages = [];
|
||||||
|
page.on('console', event => {
|
||||||
|
if (event.text().startsWith('init script:'))
|
||||||
|
messages.push(event.text());
|
||||||
|
});
|
||||||
|
await page.addInitScript(() => console.log('init script:', location.pathname || 'no url yet'));
|
||||||
|
await page.goto(server.PREFIX + '/frames/one-frame.html');
|
||||||
|
expect(messages).toEqual([
|
||||||
|
'init script: /frames/one-frame.html',
|
||||||
|
'init script: ' + (browserName === 'firefox' ? 'no url yet' : '/frames/frame.html'),
|
||||||
|
]);
|
||||||
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user