From eed2bac441a6d62cf62f26a9f6796d849f2e9516 Mon Sep 17 00:00:00 2001 From: Pavel Feldman Date: Sun, 3 May 2020 11:16:52 -0700 Subject: [PATCH] docs: added overview links --- docs/README.md | 5 +++++ docs/loading.md | 8 ++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/docs/README.md b/docs/README.md index fc1526a3c9f93..37ff44c34e7b6 100644 --- a/docs/README.md +++ b/docs/README.md @@ -3,8 +3,10 @@ ### Table of contents 1. [Getting Started](./intro.md) + - [Introduction](./intro.md) - [Installation](./installation.md) 1. [Core Concepts](./core-concepts.md) + - [Overview](./core-concepts.md) - [Browser](./core-concepts.md#browser) - [Browser contexts](./core-concepts.md#browser-contexts) - [Pages and frames](./core-concepts.md#pages-and-frames) @@ -22,6 +24,7 @@ - [Upload files](./input.md#upload-files) - [Focus element](./input.md#focus-element) 1. [Emulation](./emulation.md) + - [Overview](./emulation.md) - [User agent](./emulation.md#user-agent) - [Viewport, color scheme](./emulation.md#viewport-color-scheme) - [Devices](./emulation.md#devices) @@ -29,6 +32,7 @@ - [Permissions](./emulation.md#permissions) - [Geolocation](./emulation.md#geolocation) 1. [Network](./network.md) + - [Overview](./network.md) - [HTTP Authentication](./network.md#http-authentication) - [Handle file downloads](./network.md#handle-file-downloads) - [Network events](./network.md#network-events) @@ -41,6 +45,7 @@ - [Page events](./verification.md#page-events) - [Handling exceptions](./verification.md#handling-exceptions) 1. [Navigation and Loading](./loading.md) + - [Overview](./loading.md) - [Common scenarios](./loading.md#common-scenarios) - [Loading a popup](./loading.md#loading-a-popup) - [Client-side redirects](./loading.md#unusual-client-side-redirects) diff --git a/docs/loading.md b/docs/loading.md index 5a4b00bb7daf8..684551dbd1e8f 100644 --- a/docs/loading.md +++ b/docs/loading.md @@ -2,7 +2,7 @@ Playwright logically splits the process of showing a new document in the page into **navigation** and **loading**. -### Navigation +## Navigation Page navigation can be either initiated by the Playwright call: @@ -29,7 +29,7 @@ history.pushState({}, 'title', '#deep-link'); Navigation intent may result in being canceled, for example transformed into a download or hitting an unresolved DNS address. Only when the navigation succeeds, page starts **loading** the document. -### Loading +## Loading Page load takes time retrieving the response body over the network, parsing, executing the scripts and firing the events. Typical load scenario goes through the following load states: - [`page.url()`](api.md#pageurl) is set to the new url @@ -40,7 +40,7 @@ Page load takes time retrieving the response body over the network, parsing, exe - page executes dynamically loaded scripts - `networkidle` is fired - no new network requests made for at least `500` ms -### Common scenarios +## Common scenarios By default, Playwright handles navigations seamlessly so that you did not need to think about them. Consider the following scenario, where everything is handled by Playwright behind the scenes: @@ -62,7 +62,7 @@ await page.click('text=Login'); Explicit loading handling may be required for more complicated scenarios though. -### Loading a popup +## Loading a popup When popup is opened, explicitly calling [`page.waitForLoadState()`](api.md#pagewaitforloadstatestate-options) ensures that popup is loaded to the desired state. ```js