From 3773f004db0fc1d1d5d616b3b1cb25cebcb91a8c Mon Sep 17 00:00:00 2001 From: Debbie O'Brien Date: Fri, 6 Oct 2023 15:08:51 +0200 Subject: [PATCH] docs: add intros for all pages (#27480) --- docs/src/accessibility-testing-java.md | 2 ++ docs/src/accessibility-testing-js.md | 2 ++ docs/src/actionability.md | 2 ++ docs/src/api-testing-csharp.md | 2 ++ docs/src/api-testing-java.md | 2 ++ docs/src/api-testing-js.md | 2 ++ docs/src/api-testing-python.md | 2 ++ docs/src/auth.md | 2 ++ docs/src/best-practices-js.md | 1 + docs/src/browser-contexts.md | 2 ++ docs/src/browsers.md | 2 ++ docs/src/canary-releases-js.md | 2 ++ docs/src/chrome-extensions-js-python.md | 2 ++ docs/src/ci.md | 3 +-- docs/src/codegen.md | 1 + docs/src/dialogs.md | 2 ++ docs/src/docker.md | 4 ++-- docs/src/downloads.md | 2 +- docs/src/emulation.md | 2 ++ docs/src/evaluating.md | 2 ++ docs/src/events.md | 2 ++ docs/src/extensibility.md | 3 --- docs/src/frames.md | 2 ++ docs/src/getting-started-vscode-js.md | 2 ++ docs/src/handles.md | 2 ++ docs/src/input.md | 2 ++ docs/src/intro-csharp.md | 2 ++ docs/src/intro-java.md | 2 ++ docs/src/languages.md | 2 ++ docs/src/library-csharp.md | 2 ++ docs/src/library-js.md | 2 ++ docs/src/locators.md | 2 ++ docs/src/mock-browser-js.md | 2 ++ docs/src/navigations.md | 2 ++ docs/src/other-locators.md | 2 ++ docs/src/pages.md | 2 -- docs/src/pom.md | 3 +++ docs/src/protractor-js.md | 2 -- docs/src/puppeteer-js.md | 2 -- docs/src/running-tests-csharp.md | 2 ++ docs/src/running-tests-java.md | 2 ++ docs/src/screenshots.md | 2 ++ docs/src/selenium-grid.md | 2 ++ docs/src/service-workers-experimental-network-events-js.md | 2 ++ docs/src/test-annotations-js.md | 2 ++ docs/src/test-assertions-js.md | 2 ++ docs/src/test-cli-js.md | 2 ++ docs/src/test-components-js.md | 2 ++ docs/src/test-configuration-js.md | 2 ++ docs/src/test-fixtures-js.md | 2 ++ docs/src/test-parallel-js.md | 2 ++ docs/src/test-parameterize-js.md | 1 + docs/src/test-projects-js.md | 2 ++ docs/src/test-reporters-js.md | 2 ++ docs/src/test-retries-js.md | 2 ++ docs/src/test-runners-csharp.md | 2 ++ docs/src/test-runners-java.md | 2 ++ docs/src/test-runners-python.md | 2 ++ docs/src/test-sharding-js.md | 2 ++ docs/src/test-snapshots-js.md | 2 ++ docs/src/test-timeouts-js.md | 2 ++ docs/src/test-typescript-js.md | 2 ++ docs/src/test-use-options-js.md | 2 ++ docs/src/test-webserver-js.md | 2 ++ docs/src/testing-library-js.md | 2 -- docs/src/threading-java.md | 4 +++- docs/src/videos.md | 2 ++ docs/src/webview2.md | 2 ++ docs/src/writing-tests-csharp.md | 2 ++ docs/src/writing-tests-java.md | 2 ++ 70 files changed, 127 insertions(+), 17 deletions(-) diff --git a/docs/src/accessibility-testing-java.md b/docs/src/accessibility-testing-java.md index 402ecca096..a14064452c 100644 --- a/docs/src/accessibility-testing-java.md +++ b/docs/src/accessibility-testing-java.md @@ -3,6 +3,8 @@ id: accessibility-testing title: "Accessibility testing" --- +## Introduction + Playwright can be used to test your application for many types of accessibility issues. A few examples of problems this can catch include: diff --git a/docs/src/accessibility-testing-js.md b/docs/src/accessibility-testing-js.md index f31cf79af8..d367662545 100644 --- a/docs/src/accessibility-testing-js.md +++ b/docs/src/accessibility-testing-js.md @@ -3,6 +3,8 @@ id: accessibility-testing title: "Accessibility testing" --- +## Introduction + Playwright can be used to test your application for many types of accessibility issues. A few examples of problems this can catch include: diff --git a/docs/src/actionability.md b/docs/src/actionability.md index d41141de28..a9484ba053 100644 --- a/docs/src/actionability.md +++ b/docs/src/actionability.md @@ -3,6 +3,8 @@ id: actionability title: "Auto-waiting" --- +## Introduction + Playwright performs a range of actionability checks on the elements before making actions to ensure these actions behave as expected. It auto-waits for all the relevant checks to pass and only then performs the requested action. If the required checks do not pass within the given `timeout`, action fails with the `TimeoutError`. diff --git a/docs/src/api-testing-csharp.md b/docs/src/api-testing-csharp.md index 35954d9656..f68a733322 100644 --- a/docs/src/api-testing-csharp.md +++ b/docs/src/api-testing-csharp.md @@ -3,6 +3,8 @@ id: api-testing title: "API testing" --- +## Introduction + Playwright can be used to get access to the [REST](https://en.wikipedia.org/wiki/Representational_state_transfer) API of your application. diff --git a/docs/src/api-testing-java.md b/docs/src/api-testing-java.md index 792fa11e58..80faa968d4 100644 --- a/docs/src/api-testing-java.md +++ b/docs/src/api-testing-java.md @@ -3,6 +3,8 @@ id: api-testing title: "API testing" --- +## Introduction + Playwright can be used to get access to the [REST](https://en.wikipedia.org/wiki/Representational_state_transfer) API of your application. diff --git a/docs/src/api-testing-js.md b/docs/src/api-testing-js.md index c8f56c24fa..341a14e0e6 100644 --- a/docs/src/api-testing-js.md +++ b/docs/src/api-testing-js.md @@ -3,6 +3,8 @@ id: api-testing title: "API testing" --- +## Introduction + Playwright can be used to get access to the [REST](https://en.wikipedia.org/wiki/Representational_state_transfer) API of your application. diff --git a/docs/src/api-testing-python.md b/docs/src/api-testing-python.md index d6a69ddaf4..9930605a52 100644 --- a/docs/src/api-testing-python.md +++ b/docs/src/api-testing-python.md @@ -3,6 +3,8 @@ id: api-testing title: "API testing" --- +## Introduction + Playwright can be used to get access to the [REST](https://en.wikipedia.org/wiki/Representational_state_transfer) API of your application. diff --git a/docs/src/auth.md b/docs/src/auth.md index fb3251ec72..6bfbf146d4 100644 --- a/docs/src/auth.md +++ b/docs/src/auth.md @@ -3,6 +3,8 @@ id: auth title: "Authentication" --- +## Introduction + Playwright executes tests in isolated environments called [browser contexts](./browser-contexts.md). This isolation model improves reproducibility and prevents cascading test failures. Tests can load existing authenticated state. This eliminates the need to authenticate in every test and speeds up test execution. ## Core concepts diff --git a/docs/src/best-practices-js.md b/docs/src/best-practices-js.md index 7b1a93fa3b..02e43786e0 100644 --- a/docs/src/best-practices-js.md +++ b/docs/src/best-practices-js.md @@ -3,6 +3,7 @@ id: best-practices title: "Best Practices" --- +## Introduction This guide should help you to make sure you are following our best practices and writing tests that are more resilient. diff --git a/docs/src/browser-contexts.md b/docs/src/browser-contexts.md index e958eb128e..c65f73e068 100644 --- a/docs/src/browser-contexts.md +++ b/docs/src/browser-contexts.md @@ -3,6 +3,8 @@ id: browser-contexts title: "Isolation" --- +## Introduction + Tests written with Playwright execute in isolated clean-slate environments called browser contexts. This isolation model improves reproducibility and prevents cascading test failures. ## What is Test Isolation? diff --git a/docs/src/browsers.md b/docs/src/browsers.md index 526fce5f06..12df8d88a9 100644 --- a/docs/src/browsers.md +++ b/docs/src/browsers.md @@ -3,6 +3,8 @@ id: browsers title: "Browsers" --- +## Introduction + Each version of Playwright needs specific versions of browser binaries to operate. You will need to use the Playwright CLI to install these browsers. With every release, Playwright updates the versions of the browsers it supports, so that the latest Playwright would support the latest browsers at any moment. It means that every time you update Playwright, you might need to re-run the `install` CLI command. diff --git a/docs/src/canary-releases-js.md b/docs/src/canary-releases-js.md index d08958f5c2..1c22353c36 100644 --- a/docs/src/canary-releases-js.md +++ b/docs/src/canary-releases-js.md @@ -3,6 +3,8 @@ id: canary-releases title: "Canary releases" --- +## Introduction + Playwright for Node.js has a canary releases system. It permits you to **test new unreleased features** instead of waiting for a full release. They get released daily on the `next` NPM tag of Playwright. diff --git a/docs/src/chrome-extensions-js-python.md b/docs/src/chrome-extensions-js-python.md index e6c1bdb173..fe15a06819 100644 --- a/docs/src/chrome-extensions-js-python.md +++ b/docs/src/chrome-extensions-js-python.md @@ -3,6 +3,8 @@ id: chrome-extensions title: "Chrome extensions" --- +## Introduction + :::note Extensions only work in Chrome / Chromium launched with a persistent context. ::: diff --git a/docs/src/ci.md b/docs/src/ci.md index d54ee8a091..639d1cfb4d 100644 --- a/docs/src/ci.md +++ b/docs/src/ci.md @@ -2,12 +2,11 @@ id: ci title: "Continuous Integration" --- +## Introduction Playwright tests can be executed in CI environments. We have created sample configurations for common CI providers. -## Introduction - 3 steps to get your tests running on CI: 1. **Ensure CI agent can run browsers**: Use [our Docker image](./docker.md) diff --git a/docs/src/codegen.md b/docs/src/codegen.md index 3f1667047e..20fd37050f 100644 --- a/docs/src/codegen.md +++ b/docs/src/codegen.md @@ -5,6 +5,7 @@ title: "Test generator" import LiteYouTube from '@site/src/components/LiteYouTube'; +## Introduction Playwright comes with the ability to generate tests for you as you perform actions in the browser and is a great way to quickly get started with testing. Playwright will look at your page and figure out the best locator, prioritizing [role, text and test id locators](./locators.md). If the generator finds multiple elements matching the locator, it will improve the locator to make it resilient that uniquely identify the target element. diff --git a/docs/src/dialogs.md b/docs/src/dialogs.md index eb285bb965..c210ffdb3c 100644 --- a/docs/src/dialogs.md +++ b/docs/src/dialogs.md @@ -3,6 +3,8 @@ id: dialogs title: "Dialogs" --- +## Introduction + Playwright can interact with the web page dialogs such as [`alert`](https://developer.mozilla.org/en-US/docs/Web/API/Window/alert), [`confirm`](https://developer.mozilla.org/en-US/docs/Web/API/Window/confirm), [`prompt`](https://developer.mozilla.org/en-US/docs/Web/API/Window/prompt) as well as [`beforeunload`](https://developer.mozilla.org/en-US/docs/Web/API/Window/beforeunload_event) confirmation. ## alert(), confirm(), prompt() dialogs diff --git a/docs/src/docker.md b/docs/src/docker.md index d0111580bd..de3627f21b 100644 --- a/docs/src/docker.md +++ b/docs/src/docker.md @@ -3,9 +3,9 @@ id: docker title: "Docker" --- -[Dockerfile.jammy] can be used to run Playwright scripts in Docker environment. These image includes all the dependencies needed to run browsers in a Docker container, and also include the browsers themselves. +## Introduction - +[Dockerfile.jammy] can be used to run Playwright scripts in Docker environment. These image includes all the dependencies needed to run browsers in a Docker container, and also include the browsers themselves. ## Usage diff --git a/docs/src/downloads.md b/docs/src/downloads.md index 12c9a142c0..9bce4f9d98 100644 --- a/docs/src/downloads.md +++ b/docs/src/downloads.md @@ -3,7 +3,7 @@ id: downloads title: "Downloads" --- - +## Introduction For every attachment downloaded by the page, [`event: Page.download`] event is emitted. All these attachments are downloaded into a temporary folder. You can obtain the download url, file name and payload stream using the [Download] object from the event. diff --git a/docs/src/emulation.md b/docs/src/emulation.md index a673659661..65c81612f8 100644 --- a/docs/src/emulation.md +++ b/docs/src/emulation.md @@ -3,6 +3,8 @@ id: emulation title: "Emulation" --- +## Introduction + With Playwright you can test your app on any browser as well as emulate a real device such as a mobile phone or tablet. Simply configure the devices you would like to emulate and Playwright will simulate the browser behavior such as `"userAgent"`, `"screenSize"`, `"viewport"` and if it `"hasTouch"` enabled. You can also emulate the `"geolocation"`, `"locale"` and `"timezone"` for all tests or for a specific test as well as set the `"permissions"` to show notifications or change the `"colorScheme"`. ## Devices diff --git a/docs/src/evaluating.md b/docs/src/evaluating.md index 7a815534f5..65f8c4a646 100644 --- a/docs/src/evaluating.md +++ b/docs/src/evaluating.md @@ -3,6 +3,8 @@ id: evaluating title: "Evaluating JavaScript" --- +## Introduction + Playwright scripts run in your Playwright environment. Your page scripts run in the browser page environment. Those environments don't intersect, they are running in different virtual machines in different processes and even potentially on different computers. The [`method: Page.evaluate`] API can run a JavaScript function in the context diff --git a/docs/src/events.md b/docs/src/events.md index a15ebcf300..900cde1a95 100644 --- a/docs/src/events.md +++ b/docs/src/events.md @@ -3,6 +3,8 @@ id: events title: "Events" --- +## Introduction + Playwright allows listening to various types of events happening on the web page, such as network requests, creation of child pages, dedicated workers etc. There are several ways to subscribe to such events such as waiting for events or adding or removing event listeners. ## Waiting for event diff --git a/docs/src/extensibility.md b/docs/src/extensibility.md index cb5b9170ce..1dec0b3d3e 100644 --- a/docs/src/extensibility.md +++ b/docs/src/extensibility.md @@ -2,9 +2,6 @@ id: extensibility title: "Extensibility" --- - - - ## Custom selector engines Playwright supports custom selector engines, registered with [`method: Selectors.register`]. diff --git a/docs/src/frames.md b/docs/src/frames.md index 1a67f24bd8..64f1b5aea8 100644 --- a/docs/src/frames.md +++ b/docs/src/frames.md @@ -3,6 +3,8 @@ id: frames title: "Frames" --- +## Introduction + A [Page] can have one or more [Frame] objects attached to it. Each page has a main frame and page-level interactions (like `click`) are assumed to operate in the main frame. diff --git a/docs/src/getting-started-vscode-js.md b/docs/src/getting-started-vscode-js.md index 91be2814bd..004db2228f 100644 --- a/docs/src/getting-started-vscode-js.md +++ b/docs/src/getting-started-vscode-js.md @@ -5,6 +5,8 @@ title: "Getting started - VS Code" import LiteYouTube from '@site/src/components/LiteYouTube'; +## Introduction + Playwright Test was created specifically to accommodate the needs of end-to-end testing. Playwright supports all modern rendering engines including Chromium, WebKit, and Firefox. Test on Windows, Linux, and macOS, locally or on CI, headless or headed with native mobile emulation of Google Chrome for Android and Mobile Safari. Get started by installing Playwright and generating a test to see it in action. Alternatively you can also get started and run your tests using the [CLI](./intro.md). diff --git a/docs/src/handles.md b/docs/src/handles.md index 5b42e33b5c..0707891936 100644 --- a/docs/src/handles.md +++ b/docs/src/handles.md @@ -3,6 +3,8 @@ id: handles title: "Handles" --- +## Introduction + Playwright can create handles to the page DOM elements or any other objects inside the page. These handles live in the Playwright process, whereas the actual objects live in the browser. There are two types of handles: diff --git a/docs/src/input.md b/docs/src/input.md index ec1e6e6239..1569dbd31d 100644 --- a/docs/src/input.md +++ b/docs/src/input.md @@ -3,6 +3,8 @@ id: input title: "Actions" --- +## Introduction + Playwright can interact with HTML Input elements such as text inputs, checkboxes, radio buttons, select options, mouse clicks, type characters, keys and shortcuts as well as upload files and focus elements. ## Text input diff --git a/docs/src/intro-csharp.md b/docs/src/intro-csharp.md index f91ee55597..a76fc3b78d 100644 --- a/docs/src/intro-csharp.md +++ b/docs/src/intro-csharp.md @@ -3,6 +3,8 @@ id: intro title: "Installation" --- +## Introduction + Playwright was created specifically to accommodate the needs of end-to-end testing. Playwright supports all modern rendering engines including Chromium, WebKit, and Firefox. Test on Windows, Linux, and macOS, locally or on CI, headless or headed with native mobile emulation. You can choose to use [NUnit base classes](./test-runners.md#nunit) or [MSTest base classes](./test-runners.md#mstest) that Playwright provides to write end-to-end tests. These classes support running tests on multiple browser engines, parallelizing tests, adjusting launch/context options and getting a [Page]/[BrowserContext] instance per test out of the box. Alternatively you can use the [library](./library.md) to manually write the testing infrastructure. diff --git a/docs/src/intro-java.md b/docs/src/intro-java.md index fa6c5b6c60..e28a950ead 100644 --- a/docs/src/intro-java.md +++ b/docs/src/intro-java.md @@ -3,6 +3,8 @@ id: intro title: "Installation" --- +## Introduction + Playwright was created specifically to accommodate the needs of end-to-end testing. Playwright supports all modern rendering engines including Chromium, WebKit, and Firefox. Test on Windows, Linux, and macOS, locally or on CI, headless or headed with native mobile emulation. Playwright is distributed as a set of [Maven](https://maven.apache.org/what-is-maven.html) modules. The easiest way to use it is to add one dependency to your project's `pom.xml` as described below. If you're not familiar with Maven please refer to its [documentation](https://maven.apache.org/guides/getting-started/maven-in-five-minutes.html). diff --git a/docs/src/languages.md b/docs/src/languages.md index 89f500544a..a84167fe97 100644 --- a/docs/src/languages.md +++ b/docs/src/languages.md @@ -3,6 +3,8 @@ id: languages title: "Supported languages" --- +## Introduction + Playwright is available in multiple languages that share the same underlying implementation. All core features for automating the browser are supported in all languages, while testing ecosystem integration is different. Pick the language based on your experience, familiarity with its testing ecosystem and your project constraints. For the best experience pick the test runner that we recommend for each language. ## JavaScript and TypeScript diff --git a/docs/src/library-csharp.md b/docs/src/library-csharp.md index 625d49804e..1abda291ff 100644 --- a/docs/src/library-csharp.md +++ b/docs/src/library-csharp.md @@ -3,6 +3,8 @@ id: library title: "Getting started - Library" --- +## Introduction + Playwright can either be used with the [NUnit](./test-runners.md#nunit) or [MSTest](./test-runners.md#mstest), or as a Playwright Library (this guide). If you are working on an application that utilizes Playwright capabilities or you are using Playwright with another test runner, read on. ## Usage diff --git a/docs/src/library-js.md b/docs/src/library-js.md index 29ace98ba3..ae3d1916ec 100644 --- a/docs/src/library-js.md +++ b/docs/src/library-js.md @@ -3,6 +3,8 @@ id: library title: "Library" --- +## Introduction + Playwright Library provides unified APIs for launching and interacting with browsers, while Playwright Test provides all this plus a fully managed end-to-end Test Runner and experience. Under most circumstances, for end-to-end testing, you'll want to use `@playwright/test` (Playwright Test), and not `playwright` (Playwright Library) directly. To get started with Playwright Test, follow the [Getting Started Guide](./intro.md). diff --git a/docs/src/locators.md b/docs/src/locators.md index 05b5301309..bbecedfd1f 100644 --- a/docs/src/locators.md +++ b/docs/src/locators.md @@ -3,6 +3,8 @@ id: locators title: "Locators" --- +## Introduction + [Locator]s are the central piece of Playwright's auto-waiting and retry-ability. In a nutshell, locators represent a way to find element(s) on the page at any moment. diff --git a/docs/src/mock-browser-js.md b/docs/src/mock-browser-js.md index fd5af23aa5..26f76f6363 100644 --- a/docs/src/mock-browser-js.md +++ b/docs/src/mock-browser-js.md @@ -3,6 +3,8 @@ id: mock-browser-apis title: "Mock browser APIs" --- +## Introduction + Playwright provides native support for most of the browser features. However, there are some experimental APIs and APIs which are not (yet) fully supported by all browsers. Playwright usually doesn't provide dedicated automation APIs in such cases. You can use mocks to test the behavior of your application in such cases. This guide gives a few examples. diff --git a/docs/src/navigations.md b/docs/src/navigations.md index c18babb647..44bab9187a 100644 --- a/docs/src/navigations.md +++ b/docs/src/navigations.md @@ -3,6 +3,8 @@ id: navigations title: "Navigations" --- +## Introduction + Playwright can navigate to URLs and handle navigations caused by the page interactions. ## Basic navigation diff --git a/docs/src/other-locators.md b/docs/src/other-locators.md index 08a8fea70d..665dcce2c5 100644 --- a/docs/src/other-locators.md +++ b/docs/src/other-locators.md @@ -3,6 +3,8 @@ id: other-locators title: "Other locators" --- +## Introduction + :::note Check out the main [locators guide](./locators) for most common and recommended locators. ::: diff --git a/docs/src/pages.md b/docs/src/pages.md index 7a6c702056..2e0197075c 100644 --- a/docs/src/pages.md +++ b/docs/src/pages.md @@ -3,8 +3,6 @@ id: pages title: "Pages" --- - - ## Pages Each [BrowserContext] can have multiple pages. A [Page] refers to a single tab or a popup window within a browser diff --git a/docs/src/pom.md b/docs/src/pom.md index 15a647cc67..983598a2c2 100644 --- a/docs/src/pom.md +++ b/docs/src/pom.md @@ -2,6 +2,9 @@ id: pom title: "Page object models" --- + +## Introduction + Large test suites can be structured to optimize ease of authoring and maintenance. Page object models are one such approach to structure your test suite. A page object represents a part of your web application. An e-commerce web application might have a home page, a listings page and a checkout page. Each of them can be represented by page object models. diff --git a/docs/src/protractor-js.md b/docs/src/protractor-js.md index 723974ff4d..279d796b99 100644 --- a/docs/src/protractor-js.md +++ b/docs/src/protractor-js.md @@ -3,8 +3,6 @@ id: protractor title: "Migrating from Protractor" --- - - ## Migration Principles - No need for "webdriver-manager" / Selenium. diff --git a/docs/src/puppeteer-js.md b/docs/src/puppeteer-js.md index 7b31c2d0cd..3c3f5d5c99 100644 --- a/docs/src/puppeteer-js.md +++ b/docs/src/puppeteer-js.md @@ -3,8 +3,6 @@ id: puppeteer title: "Migrating from Puppeteer" --- - - ## Migration Principles This guide describes migration to [Playwright Library](./library) and [Playwright Test](./intro.md) from Puppeteer. The APIs have similarities, but Playwright offers much more possibilities for web testing and cross-browser automation. diff --git a/docs/src/running-tests-csharp.md b/docs/src/running-tests-csharp.md index 3b954ec3dc..14e26386d7 100644 --- a/docs/src/running-tests-csharp.md +++ b/docs/src/running-tests-csharp.md @@ -3,6 +3,8 @@ id: running-tests title: "Running and debugging tests" --- +## Introduction + You can run a single test, a set of tests or all tests. Tests can be run on different browsers. By default tests are run in a headless manner meaning no browser window will be opened while running the tests and results will be seen in the terminal. If you prefer you can run your tests in headed mode by using the `headless` test run parameter. - Running all tests diff --git a/docs/src/running-tests-java.md b/docs/src/running-tests-java.md index b1b8a5c81c..1cacca7710 100644 --- a/docs/src/running-tests-java.md +++ b/docs/src/running-tests-java.md @@ -3,6 +3,8 @@ id: running-tests title: "Running and debugging tests" --- +## Introduction + Playwright tests can be run in a variety of ways. We recommend hooking it up to your favorite test runner, e.g. [JUnit](./test-runners.md) since it gives you the ability to run tests in parallel, run single test, etc. You can run a single test, a set of tests or all tests. Tests can be run on one browser or multiple browsers. By default tests are run in a headless manner meaning no browser window will be opened while running the tests and results will be seen in the terminal. If you prefer you can run your tests in headed mode by using the `launch(new BrowserType.LaunchOptions().setHeadless(false))` option. diff --git a/docs/src/screenshots.md b/docs/src/screenshots.md index bbc9b5c2e2..8044e6aad9 100644 --- a/docs/src/screenshots.md +++ b/docs/src/screenshots.md @@ -3,6 +3,8 @@ id: screenshots title: "Screenshots" --- +## Introduction + Here is a quick way to capture a screenshot and save it into a file: ```js diff --git a/docs/src/selenium-grid.md b/docs/src/selenium-grid.md index 41138d66ce..c7b4a1b4d3 100644 --- a/docs/src/selenium-grid.md +++ b/docs/src/selenium-grid.md @@ -3,6 +3,8 @@ id: selenium-grid title: "Selenium Grid" --- +## Introduction + Playwright can connect to [Selenium Grid Hub](https://www.selenium.dev/documentation/grid/) that runs Selenium 4 to launch **Google Chrome** or **Microsoft Edge** browser, instead of running browser on the local machine. :::warning diff --git a/docs/src/service-workers-experimental-network-events-js.md b/docs/src/service-workers-experimental-network-events-js.md index 049c64640a..96b8ead1e5 100644 --- a/docs/src/service-workers-experimental-network-events-js.md +++ b/docs/src/service-workers-experimental-network-events-js.md @@ -3,6 +3,8 @@ id: service-workers-experimental title: "(Experimental) Service Worker Network Events" --- +## Introduction + :::warning If you're looking to do general network mocking, routing, and interception, please see the [Network Guide](./network.md) first. Playwright provides built-in APIs for this use case that don't require the information below. However, if you're interested in requests made by Service Workers themselves, please read below. ::: diff --git a/docs/src/test-annotations-js.md b/docs/src/test-annotations-js.md index a11cd60fa5..ba8ae9c681 100644 --- a/docs/src/test-annotations-js.md +++ b/docs/src/test-annotations-js.md @@ -3,6 +3,8 @@ id: test-annotations title: "Annotations" --- +## Introduction + Playwright Test supports test annotations to deal with failures, flakiness, skip, focus and tag tests: - [`method: Test.skip#1`] marks the test as irrelevant. Playwright Test does not run such a test. Use this annotation when the test is not applicable in some configuration. - [`method: Test.fail#1`] marks the test as failing. Playwright Test will run this test and ensure it does indeed fail. If the test does not fail, Playwright Test will complain. diff --git a/docs/src/test-assertions-js.md b/docs/src/test-assertions-js.md index 28a4f38ff9..cb357ac056 100644 --- a/docs/src/test-assertions-js.md +++ b/docs/src/test-assertions-js.md @@ -3,6 +3,8 @@ id: test-assertions title: "Assertions" --- +## Introduction + Playwright includes test assertions in the form of `expect` function. To make an assertion, call `expect(value)` and choose a matcher that reflects the expectation. There are many [generic matchers](./api/class-genericassertions.md) like `toEqual`, `toContain`, `toBeTruthy` that can be used to assert any conditions. ```js diff --git a/docs/src/test-cli-js.md b/docs/src/test-cli-js.md index 35803f985f..56013e4f49 100644 --- a/docs/src/test-cli-js.md +++ b/docs/src/test-cli-js.md @@ -3,6 +3,8 @@ id: test-cli title: "Command line" --- +## Introduction + Here are the most common options available in the command line. - Run all the tests diff --git a/docs/src/test-components-js.md b/docs/src/test-components-js.md index c7a591c2b5..2d9d115bd6 100644 --- a/docs/src/test-components-js.md +++ b/docs/src/test-components-js.md @@ -5,6 +5,8 @@ title: "Components (experimental)" import LiteYouTube from '@site/src/components/LiteYouTube'; +## Introduction + Playwright Test can now test your components. - ## Migration principles This guide describes migration to Playwright's [Experimental Component Testing](./test-components) from [DOM Testing Library](https://testing-library.com/docs/dom-testing-library/intro/), [React Testing Library](https://testing-library.com/docs/react-testing-library/intro/), [Vue Testing Library](https://testing-library.com/docs/vue-testing-library/intro) and [Svelte Testing Library](https://testing-library.com/docs/svelte-testing-library/intro). diff --git a/docs/src/threading-java.md b/docs/src/threading-java.md index b492cc3dd1..350388c00b 100644 --- a/docs/src/threading-java.md +++ b/docs/src/threading-java.md @@ -3,6 +3,8 @@ id: multithreading title: "Multithreading" --- +## Introduction + Playwright Java is not thread safe, i.e. all its methods as well as methods on all objects created by it (such as [BrowserContext], [Browser], [Page] etc.) are expected to be called on the same thread where the Playwright object was created or proper synchronization should be implemented to ensure only one thread calls Playwright methods at any given time. Having said that it's okay to create multiple Playwright instances each on its own thread. Here is an example where three playwright instances are created each on its own thread. Each instance launches its own browser process and runs the test against it. @@ -76,4 +78,4 @@ page.navigate("https://playwright.dev"); System.out.println("-- did navigate --"); // Block current thread for 60s and ensure the events are dispatched. page.waitForTimeout(60_000); -``` \ No newline at end of file +``` diff --git a/docs/src/videos.md b/docs/src/videos.md index 0bc7d1500c..60f740cf8b 100644 --- a/docs/src/videos.md +++ b/docs/src/videos.md @@ -3,6 +3,8 @@ id: videos title: "Videos" --- +## Introduction + With Playwright you can record videos for your tests. ## Record video diff --git a/docs/src/webview2.md b/docs/src/webview2.md index d17c17a867..b5db56ac36 100644 --- a/docs/src/webview2.md +++ b/docs/src/webview2.md @@ -3,6 +3,8 @@ id: webview2 title: "WebView2" --- +## Introduction + The following will explain how to use Playwright with [Microsoft Edge WebView2](https://docs.microsoft.com/en-us/microsoft-edge/webview2/). WebView2 is a WinForms control, which will use Microsoft Edge under the hood to render web content. It is a part of the Microsoft Edge browser and is available on Windows 10 and Windows 11. Playwright can be used to automate WebView2 applications and can be used to test web content in WebView2. For connecting to WebView2, Playwright uses [`method: BrowserType.connectOverCDP`] which connects to it via the Chrome DevTools Protocol (CDP). ## Overview diff --git a/docs/src/writing-tests-csharp.md b/docs/src/writing-tests-csharp.md index 3818b9f039..ca3a1b41ab 100644 --- a/docs/src/writing-tests-csharp.md +++ b/docs/src/writing-tests-csharp.md @@ -3,6 +3,8 @@ id: writing-tests title: "Writing tests" --- +## Introduction + Playwright assertions are created specifically for the dynamic web. Checks are automatically retried until the necessary conditions are met. Playwright comes with [auto-wait](./actionability.md) built in meaning it waits for elements to be actionable prior to performing actions. Playwright provides the [Expect](./test-assertions) function to write assertions. Take a look at the example test below to see how to write a test using using [locators](/locators.md) and web first assertions. diff --git a/docs/src/writing-tests-java.md b/docs/src/writing-tests-java.md index c6e10731fa..7a05aca292 100644 --- a/docs/src/writing-tests-java.md +++ b/docs/src/writing-tests-java.md @@ -3,6 +3,8 @@ id: writing-tests title: "Writing tests" --- +## Introduction + Playwright assertions are created specifically for the dynamic web. Checks are automatically retried until the necessary conditions are met. Playwright comes with [auto-wait](./actionability.md) built in meaning it waits for elements to be actionable prior to performing actions. Playwright provides [assertThat](./test-assertions.md) overloads to write assertions. Take a look at the example test below to see how to write a test using web first assertions, locators and selectors.