From 78f24ec6933dcbc3c6d14153989f93f88085d453 Mon Sep 17 00:00:00 2001 From: Yury Semikhatsky Date: Tue, 10 Aug 2021 21:23:57 -0700 Subject: [PATCH] docs(java): add missing download example (#8128) --- docs/src/downloads.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/docs/src/downloads.md b/docs/src/downloads.md index d9cd353019..952305cb25 100644 --- a/docs/src/downloads.md +++ b/docs/src/downloads.md @@ -30,6 +30,16 @@ const [ download ] = await Promise.all([ const path = await download.path(); ``` +```java +// Wait for the download to start +Download download = page.waitForDownload(() -> { + // Perform the action that initiates download + page.click("button#delayed-download"); +}); +// Wait for the download process to complete +Path path = download.path(); +``` + ```python async # Start waiting for the download async with page.expect_download() as download_info: