From 75227758beb83e9166263d44a8fbb1e19d0b3334 Mon Sep 17 00:00:00 2001 From: leejooy96 Date: Thu, 2 Nov 2023 13:15:36 +0900 Subject: [PATCH] test: replace sleep method to playwright's native waitForTimeout --- tests/app.spec.ts | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/tests/app.spec.ts b/tests/app.spec.ts index 92285e1..305fd84 100644 --- a/tests/app.spec.ts +++ b/tests/app.spec.ts @@ -5,10 +5,6 @@ import { test, expect } from '@playwright/test' let appWindow: Page let appElectron: ElectronApplication -function waiting(milliseconds: number) { - return new Promise((resolve) => setTimeout(resolve, milliseconds)) -} - function existElementByTestId(selector: string, waitingMilliseconds = 100) { return new Promise((resolve) => { setTimeout(async () => { @@ -54,6 +50,6 @@ test('Counter button click check', async () => { }) test.afterAll(async () => { - await waiting(2000) + await appWindow.waitForTimeout(2000) await appElectron.close() })