Skip to content

Commit

Permalink
wait until buffering is done (#4892)
Browse files Browse the repository at this point in the history
  • Loading branch information
sashankaryal committed Oct 4, 2024
1 parent 35c13f7 commit a2d26f0
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions e2e-pw/src/oss/poms/modal/imavid-controls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,22 @@ export class ModalImaAsVideoControlsPom {
return timelineId;
}

private async waitUntilBufferingIsFinished() {
await this.page.waitForFunction(
() =>
document
.querySelector("[data-cy=imavid-playhead]")
?.getAttribute("data-playhead-state") !== "buffering"
);
}

private async togglePlay() {
await this.waitUntilBufferingIsFinished();

let currentPlayHeadStatus = await this.playPauseButton.getAttribute(
"data-playhead-state"
);

const original = currentPlayHeadStatus;

// keep pressing space until play head status changes
Expand Down

0 comments on commit a2d26f0

Please sign in to comment.