From 0cf6ab68e78bd99c86d38b99c128ad1cd02be556 Mon Sep 17 00:00:00 2001 From: Andrey Lushnikov Date: Fri, 8 Feb 2019 18:58:40 -0800 Subject: [PATCH] feat(firefox): support page.browserContext() (#3965) --- experimental/puppeteer-firefox/lib/Page.js | 7 +++++++ test/page.spec.js | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/experimental/puppeteer-firefox/lib/Page.js b/experimental/puppeteer-firefox/lib/Page.js index f4cad56b..91a35b93 100644 --- a/experimental/puppeteer-firefox/lib/Page.js +++ b/experimental/puppeteer-firefox/lib/Page.js @@ -88,6 +88,13 @@ class Page extends EventEmitter { this._viewport = null; } + /** + * @return {BrowserContext} + */ + browserContext() { + return this._target.browserContext(); + } + _onUncaughtError(params) { let error = new Error(params.message); error.stack = params.stack; diff --git a/test/page.spec.js b/test/page.spec.js index 8bb6392b..20b5fe0d 100644 --- a/test/page.spec.js +++ b/test/page.spec.js @@ -1065,7 +1065,7 @@ module.exports.addTests = function({testRunner, expect, headless, Errors, Device }); }); - describe_fails_ffox('Page.browserContext', function() { + describe('Page.browserContext', function() { it('should return the correct browser instance', async function({page, context, browser}) { expect(page.browserContext()).toBe(context); });