mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
test: add page.bringToFront test (#4778)
Test `page.bringToFront` in headful.
This commit is contained in:
parent
f733c334dc
commit
eb44e260a9
@ -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();
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
|
@ -73,7 +73,6 @@ beforeEach(async({server, httpsServer}) => {
|
||||
});
|
||||
|
||||
const CHROMIUM_NO_COVERAGE = new Set([
|
||||
'page.bringToFront',
|
||||
]);
|
||||
|
||||
if (process.env.BROWSER === 'firefox') {
|
||||
|
Loading…
Reference in New Issue
Block a user