Skip to content

Commit

Permalink
replace sleep method to playwright's native waitForTimeout
Browse files Browse the repository at this point in the history
  • Loading branch information
jooy2 committed Nov 5, 2023
1 parent bd6d26e commit adee509
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions tests/app.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,6 @@ import { test, expect } from '@playwright/test';
let appWindow: Page;
let appElectron: ElectronApplication;

function waiting(milliseconds: number) {
return new Promise((resolve) => {
setTimeout(() => resolve(true), milliseconds);
});
}

function existElementByTestId(selector: string, waitingMilliseconds = 100) {
return new Promise((resolve) => {
setTimeout(async () => {
Expand Down Expand Up @@ -54,6 +48,6 @@ test('Counter button click check', async () => {
});

test.afterAll(async () => {
await waiting(3000);
await appWindow.waitForTimeout(3000);
await appElectron.close();
});

0 comments on commit adee509

Please sign in to comment.