=test_update_homework_tests_and_work_log
Some checks failed
CI / build-deploy (push) Has been cancelled

This commit is contained in:
SpecialX
2026-03-19 13:16:49 +08:00
parent eb08c0ab68
commit 99f116cb64
70 changed files with 7470 additions and 20220 deletions

View File

@@ -0,0 +1,27 @@
import { expect, test } from "@playwright/test"
test.describe("auth business flow", () => {
test("register then login and reach protected area", async ({ page }) => {
test.skip(!process.env.DATABASE_URL, "requires DATABASE_URL for write-flow verification")
const id = Date.now()
const email = `e2e.user.${id}@example.com`
const password = "e2e-pass-123456"
await page.goto("/register")
await page.getByLabel("Full Name").fill("E2E User")
await page.getByLabel("Email").fill(email)
await page.getByLabel("Password").fill(password)
await page.getByRole("button", { name: "Create Account" }).click()
await expect(page).toHaveURL(/\/login(?:$|[/?#])/)
await page.getByLabel("Email").fill(email)
await page.getByLabel("Password").fill(password)
await page.getByRole("button", { name: "Sign In with Email" }).click()
await expect(page).toHaveURL(/\/(dashboard|student\/dashboard)(?:$|[/?#])/)
const profileResponse = await page.goto("/profile")
expect(profileResponse?.status() ?? 200).toBeLessThan(500)
await expect(page).not.toHaveURL(/\/login(?:$|[/?#])/)
})
})