import { test, expect } from '@playwright/test'; const UNIAPP_BASE_URL = process.env.UNIAPP_BASE_URL || 'http://localhost:8081'; test.describe.configure({ mode: 'parallel' }); test('简化测试:页面导航', async ({ page }) => { await page.goto(UNIAPP_BASE_URL); await page.waitForLoadState('networkidle'); const bottomNav = page.locator('.bottom-navigation'); await expect(bottomNav).toBeVisible({ timeout: 15000 }); const navItems = bottomNav.locator('.nav-item'); const count = await navItems.count(); expect(count).toBeGreaterThanOrEqual(2); }); test('简化测试:万年历页面', async ({ page }) => { await page.goto(UNIAPP_BASE_URL); await page.waitForLoadState('networkidle'); const calendarGrid = page.locator('.calendar-grid, .calendar-container, [class*="calendar"]'); await expect(calendarGrid.first()).toBeVisible({ timeout: 15000 }); }); test('简化测试:黄历页面', async ({ page }) => { await page.goto(UNIAPP_BASE_URL); await page.waitForLoadState('networkidle'); const bottomNav = page.locator('.bottom-navigation'); const navItems = bottomNav.locator('.nav-item'); if (await navItems.count() > 1) { await navItems.nth(1).click(); await page.waitForTimeout(1000); } const almanacContent = page.locator('.almanac-card, .almanac-main-card, [class*="almanac"]'); await expect(almanacContent.first()).toBeVisible({ timeout: 10000 }); });