modify playwright

This commit is contained in:
xiuting.xu 2025-10-30 09:48:07 +08:00
parent 471f3e13f9
commit 752d2991ec
7 changed files with 7 additions and 7 deletions

View File

@ -2,7 +2,7 @@ import { test, expect } from "@playwright/test";
test.describe("Alerts 页面功能测试", () => {
test.beforeEach(async ({ page }) => {
await page.goto("http://web.argus.com/alerts"); // 根据你实际路由调整
await page.goto("http://localhost:8080/alerts"); // 根据你实际路由调整
});
test("页面加载并显示告警统计", async ({ page }) => {

View File

@ -4,7 +4,7 @@ test.describe('Dashboard 页面测试', () => {
test.beforeEach(async ({ page }) => {
// 打开仪表盘页面
await page.goto('http://web.argus.com/dashboard', { waitUntil: 'networkidle' });
await page.goto('http://localhost:8080/dashboard', { waitUntil: 'networkidle' });
});
test('应能成功加载页面并显示标题', async ({ page }) => {

View File

@ -4,7 +4,7 @@ import { Page, expect } from '@playwright/test';
*
*/
export async function checkPage(page: Page, path: string, title: string) {
await page.goto('http://web.argus.com/');
await page.goto('http://localhost:8080/');
const menu = page.getByRole('link', { name: title });
await expect(menu).toBeVisible();
await menu.click();

View File

@ -4,7 +4,7 @@ import { testEntryCards } from './helpers/entrycards-helpers';
test.describe('Logs Page', () => {
test('should render all log cards', async ({ page }) => {
await page.goto('http://web.argus.com/logs');
await page.goto('http://localhost:8080m/logs');
await expect(page.locator('h2', { hasText: '日志详情' })).toBeVisible();
await testEntryCards(page, logsEntries);
});

View File

@ -5,7 +5,7 @@ import { testEntryCards } from './helpers/entrycards-helpers';
test.describe('Metrics Page', () => {
test('should render all metric cards', async ({ page }) => {
await page.goto('http://web.argus.com/metrics');
await page.goto('http://localhost:8080/metrics');
await expect(page.locator('h2', { hasText: '指标详情' })).toBeVisible();
await testEntryCards(page, metricsEntries);
});

View File

@ -3,7 +3,7 @@ import { test, expect } from "@playwright/test";
test.describe("节点信息页面 NodeInfo", () => {
// 每次测试前打开目标页面
test.beforeEach(async ({ page }) => {
await page.goto("http://web.argus.com/node");
await page.goto("http://localhost:8080/node");
});
test("页面标题应该正确显示", async ({ page }) => {

View File

@ -1,7 +1,7 @@
import { test } from '@playwright/test';
import { checkPage, noConsoleError } from './helpers/testUtils';
const BASE_URL = 'http://web.argus.com';
const BASE_URL = 'http://localhost:8080';
const pages = [
{ path: '/dashboard', title: '仪表盘' },
{ path: '/nodeInfo', title: '节点信息' },