test: reset data on test - add debug

This commit is contained in:
Louis 2024-10-21 21:16:01 +07:00
parent 716fd96d56
commit 718ee8dfa9
No known key found for this signature in database
GPG Key ID: 44FA9F4D33C37DE2
2 changed files with 8 additions and 2 deletions

View File

@ -15,6 +15,8 @@ import {
import { Constants } from './constants' import { Constants } from './constants'
import { HubPage } from '../pages/hubPage' import { HubPage } from '../pages/hubPage'
import { CommonActions } from '../pages/commonActions' import { CommonActions } from '../pages/commonActions'
import { rmSync } from 'fs'
import * as path from 'path'
export let electronApp: ElectronApplication export let electronApp: ElectronApplication
export let page: Page export let page: Page
@ -103,10 +105,14 @@ export const test = base.extend<
}, },
{ auto: true }, { auto: true },
], ],
}) })
test.beforeAll(async () => { test.beforeAll(async () => {
await rmSync(path.join(__dirname, '../../test-data'), {
recursive: true,
force: true,
})
test.setTimeout(TIMEOUT) test.setTimeout(TIMEOUT)
await setupElectron() await setupElectron()
await page.waitForSelector('img[alt="Jan - Logo"]', { await page.waitForSelector('img[alt="Jan - Logo"]', {