Files
telegram-management-system/quick-test.js
你的用户名 237c7802e5
Some checks failed
Deploy / deploy (push) Has been cancelled
Initial commit: Telegram Management System
Full-stack web application for Telegram management
- Frontend: Vue 3 + Vben Admin
- Backend: NestJS
- Features: User management, group broadcast, statistics

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-04 15:37:50 +08:00

47 lines
1.8 KiB
JavaScript

const { chromium } = require('playwright');
async function quickTest() {
console.log('🚀 开始快速验证TG账号用途页面...');
const browser = await chromium.launch({ headless: false, slowMo: 1000 });
const page = await browser.newPage();
try {
// 登录
console.log('🔑 登录中...');
await page.goto('http://localhost:5173/login');
await page.waitForLoadState('networkidle');
await page.fill('input[placeholder="请输入用户名"]', 'admin');
await page.fill('input[placeholder="请输入密码"]', '111111');
await page.click('button[type="submit"]');
await page.waitForTimeout(3000);
// 访问TG账号用途页面
console.log('📋 访问TG账号用途页面...');
await page.goto('http://localhost:5173/account-manage/usage');
await page.waitForTimeout(5000);
// 检查是否有数据
const tableContent = await page.textContent('tbody');
if (tableContent && tableContent.includes('群组管理')) {
console.log('✅ 成功!页面显示了数据');
console.log(`📊 表格内容: ${tableContent.substring(0, 100)}...`);
} else if (tableContent && tableContent.includes('暂无数据')) {
console.log('❌ 失败!页面仍显示"暂无数据"');
} else {
console.log('⚠️ 未知状态,表格内容:', tableContent ? tableContent.substring(0, 100) : '无内容');
}
// 截图
await page.screenshot({ path: '/Users/hahaha/telegram-management-system/final-test.png' });
console.log('📷 截图已保存: final-test.png');
} catch (error) {
console.error('❌ 测试失败:', error.message);
} finally {
await browser.close();
}
}
quickTest();