Methods
(static) afterPass(optionsnon-null, gathererResultsnon-null) → (non-null) {Promise}
Ends tracing and collects trace data (if requested for this pass), and runs afterPass() on gatherers with trace data passed in. Promise resolves with object containing trace and network data.
Parameters:
Name | Type | Description |
---|---|---|
options |
Object
|
|
gathererResults |
GathererResults
|
Returns:
- Type:
-
Promise
(static) assertPageLoaded(url, driver, networkRecordsnon-null)
Throws an error if the original network request failed or wasn't found.
Parameters:
Name | Type | Description |
---|---|---|
url |
string
|
The URL of the original requested page. |
driver |
Object
|
|
networkRecords |
Array.<WebInspector.NetworkRequest>
|
(static) beforePass(optionsnon-null, gathererResultsnon-null) → (non-null) {Promise}
Navigates to about:blank and calls beforePass() on gatherers before tracing has started and before navigation to the target page.
Parameters:
Name | Type | Description |
---|---|---|
options |
Object
|
|
gathererResults |
GathererResults
|
Returns:
- Type:
-
Promise
(static) collectArtifacts(gathererResultsnon-null) → (non-null) {Promise.<!Artifacts>}
Takes the results of each gatherer phase for each gatherer and uses the last produced value (that's not undefined) as the artifact for that gatherer. If a non-fatal error was rejected from a gatherer phase, uses that error object as the artifact instead.
Parameters:
Name | Type | Description |
---|---|---|
gathererResults |
GathererResults
|
Returns:
- Type:
-
Promise.<!Artifacts>
(static) loadBlank(drivernon-null, urlopt, durationopt) → (non-null) {Promise}
Loads about:blank and waits there briefly. Since a Page.reload command does
not let a service worker take over, we navigate away and then come back to
reload. We do not waitForLoad
on about:blank since a page load event is
never fired on it.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
driver |
Driver
|
|||
url |
url
|
<optional> |
about:blank | |
duration |
number
|
<optional> |
300 |
Returns:
- Type:
-
Promise
(static) loadPage(drivernon-null, optionsnon-null) → (non-null) {Promise}
Loads options.url with specified options. If the main document URL redirects, options.url will be updated accordingly. As such, options.url will always represent the post-redirected URL. options.initialUrl is the pre-redirect starting URL.
Parameters:
Name | Type | Description |
---|---|---|
driver |
Driver
|
|
options |
Object
|
Returns:
- Type:
-
Promise
(static) pass(optionsnon-null, gathererResultsnon-null) → (non-null) {Promise}
Navigates to requested URL and then runs pass() on gatherers while trace (if requested) is still being recorded.
Parameters:
Name | Type | Description |
---|---|---|
options |
Object
|
|
gathererResults |
GathererResults
|
Returns:
- Type:
-
Promise
(static) recoverOrThrow(promisenon-null) → (non-null) {Promise.<*>}
Test any error output from the promise, absorbing non-fatal errors and throwing on fatal ones so that run is stopped.
Parameters:
Name | Type | Description |
---|---|---|
promise |
Promise.<*>
|
Returns:
- Type:
-
Promise.<*>
(static) setupDriver(drivernon-null, gathererResultsnon-null, optionsnon-null) → (non-null) {Promise}
Parameters:
Name | Type | Description |
---|---|---|
driver |
Driver
|
|
gathererResults |
GathererResults
|
|
options |
Object
|
Returns:
- Type:
-
Promise