mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
chore: add test for remote value console logs (#11910)
This commit is contained in:
parent
d14c47097d
commit
9193832a2b
@ -993,6 +993,18 @@
|
||||
"parameters": ["webDriverBiDi"],
|
||||
"expectations": ["SKIP"]
|
||||
},
|
||||
{
|
||||
"testIdPattern": "[page.spec] Page Page.Events.Console should return remote objects",
|
||||
"platforms": ["darwin", "linux", "win32"],
|
||||
"parameters": ["webDriverBiDi"],
|
||||
"expectations": ["FAIL"]
|
||||
},
|
||||
{
|
||||
"testIdPattern": "[page.spec] Page Page.Events.Console should return remote objects",
|
||||
"platforms": ["darwin", "linux", "win32"],
|
||||
"parameters": ["firefox"],
|
||||
"expectations": ["SKIP"]
|
||||
},
|
||||
{
|
||||
"testIdPattern": "[page.spec] Page Page.Events.Console should trigger correct Log",
|
||||
"platforms": ["darwin", "linux", "win32"],
|
||||
|
@ -496,6 +496,21 @@ describe('Page', function () {
|
||||
'JSHandle@window',
|
||||
]);
|
||||
});
|
||||
it('should return remote objects', async () => {
|
||||
const {page} = await getTestState();
|
||||
|
||||
const logPromise = waitEvent<ConsoleMessage>(page, 'console');
|
||||
await page.evaluate(() => {
|
||||
(globalThis as any).test = 1;
|
||||
console.log(1, 2, 3, globalThis);
|
||||
});
|
||||
const log = await logPromise;
|
||||
expect(log.text()).toBe('1 2 3 JSHandle@object');
|
||||
expect(log.args()).toHaveLength(4);
|
||||
expect(await (await log.args()[3]!.getProperty('test')).jsonValue()).toBe(
|
||||
1
|
||||
);
|
||||
});
|
||||
it('should trigger correct Log', async () => {
|
||||
const {page, server, isChrome} = await getTestState();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user