feat(POSTV1-03): 增加本机测试直达入口
Dada P0-A isolated Windows CI / validate-and-package (push) Waiting to run

This commit is contained in:
suyx
2026-08-05 14:53:20 +08:00
parent f7cac5dabf
commit 92434aec17
9 changed files with 297 additions and 2 deletions
+23
View File
@@ -23,6 +23,29 @@ test.beforeAll(async () => {
test.afterAll(async () => vite.close());
test("POSTV1-03 enters the workspace through the local test session", async ({ page }) => {
await page.route("**/api/v1/auth/local-test", (route) => {
if (route.request().method() === "GET") {
return route.fulfill({ contentType: "application/json", status: 200, body: JSON.stringify({ available: true }) });
}
expect(route.request().postData()).toBeNull();
return route.fulfill({ contentType: "application/json", status: 200, body: JSON.stringify({ status: "authenticated" }) });
});
await page.goto(webUrl);
const button = page.getByRole("button", { name: "直接进入本机测试" });
await expect(button).toBeVisible();
await button.click();
await expect(page).toHaveURL(`${webUrl}/app`);
});
test("POSTV1-03 hides the local test entry when the API does not enable it", async ({ page }) => {
await page.route("**/api/v1/auth/local-test", (route) => route.fulfill({ status: 404, body: "" }));
await page.goto(webUrl);
await expect(page.getByRole("button", { name: "直接进入本机测试" })).toHaveCount(0);
});
test("TDD-WP1-NOTICE-001 expands DVPM8 only after successful code delivery", async ({ page }) => {
await page.route("**/api/v1/auth/register/send", (route) => route.fulfill({
contentType: "application/json",