-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(nowait): allow waitUntil:nowait for actions #1264
Conversation
e1c4eba
to
185054d
Compare
@@ -1115,7 +1117,7 @@ class PendingNavigationBarrier { | |||
|
|||
async addFrame(frame: Frame) { | |||
this.retain(); | |||
await frame.waitForNavigation(this._waitOptions).catch(e => {}); | |||
await frame.waitForNavigation(this._options as types.NavigateOptions).catch(e => {}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why 'as'? Are we passing non-compatible options? Seems suspicious.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
trimming the 'nowait' here...
src/frames.ts
Outdated
@@ -100,7 +100,9 @@ export class FrameManager { | |||
} | |||
} | |||
|
|||
async waitForNavigationsCreatedBy<T>(action: () => Promise<T>, options?: types.WaitForNavigationOptions): Promise<T> { | |||
async waitForNavigationsCreatedBy<T>(action: () => Promise<T>, options?: types.ActionWaitOptionsNoWaitFor): Promise<T> { | |||
if (options && options.waitUntil && options.waitUntil === 'nowait') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: no need to check options.waitUntil
for truthy :)
docs/api.md
Outdated
@@ -2174,6 +2194,13 @@ console.log(frame === contentFrame); // -> true | |||
- y <[number]> | |||
- `modifiers` <[Array]<"Alt"|"Control"|"Meta"|"Shift">> Modifier keys to press. Ensures that only these modifiers are pressed during the hover, and then restores current modifiers back. If not specified, currently pressed modifiers are used. | |||
- `waitFor` <[boolean]> Whether to wait for the element to be present in the dom and displayed (for example, no `display:none`), stop moving (for example, wait until css transition finishes) and potentially receive pointer events at the click point (for example, wait until element becomes non-obscured by other elements). Defaults to `true`. | |||
- `waitUntil` <"commit"|"load"|"domcontentloaded"|"networkidle0"|"networkidle2"|"nowait"> Actions that cause navigations are waiting for those navigations to `commit` by default. This behavior can be changed to either wait for another load phase or to omit the waiting altogether using `nowait`: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto.
docs/api.md
Outdated
@@ -1276,6 +1280,13 @@ Shortcut for [page.mainFrame().goto(url[, options])](#framegotourl-options) | |||
- y <[number]> | |||
- `modifiers` <[Array]<"Alt"|"Control"|"Meta"|"Shift">> Modifier keys to press. Ensures that only these modifiers are pressed during the hover, and then restores current modifiers back. If not specified, currently pressed modifiers are used. | |||
- `waitFor` <[boolean]> Whether to wait for the element to be present in the dom and displayed (for example, no `display:none`), stop moving (for example, wait until css transition finishes) and potentially receive pointer events at the click point (for example, wait until element becomes non-obscured by other elements). Defaults to `true`. | |||
- `waitUntil` <"commit"|"load"|"domcontentloaded"|"networkidle0"|"networkidle2"|"nowait"> Actions that cause navigations are waiting for those navigations to `commit` by default. This behavior can be changed to either wait for another load phase or to omit the waiting altogether using `nowait`: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is hover waiting for navigaiton?
No description provided.