Skip to content

Commit

Permalink
test: 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 2, 2023
1 parent 8b3aba3 commit 7522775
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions tests/app.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 () => {
Expand Down Expand Up @@ -54,6 +50,6 @@ test('Counter button click check', async () => {
})

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

0 comments on commit 7522775

Please sign in to comment.