Files
NextEdu/tests/e2e/smoke-auth.spec.ts
SpecialX 0e63c24ed9
Some checks failed
CI / scheduled-backup (push) Has been skipped
CI / backup-verify (push) Has been skipped
CI / weekly-dr-drill (push) Failing after 0s
CI / build-deploy (push) Has been cancelled
CI / security-scan (push) Has been cancelled
feat(shared,tests): add error boundaries, lib utils, i18n messages, and integration tests
shared:

- Add class-filter, error-state, route-error, section-error-boundary, widget-boundary components

- Add ui/alert component

- Add constants directory

- Add breached-password, export-utils, permission-bitmap, rate-limit, resolve-action-error, route-permissions, route-resolver, type-guards lib

- Add i18n messages (en, zh-CN) for invitation-codes, parent, questions, rbac

tests:

- Add integration tests for elective

- Add tests/setup/empty-stub

scripts:

- Add update-md.cjs, tmp_append_en.ps1, tmp_merge_en.ps1 utilities
2026-07-03 10:26:38 +08:00

24 lines
1.0 KiB
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 "@playwright/test"
test.describe("auth smoke", () => {
test("login page renders required controls", async ({ page }) => {
await page.goto("/login")
await expect(page).toHaveTitle(/Login/i)
await expect(page.getByLabel("Email")).toBeVisible()
await expect(page.getByLabel("Password")).toBeVisible()
await expect(page.getByRole("button", { name: "Sign In with Email" })).toBeVisible()
})
test("register page renders required controls", async ({ page }) => {
await page.goto("/register")
await expect(page).toHaveTitle(/Register/i)
// 注册表单当前使用中文文案P1 i18n 阶段会切换为 next-intl 翻译键,
// 届时此处的选择器应改用 data-testid 或 i18n 键以确保语言无关。
await expect(page.getByLabel("姓名")).toBeVisible()
await expect(page.getByLabel("邮箱")).toBeVisible()
await expect(page.getByLabel("密码")).toBeVisible()
await expect(page.getByRole("button", { name: "创建账户" })).toBeVisible()
})
})