test: replace sleep method to playwright's native waitForTimeout

This commit is contained in:
leejooy96 committed 2023-11-02 13:15:36 +09:00
1 parent 8b3aba3e22
commit 75227758be
1 file changed
+1 -5
+1 -5
View File
@@ -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()
})