Files
huike-e2e-moicen/tests/smoke-http.spec.ts
T
weli d85027a933 feat(e2e): 核心全链路用例与辅助模块
新增 smoke-http、core-full-chain(访客深链守卫、登录黄金路径、可选健康 URL);抽出 music-room-session 辅助;Playwright 忽略本地 admin_debug;CI 注入可选 MOICEN_HEALTHCHECK_URL。

Made-with: Cursor
2026-04-28 11:53:48 +08:00

21 lines
678 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import { expect, test } from './fixtures';
function frontBaseUrl(): string {
const raw =
process.env.HUIKE_FRONT_BASE_URL?.trim() ||
'https://music-room.moicen.com';
return raw.replace(/\/$/, '');
}
/**
* 不依赖浏览器:验证网关返回 H5 入口文档(部署/ DNS / TLS / Nginx 全链路底线)。
*/
test.describe('网关与 H5 文档(request', () => {
test('GET / 返回 HTML', async ({ request }) => {
const res = await request.get(`${frontBaseUrl()}/`);
expect(res.ok(), `HTTP ${res.status()} ${res.statusText()}`).toBeTruthy();
const ct = res.headers()['content-type'] ?? '';
expect(ct).toMatch(/text\/html/i);
});
});