geo/frontend/e2e/tests/login-redirect-system-chrom...

28 lines
891 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 { test, expect, chromium } from "@playwright/test";
const TEST_USER = {
email: "admin@fischer.com",
password: "Admin@123",
};
test.use({
launchOptions: {
executablePath: "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome",
},
});
test.describe("登录跳转测试系统Chrome", () => {
test("登录成功后应跳转到dashboard并保持在dashboard", async ({ page }) => {
await page.goto("/login");
await page.locator("#email").fill(TEST_USER.email);
await page.locator("#password").fill(TEST_USER.password);
await page.getByRole("button", { name: /登录/ }).click();
await expect(page).toHaveURL(/\/dashboard/, { timeout: 15000 });
await page.waitForTimeout(3000);
await expect(page).toHaveURL(/\/dashboard/);
await expect(page.getByText("Overview", { exact: false })).toBeVisible({ timeout: 10000 });
});
});