dev_1.0.0_xuxt_3 完成web和alert的集成测试 #38

Merged
xuxt merged 12 commits from dev_1.0.0_xuxt_3 into dev_1.0.0 2025-10-31 14:18:20 +08:00
2 changed files with 6 additions and 4 deletions
Showing only changes of commit 63fe5c61f5 - Show all commits

View File

@ -65,8 +65,8 @@ if [ ! -d "node_modules" ]; then
fi fi
log_info "Checking Playwright browsers..." log_info "Checking Playwright browsers..."
if [ -d "node_modules/.playwright" ]; then if [ -d "node_modules/playwright" ]; then
log_info "Found node_modules/.playwright, checking if browsers are complete..." log_info "Found node_modules/playwright, checking if browsers are complete..."
# 使用 dry-run 确认浏览器是否完整 # 使用 dry-run 确认浏览器是否完整
if npx playwright install --dry-run | grep -q "All required browsers are installed"; then if npx playwright install --dry-run | grep -q "All required browsers are installed"; then
log_info "All Playwright browsers are already installed, skipping installation." log_info "All Playwright browsers are already installed, skipping installation."

View File

@ -32,7 +32,7 @@ test.describe("节点信息页面 NodeInfo", () => {
// ======================== // ========================
// 1 验证基础信息 // 1 验证基础信息
// ======================== // ========================
for (const label of ['注册时间', '最近上报时间', '最后更新时间']) { for (const label of ['注册时间', '最近上报时间', '最后更新时间', '元数据信息', '健康信息', '配置信息', '标签信息']) {
const el = drawer.locator(`text=${label}`).first(); const el = drawer.locator(`text=${label}`).first();
await el.waitFor({timeout: 5000}); await el.waitFor({timeout: 5000});
await expect(el).toBeVisible(); await expect(el).toBeVisible();
@ -42,9 +42,11 @@ test.describe("节点信息页面 NodeInfo", () => {
// 2 Drawer 关闭 // 2 Drawer 关闭
// ======================== // ========================
const closeBtn = drawer.locator('button[aria-label="Close"]').first(); const closeBtn = drawer.locator('button[aria-label="Close"]').first();
await closeBtn.waitFor({ state: 'visible', timeout: 10000 });
await closeBtn.scrollIntoViewIfNeeded(); await closeBtn.scrollIntoViewIfNeeded();
await closeBtn.click({ force: true }); await closeBtn.click({ force: true });
await expect(drawer).toBeHidden(); await expect(drawer).toBeHidden();
}); });
test("每个节点的 Grafana 按钮链接正确", async ({ page }) => { test("每个节点的 Grafana 按钮链接正确", async ({ page }) => {
await page.waitForSelector("table tbody tr", { timeout: 10000 }); await page.waitForSelector("table tbody tr", { timeout: 10000 });