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

View File

@ -16,7 +16,7 @@ test.beforeAll(async () => {
test('explores hub', async ({ hubPage }) => {
await hubPage.navigateByMenu()
await hubPage.verifyContainerVisible()
const useModelBtn= page.getByTestId(/^use-model-btn-.*/).first()
const useModelBtn = page.getByTestId(/^use-model-btn-.*/).first()
await expect(useModelBtn).toBeVisible({
timeout: TIMEOUT,