09-bgm.spec.ts 656 B

1234567891011121314151617181920
  1. /**
  2. * L2 回归测试:背景音乐
  3. */
  4. import { test, expect } from '@playwright/test';
  5. import { apiGet, apiPost, initApiClient, disposeApiClient } from '../helpers/api-client';
  6. test.describe('背景音乐 (BGM)', () => {
  7. test.beforeAll(async () => { await initApiClient(); });
  8. test.afterAll(async () => { await disposeApiClient(); });
  9. test('B01: 获取BGM列表 GET /api/bgm', async () => {
  10. const res = await apiGet('/api/bgm');
  11. expect(res.code).toBe(0);
  12. });
  13. test('B02: 获取BGM分类 GET /api/bgm/categories', async () => {
  14. const res = await apiGet('/api/bgm/categories');
  15. expect([0, 404]).toContain(res.code);
  16. });
  17. });