Skip to content

Commit 815d6b8

Browse files
committed
fixup! fixup! fixup! e2e test
1 parent 203f4f7 commit 815d6b8

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

tests/features/jimaku.spec.ts

+11-9
Original file line numberDiff line numberDiff line change
@@ -194,22 +194,24 @@ test('测试同传字幕AI总结', { tag: "@scoped" }, async ({ room, content: p
194194
await summarizer.bringToFront()
195195
const loader = summarizer.getByText('正在加载同传字幕总结')
196196
await expect(loader).toBeVisible()
197-
const res = await loader.elementHandle()
198197
await summarizer.waitForTimeout(3000)
199198

200199
await expect(summarizer.getByText('错误')).toBeHidden({ timeout: 5000 })
201200
await expect(loader).toBeHidden({ timeout: 30000 })
202201

203202
logger.info('正在測試AI总結結果... (15s)')
204203
await summarizer.waitForTimeout(15000)
205-
logger.debug('response: ', res.innerText)
206-
207-
await expect(summarizer.getByText('这位日本Vtuber')).toBeVisible()
208-
await expect(summarizer.getByText('直播')).toBeVisible()
209-
await expect(summarizer.getByText('观众')).toBeVisible()
210-
await expect(summarizer.getByText('麦当劳')).toBeVisible()
211-
await expect(summarizer.getByText('漫展')).toBeVisible()
212-
await expect(summarizer.getByText('蟑螂')).toBeVisible()
204+
const res = await summarizer.locator('h5.leading-snug').textContent()
205+
logger.debug('AI Summary:', res)
206+
207+
const maybe = expect.configure({ soft: true })
208+
maybe(res).toContain('日本Vtuber')
209+
maybe(res).toContain('直播')
210+
maybe(res).toContain('观众')
211+
maybe(res).toContain('麦当劳')
212+
maybe(res).toContain('漫展')
213+
maybe(res).toContain('蟑螂')
214+
213215
})
214216

215217

0 commit comments

Comments
 (0)