import { test, expect } from '@playwright/test'; test('页面加载正常', async ({ page }, testInfo) => { await page.goto('/'); console.log(`page.url() === ${page.url()}`); await expect(page.getByRole('link', { name: '中文-页面.page.vue' })).toBeVisible(); await testInfo.attach('screenshot', { body: await page.screenshot({ fullPage: true }), contentType: 'image/png' }); // 使用文本选择器查找包含 "commit:" 的元素 const commitElement = page.locator('text=commit:').first(); const innerText = await commitElement.innerText(); console.log(`Commit 文本内容: "${innerText}"`); });