feat(Page): introduce Page bringToFront method (#1252)
This patch introduces Page.bringToFront method to activate tabs. Fixes #1244
This commit is contained in:
parent
9de34499ef
commit
77f585298f
@ -45,6 +45,7 @@
|
|||||||
* [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.click(selector[, options])](#pageclickselector-options)
|
* [page.click(selector[, options])](#pageclickselector-options)
|
||||||
* [page.close()](#pageclose)
|
* [page.close()](#pageclose)
|
||||||
* [page.content()](#pagecontent)
|
* [page.content()](#pagecontent)
|
||||||
@ -524,6 +525,12 @@ 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.click(selector[, options])
|
#### page.click(selector[, options])
|
||||||
- `selector` <[string]> A [selector] to search for element to click. If there are multiple elements satisfying the selector, the first will be clicked.
|
- `selector` <[string]> A [selector] to search for element to click. If there are multiple elements satisfying the selector, the first will be clicked.
|
||||||
- `options` <[Object]>
|
- `options` <[Object]>
|
||||||
|
@ -544,6 +544,10 @@ class Page extends EventEmitter {
|
|||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async bringToFront() {
|
||||||
|
await this._client.send('Page.bringToFront');
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {!Object} options
|
* @param {!Object} options
|
||||||
*/
|
*/
|
||||||
|
@ -3118,7 +3118,7 @@ describe('Page', function() {
|
|||||||
if (process.env.COVERAGE) {
|
if (process.env.COVERAGE) {
|
||||||
describe('COVERAGE', function(){
|
describe('COVERAGE', function(){
|
||||||
const coverage = helper.publicAPICoverage();
|
const coverage = helper.publicAPICoverage();
|
||||||
const disabled = new Set();
|
const disabled = new Set(['page.bringToFront']);
|
||||||
if (!headless)
|
if (!headless)
|
||||||
disabled.add('page.pdf');
|
disabled.add('page.pdf');
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user