From c8b45aa844a7262af84a8e59df0ebac08aeb8a5e Mon Sep 17 00:00:00 2001 From: Dmitry Gozman Date: Wed, 26 Jul 2023 16:15:07 -0700 Subject: [PATCH] chore: validate markdown links in doclint (#24444) Fixes #24421. --- docs/src/accessibility-testing-js.md | 2 +- docs/src/api/class-browsercontext.md | 2 +- docs/src/api/class-page.md | 2 +- docs/src/api/params.md | 4 +- docs/src/best-practices-js.md | 8 +- docs/src/codegen-intro.md | 6 +- docs/src/emulation.md | 8 +- docs/src/intro-java.md | 2 +- docs/src/library-js.md | 2 +- docs/src/library-python.md | 2 +- docs/src/other-locators.md | 2 +- docs/src/protractor-js.md | 6 +- docs/src/puppeteer-js.md | 6 +- docs/src/release-notes-csharp.md | 8 +- docs/src/release-notes-java.md | 8 +- docs/src/release-notes-js.md | 14 +-- docs/src/release-notes-python.md | 8 +- docs/src/selenium-grid.md | 2 - docs/src/test-api/class-testoptions.md | 6 +- docs/src/test-global-setup-teardown-js.md | 4 +- docs/src/test-snapshots-js.md | 2 +- docs/src/test-use-options-js.md | 8 +- docs/src/testing-library-js.md | 6 +- packages/playwright-core/types/types.d.ts | 20 ++-- packages/playwright-test/types/test.d.ts | 10 +- utils/doclint/cli.js | 121 ++++++++++++---------- 26 files changed, 145 insertions(+), 124 deletions(-) diff --git a/docs/src/accessibility-testing-js.md b/docs/src/accessibility-testing-js.md index e806a1aeb5..10e8fe30a3 100644 --- a/docs/src/accessibility-testing-js.md +++ b/docs/src/accessibility-testing-js.md @@ -95,7 +95,7 @@ By default, axe checks against a wide variety of accessibility rules. Some of th You can constrain an accessibility scan to only run those rules which are "tagged" as corresponding to specific WCAG success criteria by using [`AxeBuilder.withTags()`](https://github.com/dequelabs/axe-core-npm/blob/develop/packages/playwright/README.md#axebuilderwithtagstags-stringarray). For example, [Accessibility Insights for Web's Automated Checks](https://accessibilityinsights.io/docs/web/getstarted/fastpass/?referrer=playwright-accessibility-testing-js) only include axe rules that test for violations of WCAG A and AA success criteria; to match that behavior, you would use the tags `wcag2a`, `wcag2aa`, `wcag21a`, and `wcag21aa`. -Note that [automated testing cannot detect all types of WCAG violations](#disclaimer). +Note that automated testing cannot detect all types of WCAG violations. ```js test('should not have any automatically detectable WCAG A or AA violations', async ({ page }) => { diff --git a/docs/src/api/class-browsercontext.md b/docs/src/api/class-browsercontext.md index 63e93a146c..307407f4ca 100644 --- a/docs/src/api/class-browsercontext.md +++ b/docs/src/api/class-browsercontext.md @@ -1190,7 +1190,7 @@ How often a route should be used. By default it will be used every time. ## async method: BrowserContext.routeFromHAR * since: v1.23 -If specified the network requests that are made in the context will be served from the HAR file. Read more about [Replaying from HAR](../network.md#replaying-from-har). +If specified the network requests that are made in the context will be served from the HAR file. Read more about [Replaying from HAR](../mock.md#replaying-from-har). Playwright will not serve requests intercepted by Service Worker from the HAR file. See [this](https://github.com/microsoft/playwright/issues/1090) issue. We recommend disabling Service Workers when using request interception by setting [`option: Browser.newContext.serviceWorkers`] to `'block'`. diff --git a/docs/src/api/class-page.md b/docs/src/api/class-page.md index e9635de2af..bbf3446417 100644 --- a/docs/src/api/class-page.md +++ b/docs/src/api/class-page.md @@ -3320,7 +3320,7 @@ How often a route should be used. By default it will be used every time. ## async method: Page.routeFromHAR * since: v1.23 -If specified the network requests that are made in the page will be served from the HAR file. Read more about [Replaying from HAR](../network.md#replaying-from-har). +If specified the network requests that are made in the page will be served from the HAR file. Read more about [Replaying from HAR](../mock.md#replaying-from-har). Playwright will not serve requests intercepted by Service Worker from the HAR file. See [this](https://github.com/microsoft/playwright/issues/1090) issue. We recommend disabling Service Workers when using request interception by setting [`option: Browser.newContext.serviceWorkers`] to `'block'`. diff --git a/docs/src/api/params.md b/docs/src/api/params.md index d1c55f3e28..81fa010aee 100644 --- a/docs/src/api/params.md +++ b/docs/src/api/params.md @@ -307,7 +307,7 @@ When using [`method: Page.goto`], [`method: Page.route`], [`method: Page.waitFor - `width` <[int]> page width in pixels. - `height` <[int]> page height in pixels. -Emulates consistent viewport for each page. Defaults to an 1280x720 viewport. +Emulates consistent viewport for each page. Defaults to an 1280x720 viewport. Use `null` to disable the consistent viewport emulation. Learn more about [viewport emulation](../emulation#viewport). :::note @@ -510,7 +510,7 @@ Specify device scale factor (can be thought of as dpr). Defaults to `1`. Learn m ## context-option-ismobile - `isMobile` <[boolean]> -Whether the `meta viewport` tag is taken into account and touch events are enabled. isMobile is a part of device, so you don't actually need to set it manually. Defaults to `false` and is not supported in Firefox. Learn more about [mobile emulation](../emulation.md#isMobile). +Whether the `meta viewport` tag is taken into account and touch events are enabled. isMobile is a part of device, so you don't actually need to set it manually. Defaults to `false` and is not supported in Firefox. Learn more about [mobile emulation](../emulation.md#ismobile). ## context-option-hastouch - `hasTouch` <[boolean]> diff --git a/docs/src/best-practices-js.md b/docs/src/best-practices-js.md index 85068d1184..53dc975443 100644 --- a/docs/src/best-practices-js.md +++ b/docs/src/best-practices-js.md @@ -38,13 +38,13 @@ test('second', async ({ page }) => { }); ``` -You can also reuse the signed-in state in the tests with [global setup](/auth.md#reuse-signed-in-state). That way you can log in only once and then skip the log in step for all of the tests. +You can also reuse the signed-in state in the tests with [setup project](./auth.md#basic-shared-account-in-all-tests). That way you can log in only once and then skip the log in step for all of the tests. ### Avoid testing third-party dependencies Only test what you control. Don't try to test links to external sites or third party servers that you do not control. Not only is it time consuming and can slow down your tests but also you can not control the content of the page you are linking to, or if there are cookie banners or overlay pages or anything else that might cause your test to fail. -Instead, use the [Playwright Network API](/network.md#handle-requests) and guarantee the response needed. +Instead, use the [Playwright Network API](/network.md#handle-requests) and guarantee the response needed. ```js await page.route('**/api/fetch_data_third_party_dependency', route => route.fulfill({ @@ -71,7 +71,7 @@ page.getByRole('button', { name: 'submit' }); #### Use chaining and filtering -Locators can be [chained](./locators.md#chaining-locators) to narrow down the search to a particular part of the page. +Locators can be [chained](./locators.md#matching-inside-a-locator) to narrow down the search to a particular part of the page. ```js const product = page.getByRole('listitem').filter({ hasText: 'Product 2' }); @@ -217,7 +217,7 @@ Playwright comes with a range of tooling to help you write tests. ### Test across all browsers -Playwright makes it easy to test your site across all [browsers](./test-configuration#multiple-browsers) no matter what platform you are on. Testing across all browsers ensures your app works for all users. In your config file you can set up projects adding the name and which browser or device to use. +Playwright makes it easy to test your site across all [browsers](./test-projects.md#configure-projects-for-multiple-browsers) no matter what platform you are on. Testing across all browsers ensures your app works for all users. In your config file you can set up projects adding the name and which browser or device to use. ```js title="playwright.config.ts" import { defineConfig, devices } from '@playwright/test'; diff --git a/docs/src/codegen-intro.md b/docs/src/codegen-intro.md index 6532174140..82d44fe90d 100644 --- a/docs/src/codegen-intro.md +++ b/docs/src/codegen-intro.md @@ -8,7 +8,7 @@ Playwright comes with the ability to generate tests out of the box and is a grea **You will learn** - [How to record a test](/codegen.md#recording-a-test) -- [How to generate locators](/codegen.md#generate-locators) +- [How to generate locators](/codegen.md#generating-locators)