const { chromium } = require('playwright'); async function finalCheck() { const browser = await chromium.launch({ headless: false }); const page = await browser.newPage(); try { await page.goto('http://localhost:8892'); await page.waitForTimeout(2000); // 登录 const usernameInput = await page.$('input[type="text"]'); const passwordInput = await page.$('input[type="password"]'); const loginButton = await page.$('button'); if (usernameInput && passwordInput && loginButton) { await usernameInput.fill('admin'); await passwordInput.fill('111111'); await loginButton.click(); await page.waitForTimeout(3000); } // 访问账号列表页面 await page.goto('http://localhost:8892/#/tgAccountManage/tgAccountList'); await page.waitForTimeout(5000); // 截图 await page.screenshot({ path: 'final_verification.png', fullPage: true }); console.log('最终验证截图已保存'); } catch (error) { console.error('错误:', error); } finally { await browser.close(); } } finalCheck();