| 1 | import type { Page, Response } from '@playwright/test'; |
| 2 | |
| 3 | export interface E2EPage extends Page { |
| 4 | /** |
| 5 | * Returns the main resource response. In case of multiple redirects, the navigation will resolve with the response of the |
| 6 | * last redirect. |
| 7 | * |
| 8 | * The method will throw an error if: |
| 9 | * - there's an SSL error (e.g. in case of self-signed certificates). |
| 10 | * - target URL is invalid. |
| 11 | * - the `timeout` is exceeded during navigation. |
| 12 | * - the remote server does not respond or is unreachable. |
| 13 | * - the main resource failed to load. |
| 14 | * |
| 15 | * The method will not throw an error when any valid HTTP status code is returned by the remote server, including 404 "Not |
| 16 | * Found" and 500 "Internal Server Error". The status code for such responses can be retrieved by calling |
| 17 | * [response.status()](https://playwright.dev/docs/api/class-response#response-status). |
| 18 | * |
| 19 | * > NOTE: The method either throws an error or returns a main resource response. The only exceptions are navigation to |
| 20 | * `about:blank` or navigation to the same URL with a different hash, which would succeed and return `null`. |
| 21 | * > NOTE: Headless mode doesn't support navigation to a PDF document. See the |
| 22 | * [upstream issue](https://bugs.chromium.org/p/chromium/issues/detail?id=761295). |
| 23 | * |
| 24 | * Shortcut for main frame's [frame.goto(url[, options])](https://playwright.dev/docs/api/class-frame#frame-goto) |
| 25 | * @param url URL to navigate page to. The url should include scheme, e.g. `https://`. When a `baseURL` via the context options was provided and the passed URL is a path, it gets merged via the |
| 26 | * [`new URL()`](https://developer.mozilla.org/en-US/docs/Web/API/URL/URL) constructor. |
| 27 | */ |
| 28 | goto: ( |
| 29 | url: string, |
| 30 | options?: { |
| 31 | /** |
| 32 | * Referer header value. If provided it will take preference over the referer header value set by |
| 33 | * [page.setExtraHTTPHeaders(headers)](https://playwright.dev/docs/api/class-page#page-set-extra-http-headers). |
| 34 | */ |
| 35 | referer?: string; |
| 36 | |
| 37 | /** |
| 38 | * Maximum operation time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be |
| 39 | * changed by using the |
| 40 | * [browserContext.setDefaultNavigationTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-navigation-timeout), |
| 41 | * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout), |
| 42 | * [page.setDefaultNavigationTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-navigation-timeout) |
| 43 | * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout) methods. |
| 44 | */ |
| 45 | timeout?: number; |
| 46 | |
| 47 | /** |
| 48 | * When to consider operation succeeded, defaults to `load`. Events can be either: |
| 49 | * - `'domcontentloaded'` - consider operation to be finished when the `DOMContentLoaded` event is fired. |
| 50 | * - `'load'` - consider operation to be finished when the `load` event is fired. |
| 51 | * - `'networkidle'` - consider operation to be finished when there are no network connections for at least `500` ms. |
| 52 | * - `'commit'` - consider operation to be finished when network response is received and the document started loading. |
| 53 | */ |
| 54 | waitUntil?: 'load' | 'domcontentloaded' | 'networkidle' | 'commit'; |
| 55 | }, |
| 56 | ) => Promise<null | Response>; |
| 57 | } |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…