refactor(e2e): migrate database reset logic to standard Playwright custom fixture

This commit is contained in:
yiling
2026-07-10 16:18:45 +08:00
parent cd96015b9d
commit 0aba2ee557
5 changed files with 77 additions and 17 deletions
+2 -3
View File
@@ -1,4 +1,4 @@
import { expect, test } from '@playwright/test'
import { expect, test } from './fixtures'
import * as fs from 'fs'
import * as path from 'path'
import { fileURLToPath } from 'url'
@@ -8,8 +8,7 @@ const tempImgPath = path.resolve(currentDir, 'temp-cover.png')
test.beforeAll(async () => {
// Create a 1x1 transparent PNG file
const pngBase64 =
'iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII='
const pngBase64 = 'iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII='
fs.writeFileSync(tempImgPath, Buffer.from(pngBase64, 'base64'))
})