diff --git a/packages/e2e-test-utils-playwright/src/metrics/index.ts b/packages/e2e-test-utils-playwright/src/metrics/index.ts index c0843f73ddf83e..68343f6d7c4829 100644 --- a/packages/e2e-test-utils-playwright/src/metrics/index.ts +++ b/packages/e2e-test-utils-playwright/src/metrics/index.ts @@ -147,6 +147,8 @@ export class Metrics { /** * Returns the loading durations using the Navigation Timing API. All the * durations exclude the server response time. + * + * @return Object with loading metrics durations. */ async getLoadingDurations() { return await this.page.evaluate( () => { @@ -189,7 +191,7 @@ export class Metrics { } /** - * Starts Chromium tracing with predefined options for performance testing. + * Starts Chromium tracing with predefined options for performance testing. * * @param options Options to pass to `browser.startTracing()`. */ @@ -212,7 +214,8 @@ export class Metrics { } /** - * Returns the durations of all typing events. + * @return Durations of all traced `keydown`, `keypress`, and `keyup` + * events. */ getTypingEventDurations() { return [ @@ -223,7 +226,7 @@ export class Metrics { } /** - * Returns the durations of all selection events. + * @return Durations of all traced `focus` and `focusin` events. */ getSelectionEventDurations() { return [ @@ -233,14 +236,14 @@ export class Metrics { } /** - * Returns the durations of all click events. + * @return Durations of all traced `click` events. */ getClickEventDurations() { return [ this.getEventDurations( 'click' ) ]; } /** - * Returns the durations of all hover events. + * @return Durations of all traced `mouseover` and `mouseout` events. */ getHoverEventDurations() { return [ @@ -250,9 +253,8 @@ export class Metrics { } /** - * Returns the durations of all events of a given type. - * - * @param eventType The type of event to filter. + * @param eventType Type of event to filter. + * @return Durations of all events of a given type. */ getEventDurations( eventType: EventType ) { if ( this.trace.traceEvents.length === 0 ) { diff --git a/test/performance/fixtures/perf-utils.ts b/test/performance/fixtures/perf-utils.ts index 576777a4d44f62..e66f394234acd4 100644 --- a/test/performance/fixtures/perf-utils.ts +++ b/test/performance/fixtures/perf-utils.ts @@ -27,8 +27,10 @@ export class PerfUtils { } /** - * Returns the locator for the editor canvas element. This supports either - * the legacy canvas or the iframed canvas. + * Returns the locator for the editor canvas element. This supports both the + * legacy and the iframed canvas. + * + * @return Locator for the editor canvas element. */ async getCanvas() { return await Promise.any( [ @@ -55,6 +57,8 @@ export class PerfUtils { /** * Saves the post as a draft and returns its URL. + * + * @return URL of the saved draft. */ async saveDraft() { await this.page @@ -89,6 +93,8 @@ export class PerfUtils { /** * Enters the Site Editor's edit mode. + * + * @return Locator for the editor canvas element. */ async enterSiteEditorEditMode() { const canvas = await this.getCanvas();