mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
fix(firefox): enable more firefox tests (#4007)
This commit is contained in:
parent
e8f044c3be
commit
247733b879
@ -59,11 +59,18 @@ class ExecutionContext {
|
||||
return {unserializableValue: 'NaN'};
|
||||
return {value: arg};
|
||||
});
|
||||
const payload = await this._session.send('Page.evaluate', {
|
||||
functionText,
|
||||
args,
|
||||
executionContextId: this._executionContextId
|
||||
});
|
||||
let payload = null;
|
||||
try {
|
||||
payload = await this._session.send('Page.evaluate', {
|
||||
functionText,
|
||||
args,
|
||||
executionContextId: this._executionContextId
|
||||
});
|
||||
} catch (err) {
|
||||
if (err instanceof TypeError && err.message === 'Converting circular structure to JSON')
|
||||
err.message += ' Are you passing a nested JSHandle?';
|
||||
throw err;
|
||||
}
|
||||
return createHandle(this, payload.result, payload.exceptionDetails);
|
||||
}
|
||||
|
||||
|
@ -14,13 +14,13 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
module.exports.addTests = function({testRunner, expect}) {
|
||||
module.exports.addTests = function({testRunner, expect, CHROME}) {
|
||||
const {describe, xdescribe, fdescribe} = testRunner;
|
||||
const {it, fit, xit, it_fails_ffox} = testRunner;
|
||||
const {beforeAll, beforeEach, afterAll, afterEach} = testRunner;
|
||||
|
||||
describe('Page.evaluateHandle', function() {
|
||||
it_fails_ffox('should work', async({page, server}) => {
|
||||
it('should work', async({page, server}) => {
|
||||
const windowHandle = await page.evaluateHandle(() => window);
|
||||
expect(windowHandle).toBeTruthy();
|
||||
});
|
||||
@ -34,7 +34,7 @@ module.exports.addTests = function({testRunner, expect}) {
|
||||
const isFive = await page.evaluate(e => Object.is(e, 5), aHandle);
|
||||
expect(isFive).toBeTruthy();
|
||||
});
|
||||
it_fails_ffox('should warn on nested object handles', async({page, server}) => {
|
||||
it('should warn on nested object handles', async({page, server}) => {
|
||||
const aHandle = await page.evaluateHandle(() => document.body);
|
||||
let error = null;
|
||||
await page.evaluateHandle(
|
||||
@ -86,11 +86,14 @@ module.exports.addTests = function({testRunner, expect}) {
|
||||
const json = await dateHandle.jsonValue();
|
||||
expect(json).toEqual({});
|
||||
});
|
||||
it_fails_ffox('should throw for circular objects', async({page, server}) => {
|
||||
it('should throw for circular objects', async({page, server}) => {
|
||||
const windowHandle = await page.evaluateHandle('window');
|
||||
let error = null;
|
||||
await windowHandle.jsonValue().catch(e => error = e);
|
||||
expect(error.message).toContain('Object reference chain is too long');
|
||||
if (CHROME)
|
||||
expect(error.message).toContain('Object reference chain is too long');
|
||||
else
|
||||
expect(error.message).toContain('Object is not serializable');
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -61,7 +61,7 @@ module.exports.addTests = function({testRunner, expect, Errors, CHROME}) {
|
||||
else
|
||||
expect(error.message).toContain('NS_BINDING_ABORTED');
|
||||
});
|
||||
it_fails_ffox('should navigate to empty page with domcontentloaded', async({page, server}) => {
|
||||
it('should navigate to empty page with domcontentloaded', async({page, server}) => {
|
||||
const response = await page.goto(server.EMPTY_PAGE, {waitUntil: 'domcontentloaded'});
|
||||
expect(response.status()).toBe(200);
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user