mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
chore: update tests (#12081)
This commit is contained in:
parent
26376224d5
commit
02b9678f85
@ -467,6 +467,13 @@
|
||||
"expectations": ["FAIL"],
|
||||
"comment": "TODO: add a comment explaining why this expectation is required (include links to issues)"
|
||||
},
|
||||
{
|
||||
"testIdPattern": "[jshandle.spec] JSHandle JSHandle.toString should work with window subtypes",
|
||||
"platforms": ["darwin", "linux", "win32"],
|
||||
"parameters": ["cdp"],
|
||||
"expectations": ["FAIL"],
|
||||
"comment": "CDP does not have special type for window"
|
||||
},
|
||||
{
|
||||
"testIdPattern": "[jshandle.spec] JSHandle Page.evaluateHandle should return the RemoteObject",
|
||||
"platforms": ["darwin", "linux", "win32"],
|
||||
@ -685,7 +692,7 @@
|
||||
"platforms": ["darwin", "linux", "win32"],
|
||||
"parameters": ["webDriverBiDi"],
|
||||
"expectations": ["FAIL"],
|
||||
"comment": "TODO: add a comment explaining why this expectation is required (include links to issues)"
|
||||
"comment": "BiDi does not support getting a Handle for log args"
|
||||
},
|
||||
{
|
||||
"testIdPattern": "[page.spec] Page Page.Events.Console should return remote objects",
|
||||
|
@ -326,6 +326,16 @@ describe('JSHandle', function () {
|
||||
'JSHandle@proxy'
|
||||
);
|
||||
});
|
||||
it('should work with window subtypes', async () => {
|
||||
const {page} = await getTestState();
|
||||
|
||||
expect((await page.evaluateHandle('window')).toString()).toBe(
|
||||
'JSHandle@window'
|
||||
);
|
||||
expect((await page.evaluateHandle('globalThis')).toString()).toBe(
|
||||
'JSHandle@window'
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
describe('JSHandle[Symbol.dispose]', () => {
|
||||
|
@ -506,11 +506,14 @@ describe('Page', function () {
|
||||
console.log(1, 2, 3, globalThis);
|
||||
});
|
||||
const log = await logPromise;
|
||||
expect(log.text()).toBe('1 2 3 JSHandle@object');
|
||||
|
||||
expect(log.text()).atLeastOneToContain([
|
||||
'1 2 3 JSHandle@object',
|
||||
'1 2 3 JSHandle@window',
|
||||
]);
|
||||
expect(log.args()).toHaveLength(4);
|
||||
expect(await (await log.args()[3]!.getProperty('test')).jsonValue()).toBe(
|
||||
1
|
||||
);
|
||||
using property = await log.args()[3]!.getProperty('test');
|
||||
expect(await property.jsonValue()).toBe(1);
|
||||
});
|
||||
it('should trigger correct Log', async () => {
|
||||
const {page, server, isChrome} = await getTestState();
|
||||
|
Loading…
Reference in New Issue
Block a user