/** * L2 回归测试:背景音乐 */ import { test, expect } from '@playwright/test'; import { apiGet, apiPost, initApiClient, disposeApiClient } from '../helpers/api-client'; test.describe('背景音乐 (BGM)', () => { test.beforeAll(async () => { await initApiClient(); }); test.afterAll(async () => { await disposeApiClient(); }); test('B01: 获取BGM列表 GET /api/bgm', async () => { const res = await apiGet('/api/bgm'); expect(res.code).toBe(0); }); test('B02: 获取BGM分类 GET /api/bgm/categories', async () => { const res = await apiGet('/api/bgm/categories'); expect([0, 404]).toContain(res.code); }); });