Skip to content

Commit cc35449

Browse files
committed
fixup! added e2e test
1 parent c74a52c commit cc35449

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

tests/content.spec.ts

+7-4
Original file line numberDiff line numberDiff line change
@@ -454,15 +454,16 @@ test('測試导航', async ({ room, content, serviceWorker }) => {
454454
test('測試 强制啓動 模式', { tag: '@scoped' }, async ({ context, optionPageUrl, page, content }) => {
455455

456456
logger.info('進入離綫的直播間...')
457-
await page.goto('https://live.bilibili.com/1', { waitUntil: 'domcontentloaded' })
458-
logger.info('測試主元素是否存在...')
457+
// this room is always offline (guess what)
458+
await page.goto('https://live.bilibili.com/21849412', { waitUntil: 'domcontentloaded' })
459+
logger.info('測試主元素是否不存在...')
459460
await expect(content.getByText('功能菜单')).toBeHidden()
460461

461462
logger.info('正在修改設定...')
462463
const settingsPage = await context.newPage()
463464
await settingsPage.goto(optionPageUrl, { waitUntil: 'domcontentloaded' })
464-
await settingsPage.getByText('功能设定').click()
465-
await settingsPage.getByText('仅限虚拟主播').click()
465+
// await settingsPage.getByText('功能设定').click()
466+
// await settingsPage.getByText('仅限虚拟主播').click()
466467
await settingsPage.getByText('开发者相关').click()
467468
await settingsPage.getByText('在直播间下线时依然强制启动').check()
468469
await settingsPage.getByText('保存设定').click()
@@ -472,5 +473,7 @@ test('測試 强制啓動 模式', { tag: '@scoped' }, async ({ context, optionP
472473
await page.reload()
473474
logger.info('測試主元素是否存在...')
474475
await expect(content.getByText('功能菜单')).toBeVisible()
476+
await expect(content.locator('section#bjf-feature-jimaku')).not.toBeAttached()
477+
await expect(content.locator('section#bjf-feature-superchat')).not.toBeAttached()
475478

476479
})

0 commit comments

Comments
 (0)