mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
chore: add test console after navigation (#10110)
This commit is contained in:
parent
3fb8135f68
commit
4615607b7d
@ -425,6 +425,12 @@
|
||||
"parameters": ["cdp", "firefox"],
|
||||
"expectations": ["SKIP"]
|
||||
},
|
||||
{
|
||||
"testIdPattern": "[page.spec] Page Page.Events.Console should work on script call right after navigation",
|
||||
"platforms": ["darwin", "linux", "win32"],
|
||||
"parameters": ["webDriverBiDi"],
|
||||
"expectations": ["PASS"]
|
||||
},
|
||||
{
|
||||
"testIdPattern": "[page.spec] Page Page.setContent *",
|
||||
"platforms": ["darwin", "linux", "win32"],
|
||||
|
@ -649,6 +649,19 @@ describe('Page', function () {
|
||||
expect(await message.args()[1]!.jsonValue()).toEqual(5);
|
||||
expect(await message.args()[2]!.jsonValue()).toEqual({foo: 'bar'});
|
||||
});
|
||||
it('should work on script call right after navigation', async () => {
|
||||
const {page} = getTestState();
|
||||
|
||||
const [message] = await Promise.all([
|
||||
waitEvent<ConsoleMessage>(page, 'console'),
|
||||
page.goto(
|
||||
// Firefox prints warn if <!DOCTYPE html> is not present
|
||||
`data:text/html,<!DOCTYPE html><script>console.log('SOME_LOG_MESSAGE');</script>`
|
||||
),
|
||||
]);
|
||||
|
||||
expect(message.text()).toEqual('SOME_LOG_MESSAGE');
|
||||
});
|
||||
it('should work for different console API calls with logging functions', async () => {
|
||||
const {page} = getTestState();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user