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"],
|
"expectations": ["FAIL"],
|
||||||
"comment": "TODO: add a comment explaining why this expectation is required (include links to issues)"
|
"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",
|
"testIdPattern": "[jshandle.spec] JSHandle Page.evaluateHandle should return the RemoteObject",
|
||||||
"platforms": ["darwin", "linux", "win32"],
|
"platforms": ["darwin", "linux", "win32"],
|
||||||
@ -685,7 +692,7 @@
|
|||||||
"platforms": ["darwin", "linux", "win32"],
|
"platforms": ["darwin", "linux", "win32"],
|
||||||
"parameters": ["webDriverBiDi"],
|
"parameters": ["webDriverBiDi"],
|
||||||
"expectations": ["FAIL"],
|
"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",
|
"testIdPattern": "[page.spec] Page Page.Events.Console should return remote objects",
|
||||||
|
@ -326,6 +326,16 @@ describe('JSHandle', function () {
|
|||||||
'JSHandle@proxy'
|
'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]', () => {
|
describe('JSHandle[Symbol.dispose]', () => {
|
||||||
|
@ -506,11 +506,14 @@ describe('Page', function () {
|
|||||||
console.log(1, 2, 3, globalThis);
|
console.log(1, 2, 3, globalThis);
|
||||||
});
|
});
|
||||||
const log = await logPromise;
|
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(log.args()).toHaveLength(4);
|
||||||
expect(await (await log.args()[3]!.getProperty('test')).jsonValue()).toBe(
|
using property = await log.args()[3]!.getProperty('test');
|
||||||
1
|
expect(await property.jsonValue()).toBe(1);
|
||||||
);
|
|
||||||
});
|
});
|
||||||
it('should trigger correct Log', async () => {
|
it('should trigger correct Log', async () => {
|
||||||
const {page, server, isChrome} = await getTestState();
|
const {page, server, isChrome} = await getTestState();
|
||||||
|
Loading…
Reference in New Issue
Block a user