From 741e2d19d61420549a96c18cefa6d290c69f8a61 Mon Sep 17 00:00:00 2001 From: Joel Einbinder Date: Wed, 18 Mar 2020 15:34:53 -0700 Subject: [PATCH] fix(docs): lint and fix all internal links in api.md We have had a lot of churn in the api, which has caused a lot of our links to break. --- docs/api.md | 44 ++++++++++++++--------------- utils/doclint/cli.js | 1 + utils/doclint/preprocessor/index.js | 26 +++++++++++++++-- 3 files changed, 46 insertions(+), 25 deletions(-) diff --git a/docs/api.md b/docs/api.md index 87ba00d71c..972ddb67c7 100644 --- a/docs/api.md +++ b/docs/api.md @@ -94,11 +94,11 @@ const iPhone = devices['iPhone 6']; - returns: <[Object]> - `TimeoutError` <[function]> A class of [TimeoutError]. -Playwright methods might throw errors if they are unable to fulfill a request. For example, [page.waitForSelector(selector[, options])](#pagewaitforelementselector-options) +Playwright methods might throw errors if they are unable to fulfill a request. For example, [page.waitForSelector(selector[, options])](#pagewaitforselectorselector-options) might fail if the selector doesn't match any nodes during the given timeframe. For certain types of errors Playwright uses specific error classes. -These classes are available via [`browserType.errors`](#browsertypeerrors) or [`playwright.errors`](#playwrighterrors). +These classes are available via [`playwright.errors`](#playwrighterrors). An example of handling a timeout error: ```js @@ -531,7 +531,7 @@ This setting will change the default maximum navigation time for the following m This setting will change the default maximum time for all the methods accepting `timeout` option. -> **NOTE** [`page.setDefaultNavigationTimeout`](#pagesetdefaultnavigationtimeouttimeout), [`page.setDefaultTimeout`](#pagesetdefaulttimeouttimeout) and [`browserContext.setDefaultNavigationTimeout`](#browsercontextsetdefaultnavigationtimeouttimeout) take priority over [`browserContext.setDefaultTimeout`](#browserContextsetdefaulttimeouttimeout). +> **NOTE** [`page.setDefaultNavigationTimeout`](#pagesetdefaultnavigationtimeouttimeout), [`page.setDefaultTimeout`](#pagesetdefaulttimeouttimeout) and [`browserContext.setDefaultNavigationTimeout`](#browsercontextsetdefaultnavigationtimeouttimeout) take priority over [`browserContext.setDefaultTimeout`](#browsercontextsetdefaulttimeouttimeout). #### browserContext.setExtraHTTPHeaders(headers) - `headers` <[Object]> An object containing additional HTTP headers to be sent with every request. All header values must be strings. @@ -554,7 +554,7 @@ Sets the contexts's geolocation. Passing null or undefined emulates position una await browserContext.setGeolocation({latitude: 59.95, longitude: 30.31667}); ``` -> **NOTE** Consider using [browserContext.setPermissions](#browsercontextsetpermissions-permissions) to grant permissions for the browser context pages to read its geolocation. +> **NOTE** Consider using [browserContext.grantPermissions](#browsercontextgrantpermissionspermissions-options) to grant permissions for the browser context pages to read its geolocation. #### browserContext.setHTTPCredentials(httpCredentials) - `httpCredentials` @@ -1202,7 +1202,7 @@ If there's no text ``, `