Skip to content

Commit

Permalink
fix: remove deprecated waitForTimeout (#747)
Browse files Browse the repository at this point in the history
Remove deprecated Puppeteer method.
  • Loading branch information
Lightning00Blade committed Jan 24, 2024
1 parent 7d22b87 commit 23613b8
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/PuppeteerRunnerExtension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ const comparators = {
'<=': (a: number, b: number): boolean => a <= b,
};

function waitForTimeout(timeout: number): Promise<void> {
return new Promise((resolve) => {
setTimeout(resolve, timeout);
});
}

export class PuppeteerRunnerExtension extends RunnerExtension {
protected browser: Browser;
protected page: Page;
Expand Down Expand Up @@ -176,14 +182,14 @@ export class PuppeteerRunnerExtension extends RunnerExtension {
{
startWaitingForEvents();
await mainPage.keyboard.down(step.key);
await mainPage.waitForTimeout(100);
await waitForTimeout(100);
}
break;
case StepType.KeyUp:
{
startWaitingForEvents();
await mainPage.keyboard.up(step.key);
await mainPage.waitForTimeout(100);
await waitForTimeout(100);
}
break;
case StepType.Close:
Expand Down

0 comments on commit 23613b8

Please sign in to comment.