Add Page.browser() method (#2387)

Call page.browser() to get the browser instance associated with a
page.

Fixes #2275
This commit is contained in:
Arne Martin Aurlien
2018-04-17 19:37:17 +02:00
committed by Andrey Lushnikov
parent 6eb6ce0ec9
commit 082b11aa57
5 changed files with 39 additions and 3 deletions

View File

@@ -1562,4 +1562,10 @@ module.exports.addTests = function({testRunner, expect, puppeteer, DeviceDescrip
await closedPromise;
});
});
describe('Page.browser', function() {
it('should return the correct browser instance', async function({ page, browser }) {
expect(page.browser()).toBe(browser);
});
});
};