diff --git a/src/web/tests/playwright/alerts.spec.ts b/src/web/tests/playwright/alerts.spec.ts index fd656de..8d468c3 100644 --- a/src/web/tests/playwright/alerts.spec.ts +++ b/src/web/tests/playwright/alerts.spec.ts @@ -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 }) => { diff --git a/src/web/tests/playwright/dashboard.spec.ts b/src/web/tests/playwright/dashboard.spec.ts index cfbc0d8..d87f6b3 100644 --- a/src/web/tests/playwright/dashboard.spec.ts +++ b/src/web/tests/playwright/dashboard.spec.ts @@ -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 }) => { diff --git a/src/web/tests/playwright/helpers/testUtils.ts b/src/web/tests/playwright/helpers/testUtils.ts index caae4e4..2d37c92 100644 --- a/src/web/tests/playwright/helpers/testUtils.ts +++ b/src/web/tests/playwright/helpers/testUtils.ts @@ -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(); diff --git a/src/web/tests/playwright/logs.spec.ts b/src/web/tests/playwright/logs.spec.ts index de870f8..4c983bd 100644 --- a/src/web/tests/playwright/logs.spec.ts +++ b/src/web/tests/playwright/logs.spec.ts @@ -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); }); diff --git a/src/web/tests/playwright/metric.spec.ts b/src/web/tests/playwright/metric.spec.ts index c2a626e..1a300e6 100644 --- a/src/web/tests/playwright/metric.spec.ts +++ b/src/web/tests/playwright/metric.spec.ts @@ -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); }); diff --git a/src/web/tests/playwright/node-info.spec.ts b/src/web/tests/playwright/node-info.spec.ts index 71100cb..ae80bc7 100644 --- a/src/web/tests/playwright/node-info.spec.ts +++ b/src/web/tests/playwright/node-info.spec.ts @@ -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 }) => { diff --git a/src/web/tests/playwright/web-pages.spec.ts b/src/web/tests/playwright/web-pages.spec.ts index 1b0c62e..0a68485 100644 --- a/src/web/tests/playwright/web-pages.spec.ts +++ b/src/web/tests/playwright/web-pages.spec.ts @@ -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: '节点信息' },