Skip to content

Commit

Permalink
Update docblocks
Browse files Browse the repository at this point in the history
  • Loading branch information
swissspidy committed Aug 13, 2023
1 parent b0a6ac3 commit 1364564
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions packages/e2e-test-utils-playwright/src/metrics/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,11 @@ export class Metrics {
}

/**
* Returns time to first byte (TTFB) from PerformanceObserver.
* Returns time to first byte (TTFB) using the Navigation Timing API.
*
* @see https://web.dev/ttfb/#measure-ttfb-in-javascript
*
* @return {Promise<number>} TTFB value.
*/
async getTimeToFirstByte() {
return this.page.evaluate< number >(
Expand All @@ -54,7 +58,12 @@ export class Metrics {
}

/**
* Returns Largest Contentful Paint (LCP) time.
* Returns the Largest Contentful Paint (LCP) value using the dedicated API.
*
* @see https://w3c.github.io/largest-contentful-paint/
* @see https://web.dev/lcp/#measure-lcp-in-javascript
*
* @return {Promise<number>} LCP value.
*/
async getLargestContentfulPaint() {
return this.page.evaluate< number >(
Expand All @@ -75,7 +84,12 @@ export class Metrics {
}

/**
* Returns Cumulative Layout Shift (CLS) value.
* Returns the Cumulative Layout Shift (CLS) value using the dedicated API.
*
* @see https://github.com/WICG/layout-instability
* @see https://web.dev/cls/#measure-layout-shifts-in-javascript
*
* @return {Promise<number>} CLS value.
*/
async getCumulativeLayoutShift() {
return this.page.evaluate< number >(
Expand Down

0 comments on commit 1364564

Please sign in to comment.