feat(page): use secondary world to drive clicks (#3828)

References #2671
This commit is contained in:
Andrey Lushnikov
2019-01-22 23:24:14 -05:00
committed by GitHub
parent 89a5c396bf
commit fb710120e9
3 changed files with 19 additions and 7 deletions

View File

@@ -472,7 +472,7 @@ class Frame {
* @return {!Promise<String>}
*/
async content() {
return this._mainWorld.content();
return this._secondaryWorld.content();
}
/**
@@ -480,7 +480,7 @@ class Frame {
* @param {!{timeout?: number, waitUntil?: string|!Array<string>}=} options
*/
async setContent(html, options = {}) {
return this._mainWorld.setContent(html, options);
return this._secondaryWorld.setContent(html, options);
}
/**
@@ -539,21 +539,21 @@ class Frame {
* @param {!{delay?: number, button?: "left"|"right"|"middle", clickCount?: number}=} options
*/
async click(selector, options) {
return this._mainWorld.click(selector, options);
return this._secondaryWorld.click(selector, options);
}
/**
* @param {string} selector
*/
async focus(selector) {
return this._mainWorld.focus(selector);
return this._secondaryWorld.focus(selector);
}
/**
* @param {string} selector
*/
async hover(selector) {
return this._mainWorld.hover(selector);
return this._secondaryWorld.hover(selector);
}
/**
@@ -569,7 +569,7 @@ class Frame {
* @param {string} selector
*/
async tap(selector) {
return this._mainWorld.tap(selector);
return this._secondaryWorld.tap(selector);
}
/**
@@ -634,7 +634,7 @@ class Frame {
* @return {!Promise<string>}
*/
async title() {
return this._mainWorld.title();
return this._secondaryWorld.title();
}
/**