feat(headful): remove bringToFront (#84)

This commit is contained in:
Pavel Feldman 2019-11-26 11:00:54 -08:00 committed by Dmitry Gozman
parent d7b727df1c
commit 2eb653740a
3 changed files with 0 additions and 31 deletions

View file

@ -86,7 +86,6 @@
* [page.addScriptTag(options)](#pageaddscripttagoptions) * [page.addScriptTag(options)](#pageaddscripttagoptions)
* [page.addStyleTag(options)](#pageaddstyletagoptions) * [page.addStyleTag(options)](#pageaddstyletagoptions)
* [page.authenticate(credentials)](#pageauthenticatecredentials) * [page.authenticate(credentials)](#pageauthenticatecredentials)
* [page.bringToFront()](#pagebringtofront)
* [page.browser()](#pagebrowser) * [page.browser()](#pagebrowser)
* [page.browserContext()](#pagebrowsercontext) * [page.browserContext()](#pagebrowsercontext)
* [page.click(selector[, options])](#pageclickselector-options) * [page.click(selector[, options])](#pageclickselector-options)
@ -1091,12 +1090,6 @@ Provide credentials for [HTTP authentication](https://developer.mozilla.org/en-U
To disable authentication, pass `null`. To disable authentication, pass `null`.
#### page.bringToFront()
- returns: <[Promise]>
Brings page to front (activates tab).
#### page.browser() #### page.browser()
- returns: <[Browser]> - returns: <[Browser]>

View file

@ -514,10 +514,6 @@ export class Page extends EventEmitter {
return response; return response;
} }
async bringToFront() {
await this._client.send('Page.bringToFront');
}
async emulate(options: { viewport: Viewport; userAgent: string; }) { async emulate(options: { viewport: Viewport; userAgent: string; }) {
await Promise.all([ await Promise.all([
this.setViewport(options.viewport), this.setViewport(options.viewport),

View file

@ -128,25 +128,5 @@ module.exports.addTests = function({testRunner, expect, playwright, defaultBrows
await browser.close(); await browser.close();
}); });
}); });
describe('Page.bringToFront', function() {
it('should work', async() => {
const browser = await playwright.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();
});
});
}; };