Skip to content

Commit

Permalink
Improve jsdoc consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
WunderBart committed Sep 21, 2023
1 parent 71a1d58 commit d12b20d
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 10 deletions.
18 changes: 10 additions & 8 deletions packages/e2e-test-utils-playwright/src/metrics/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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( () => {
Expand Down Expand Up @@ -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()`.
*/
Expand All @@ -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 [
Expand All @@ -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 [
Expand All @@ -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 [
Expand All @@ -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 ) {
Expand Down
10 changes: 8 additions & 2 deletions test/performance/fixtures/perf-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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( [
Expand All @@ -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
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit d12b20d

Please sign in to comment.