Skip to content

Commit 5d5563f

Browse files
committed
scoped tests
1 parent 08c3649 commit 5d5563f

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

tests/content.spec.ts

+12-12
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ import { receiveOneBLiveMessage } from "./utils/bilibili";
44
import { random } from "./utils/misc";
55

66

7-
test('測試主元素是否存在', async ({ content }) => {
7+
test('測試主元素是否存在', { tag: "@scoped" }, async ({ content }) => {
88

99
const csui = content.locator('bjf-csui')
1010
await csui.waitFor({ state: 'attached', timeout: 10000 })
1111

1212
await expect(csui.locator('#bjf-root')).toBeAttached()
1313
})
1414

15-
test('測試功能元素有否基於設定而消失/顯示', async ({ content, context, optionPageUrl }) => {
15+
test('測試功能元素有否基於設定而消失/顯示', { tag: "@scoped" }, async ({ content, context, optionPageUrl }) => {
1616

1717
// 默認只開了同傳字幕
1818
const csui = content.locator('bjf-csui')
@@ -72,7 +72,7 @@ test('测试扩展CSS有否影响到外围', async ({ content, isThemeRoom }) =>
7272
})
7373

7474

75-
test('測試貼邊浮動按鈕和主菜單區塊是否存在', async ({ content }) => {
75+
test('測試貼邊浮動按鈕和主菜單區塊是否存在', { tag: "@scoped" }, async ({ content }) => {
7676

7777
const button = content.getByText('功能菜单')
7878
await expect(button).toBeAttached()
@@ -89,7 +89,7 @@ test('測試貼邊浮動按鈕和主菜單區塊是否存在', async ({ content
8989
})
9090

9191

92-
test('測試是否挂接成功', async ({ room }) => {
92+
test('測試是否挂接成功', { tag: "@scoped" }, async ({ room }) => {
9393

9494
logger.info('正在等待挂接成功...')
9595

@@ -110,7 +110,7 @@ test('測試是否挂接成功', async ({ room }) => {
110110
})
111111

112112

113-
test('測試名單列表(黑名單/白名單)', async ({ context, content, optionPageUrl, room }) => {
113+
test('測試名單列表(黑名單/白名單)', { tag: "@scoped" }, async ({ context, content, optionPageUrl, room }) => {
114114

115115
const button = content.getByText('功能菜单')
116116
await expect(button).toBeVisible()
@@ -139,7 +139,7 @@ test('測試名單列表(黑名單/白名單)', async ({ context, content, optio
139139
})
140140

141141

142-
test('測試进入设置按鈕', async ({ context, content, optionPageUrl }) => {
142+
test('測試进入设置按鈕', { tag: "@scoped" }, async ({ context, content, optionPageUrl }) => {
143143

144144
await content.getByText('功能菜单').click()
145145
await content.locator('#bjf-main-menu').waitFor({ state: 'visible' })
@@ -154,7 +154,7 @@ test('測試进入设置按鈕', async ({ context, content, optionPageUrl }) =>
154154
})
155155

156156

157-
test('測試添加到黑名单按鈕', async ({ content, page, room }) => {
157+
test('測試添加到黑名单按鈕', { tag: "@scoped" }, async ({ content, page, room }) => {
158158

159159
await content.getByText('功能菜单').click()
160160
await content.locator('#bjf-main-menu').waitFor({ state: 'visible' })
@@ -170,7 +170,7 @@ test('測試添加到黑名单按鈕', async ({ content, page, room }) => {
170170

171171
})
172172

173-
test('測試重新启动按鈕', async ({ content, optionPageUrl, context }) => {
173+
test('測試重新启动按鈕', { tag: "@scoped" }, async ({ content, optionPageUrl, context }) => {
174174

175175

176176
const settingsPage = await context.newPage()
@@ -195,7 +195,7 @@ test('測試重新启动按鈕', async ({ content, optionPageUrl, context }) =>
195195
})
196196

197197

198-
test('測試弹出直播视窗按鈕', async ({ context, optionPageUrl, content }) => {
198+
test('測試弹出直播视窗按鈕', { tag: "@scoped" }, async ({ context, optionPageUrl, content }) => {
199199

200200
logger.info('正在修改設定...')
201201
const settingsPage = await context.newPage()
@@ -275,11 +275,11 @@ test('測試弹出直播视窗按鈕', async ({ context, optionPageUrl, content
275275
return document.querySelector('video').currentTime
276276
})
277277
expect(afterCurrentTime).toBeGreaterThan(beforeCurrentTime)
278-
278+
279279
const beforeBufferEnd = await monitor.evaluate(async () => {
280280
const video = document.querySelector('video')
281281
return video.buffered.end(video.buffered.length - 1)
282-
})
282+
})
283283
await monitor.waitForTimeout(3000)
284284
const afterBufferEnd = await monitor.evaluate(() => {
285285
const video = document.querySelector('video')
@@ -308,7 +308,7 @@ test('測試大海報房間下返回非海报界面按鈕', async ({ context, ro
308308

309309
})
310310

311-
test('測試全屏時有否根據設定顯示隱藏浮動按鈕', async ({ content, context, optionPageUrl }) => {
311+
test('測試全屏時有否根據設定顯示隱藏浮動按鈕', { tag: "@scoped" }, async ({ content, context, optionPageUrl }) => {
312312

313313
const button = content.getByText('功能菜单')
314314
await expect(button).toBeVisible()

0 commit comments

Comments
 (0)