test: replace sleep method to playwright's native waitForTimeout
This commit is contained in:
1 parent
8b3aba3e22
commit
75227758be
1 file changed
+1
-5
+1
-5
@@ -5,10 +5,6 @@ import { test, expect } from '@playwright/test'
|
|||||||
let appWindow: Page
|
let appWindow: Page
|
||||||
let appElectron: ElectronApplication
|
let appElectron: ElectronApplication
|
||||||
|
|
||||||
function waiting(milliseconds: number) {
|
|
||||||
return new Promise((resolve) => setTimeout(resolve, milliseconds))
|
|
||||||
}
|
|
||||||
|
|
||||||
function existElementByTestId(selector: string, waitingMilliseconds = 100) {
|
function existElementByTestId(selector: string, waitingMilliseconds = 100) {
|
||||||
return new Promise((resolve) => {
|
return new Promise((resolve) => {
|
||||||
setTimeout(async () => {
|
setTimeout(async () => {
|
||||||
@@ -54,6 +50,6 @@ test('Counter button click check', async () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
test.afterAll(async () => {
|
test.afterAll(async () => {
|
||||||
await waiting(2000)
|
await appWindow.waitForTimeout(2000)
|
||||||
await appElectron.close()
|
await appElectron.close()
|
||||||
})
|
})
|
||||||
Reference in new issue
Block a user