Skip to content

Commit

Permalink
fixup! fixup! fixup! e2e test
Browse files Browse the repository at this point in the history
  • Loading branch information
eric2788 committed Oct 21, 2024
1 parent 203f4f7 commit 815d6b8
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions tests/features/jimaku.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -194,22 +194,24 @@ test('测试同传字幕AI总结', { tag: "@scoped" }, async ({ room, content: p
await summarizer.bringToFront()
const loader = summarizer.getByText('正在加载同传字幕总结')
await expect(loader).toBeVisible()
const res = await loader.elementHandle()
await summarizer.waitForTimeout(3000)

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

logger.info('正在測試AI总結結果... (15s)')
await summarizer.waitForTimeout(15000)
logger.debug('response: ', res.innerText)

await expect(summarizer.getByText('这位日本Vtuber')).toBeVisible()
await expect(summarizer.getByText('直播')).toBeVisible()
await expect(summarizer.getByText('观众')).toBeVisible()
await expect(summarizer.getByText('麦当劳')).toBeVisible()
await expect(summarizer.getByText('漫展')).toBeVisible()
await expect(summarizer.getByText('蟑螂')).toBeVisible()
const res = await summarizer.locator('h5.leading-snug').textContent()
logger.debug('AI Summary:', res)

const maybe = expect.configure({ soft: true })
maybe(res).toContain('日本Vtuber')
maybe(res).toContain('直播')
maybe(res).toContain('观众')
maybe(res).toContain('麦当劳')
maybe(res).toContain('漫展')
maybe(res).toContain('蟑螂')

})


Expand Down

0 comments on commit 815d6b8

Please sign in to comment.