fix: test

This commit is contained in:
电摇小子
2026-08-04 20:41:06 +08:00
parent 894281fb44
commit 69bc6f57e7
3 changed files with 3 additions and 0 deletions
Binary file not shown.

Before

Width:  |  Height:  |  Size: 57 KiB

After

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 81 KiB

After

Width:  |  Height:  |  Size: 64 KiB

+3
View File
@@ -4,6 +4,7 @@ import { resolve } from 'path'
import { launchTestApp } from './support/electron'
const baselineDirectory = resolve(`tests/e2e/__screenshots__/${process.platform}/visual.spec.ts`)
const visualViewport = { width: 1000, height: 650 }
test.skip(
!existsSync(baselineDirectory) && process.env.WXE_UPDATE_VISUAL_BASELINES !== '1',
`No reviewed ${process.platform} visual baseline is committed yet`
@@ -12,6 +13,7 @@ test.skip(
test('NAV-01 login page visual @visual', async () => {
const fixture = await launchTestApp({ mode: 'disconnected' })
try {
await fixture.page.setViewportSize(visualViewport)
await expect(fixture.page.getByRole('heading', { name: 'WechatExplorer' })).toBeVisible()
await expect(fixture.page).toHaveScreenshot('login-page.png', {
animations: 'disabled',
@@ -25,6 +27,7 @@ test('NAV-01 login page visual @visual', async () => {
test('ARCH-01 archive page visual @visual', async () => {
const fixture = await launchTestApp()
try {
await fixture.page.setViewportSize(visualViewport)
await fixture.page.getByText('产品测试群', { exact: true }).click()
await expect(fixture.page.getByText('这是一条脱敏测试消息', { exact: true })).toBeVisible()
await expect(fixture.page).toHaveScreenshot('archive-page.png', {