Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: remove deprecated waitForTimeout #747

Merged
merged 1 commit into from
Jan 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Timeout main Page.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
Loading