From a248430af8fd550ba4e280eb987523b5c695085b Mon Sep 17 00:00:00 2001 From: Pavel Feldman Date: Thu, 16 Apr 2020 20:31:04 -0700 Subject: [PATCH] reapply api(waitUntil): remove waitUntil options from the actions (#1842) --- docs/api.md | 196 ++++++--------------------------------- src/dom.ts | 2 +- src/frames.ts | 16 ++-- src/types.ts | 7 +- test/autowaiting.spec.js | 51 ++++------ 5 files changed, 65 insertions(+), 207 deletions(-) diff --git a/docs/api.md b/docs/api.md index 7074290214..c238b01d87 100644 --- a/docs/api.md +++ b/docs/api.md @@ -948,12 +948,7 @@ Shortcut for [page.mainFrame().addStyleTag(options)](#frameaddstyletagoptions). - is not moving (for example, waits until css transition finishes), - receives pointer events at the action point (for example, waits until element becomes non-obscured by other elements). Even if the action is forced, it will wait for the element matching selector to be in DOM. Defaults to `false`. - - `waitUntil` <"load"|"domcontentloaded"|"networkidle0"|"networkidle2"|"nowait"> Actions that cause navigations are waiting for those navigations to fire `domcontentloaded` by default. This behavior can be changed to either wait for another load phase or to omit the waiting altogether using `nowait`: - - `'domcontentloaded'` - consider navigation to be finished when the `DOMContentLoaded` event is fired. - - `'load'` - consider navigation to be finished when the `load` event is fired. - - `'networkidle0'` - consider navigation to be finished when there are no more than 0 network connections for at least `500` ms. - - `'networkidle2'` - consider navigation to be finished when there are no more than 2 network connections for at least `500` ms. - - `'nowait'` - do not wait. + - `noWaitAfter` <[boolean]> Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to inaccessible pages. Defaults to `false`. - `timeout` <[number]> Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the [browserContext.setDefaultTimeout(timeout)](#browsercontextsetdefaulttimeouttimeout) or [page.setDefaultTimeout(timeout)](#pagesetdefaulttimeouttimeout) methods. - returns: <[Promise]> Promise which resolves when the element matching `selector` is successfully checked. The Promise will be rejected if there is no element matching `selector`. @@ -977,12 +972,7 @@ Shortcut for [page.mainFrame().check(selector[, options])](#framecheckselector-o - is not moving (for example, waits until css transition finishes), - receives pointer events at the action point (for example, waits until element becomes non-obscured by other elements). Even if the action is forced, it will wait for the element matching selector to be in DOM. Defaults to `false`. - - `waitUntil` <"load"|"domcontentloaded"|"networkidle0"|"networkidle2"|"nowait"> Actions that cause navigations are waiting for those navigations to fire `domcontentloaded` by default. This behavior can be changed to either wait for another load phase or to omit the waiting altogether using `nowait`: - - `'domcontentloaded'` - consider navigation to be finished when the `DOMContentLoaded` event is fired. - - `'load'` - consider navigation to be finished when the `load` event is fired. - - `'networkidle0'` - consider navigation to be finished when there are no more than 0 network connections for at least `500` ms. - - `'networkidle2'` - consider navigation to be finished when there are no more than 2 network connections for at least `500` ms. - - `'nowait'` - do not wait. + - `noWaitAfter` <[boolean]> Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to inaccessible pages. Defaults to `false`. - `timeout` <[number]> Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the [browserContext.setDefaultTimeout(timeout)](#browsercontextsetdefaulttimeouttimeout) or [page.setDefaultTimeout(timeout)](#pagesetdefaulttimeouttimeout) methods. - returns: <[Promise]> Promise which resolves when the element matching `selector` is successfully clicked. The Promise will be rejected if there is no element matching `selector`. @@ -1035,12 +1025,7 @@ Browser-specific Coverage implementation, only available for Chromium atm. See [ - is not moving (for example, waits until css transition finishes), - receives pointer events at the action point (for example, waits until element becomes non-obscured by other elements). Even if the action is forced, it will wait for the element matching selector to be in DOM. Defaults to `false`. - - `waitUntil` <"load"|"domcontentloaded"|"networkidle0"|"networkidle2"|"nowait"> Actions that cause navigations are waiting for those navigations to fire `domcontentloaded` by default. This behavior can be changed to either wait for another load phase or to omit the waiting altogether using `nowait`: - - `'domcontentloaded'` - consider navigation to be finished when the `DOMContentLoaded` event is fired. - - `'load'` - consider navigation to be finished when the `load` event is fired. - - `'networkidle0'` - consider navigation to be finished when there are no more than 0 network connections for at least `500` ms. - - `'networkidle2'` - consider navigation to be finished when there are no more than 2 network connections for at least `500` ms. - - `'nowait'` - do not wait. + - `noWaitAfter` <[boolean]> Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to inaccessible pages. Defaults to `false`. - `timeout` <[number]> Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the [browserContext.setDefaultTimeout(timeout)](#browsercontextsetdefaulttimeouttimeout) or [page.setDefaultTimeout(timeout)](#pagesetdefaulttimeouttimeout) methods. - returns: <[Promise]> Promise which resolves when the element matching `selector` is successfully double clicked. The Promise will be rejected if there is no element matching `selector`. @@ -1212,12 +1197,7 @@ const fs = require('fs'); - `selector` <[string]> A selector to query page for. - `value` <[string]> Value to fill for the ``, `