diff --git a/test/headful.spec.js b/test/headful.spec.js index a35a11e12ebe5..b1d999784ab76 100644 --- a/test/headful.spec.js +++ b/test/headful.spec.js @@ -117,5 +117,25 @@ module.exports.addTests = function({testRunner, expect, puppeteer, defaultBrowse await browser.close(); }); }); + + describe('Page.bringToFront', function() { + it('should work', async() => { + const browser = await puppeteer.launch(headfulOptions); + const page1 = await browser.newPage(); + const page2 = await browser.newPage(); + + await page1.bringToFront(); + expect(await page1.evaluate(() => document.visibilityState)).toBe('visible'); + expect(await page2.evaluate(() => document.visibilityState)).toBe('hidden'); + + await page2.bringToFront(); + expect(await page1.evaluate(() => document.visibilityState)).toBe('hidden'); + expect(await page2.evaluate(() => document.visibilityState)).toBe('visible'); + + await page1.close(); + await page2.close(); + await browser.close(); + }); + }); }; diff --git a/test/test.js b/test/test.js index fc3e1b6461811..c9ee901dee59e 100644 --- a/test/test.js +++ b/test/test.js @@ -73,7 +73,6 @@ beforeEach(async({server, httpsServer}) => { }); const CHROMIUM_NO_COVERAGE = new Set([ - 'page.bringToFront', ]); if (process.env.BROWSER === 'firefox') {