import { test, expect, describe } from "@playwright/test";

test.describe("登录页面访问测试", () => {
  test("根路径应重定向到dashboard或登录页", async ({ page }) => {
    await page.goto("/");
    const url = page.url();
    expect(url).toMatch(/\/(dashboard|login)/);
  });

  test("直接访问登录页面应成功", async ({ page }) => {
    await page.goto("/login");
    await expect(page.getByRole("heading", { name: "登录" })).toBeVisible({ timeout: 10000 });
  });

  test("登录页面标题正确", async ({ page }) => {
    await page.goto("/login");
    await expect(page.getByText("请输入您的账号信息登录GEO平台")).toBeVisible({ timeout: 10000 });
  });
});
