Skip to content

Commit

Permalink
test.slow when theme room, optimize test case
Browse files Browse the repository at this point in the history
  • Loading branch information
eric2788 committed Oct 25, 2024
1 parent 0536830 commit 5f9dce3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions tests/features/superchat.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,9 @@ test('測試房間名單列表(黑名單/白名單)',
)

test('測試全屏時有否根據設定顯示隱藏浮動按鈕', async ({ content, context, optionPageUrl }) => {

const button = content.locator('button', { hasText: /^$/ })
await expect(button).toBeVisible()
await expect(button).toBeVisible({ timeout: 60000 })

logger.info('正在測試禁用時切換網頁全屏...')
await content.locator('#live-player').dblclick()
Expand Down
5 changes: 4 additions & 1 deletion tests/fixtures/content.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,12 @@ export const test = extensionBase.extend<ContentFixtures & ContentOptions>({

export const expect = test.expect

test.beforeEach(async ({ context }) => {
test.beforeEach(async ({ context, isThemeRoom }) => {
context.on('console', (msg) => {
if (!msg.text().includes('bilibili-vup-stream-enhancer')) return
logger.debug(msg.text().replace('bilibili-vup-stream-enhancer', 'console'))
})
if (isThemeRoom) {
test.slow()
}
})

0 comments on commit 5f9dce3

Please sign in to comment.