diff --git a/docs/api.md b/docs/api.md index ccc34dd3..df3b7b0c 100644 --- a/docs/api.md +++ b/docs/api.md @@ -612,8 +612,8 @@ Bare in mind that if `click()` triggers a navigation event and there's a separat ```javascript const [response] = await Promise.all([ - this.waitForNavigation(waitOptions), - this.click(selector, clickOptions), + page.waitForNavigation(waitOptions), + page.click(selector, clickOptions), ]); ``` @@ -2250,19 +2250,19 @@ executed code: ```js // Enable both JavaScript and CSS coverage await Promise.all([ - page.startJSCoverage(), - page.startCSSCoverage() + page.coverage.startJSCoverage(), + page.coverage.startCSSCoverage() ]); // Navigate to page await page.goto('https://example.com'); // Disable both JavaScript and CSS coverage const [jsCoverage, cssCoverage] = await Promise.all([ - page.stopJSCoverage(), - page.stopCSSCoverage(), + page.coverage.stopJSCoverage(), + page.coverage.stopCSSCoverage(), ]); let totalBytes = 0; let usedBytes = 0; -const coverage = [].concat(jsCoverage, cssCoverage); +const coverage = [...jsCoverage, ...cssCoverage]; for (const entry of coverage) { totalBytes += entry.text.length; for (const range of entry.ranges)