Initial commit: Telegram Management System
Some checks failed
Deploy / deploy (push) Has been cancelled
Some checks failed
Deploy / deploy (push) Has been cancelled
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>
This commit is contained in:
70
frontend/quick-menu-test.js
Normal file
70
frontend/quick-menu-test.js
Normal file
@@ -0,0 +1,70 @@
|
||||
const { chromium } = require('playwright');
|
||||
|
||||
async function quickMenuTest() {
|
||||
const browser = await chromium.launch({
|
||||
headless: false,
|
||||
slowMo: 800
|
||||
});
|
||||
|
||||
const context = await browser.newContext({
|
||||
viewport: { width: 1920, height: 1080 }
|
||||
});
|
||||
|
||||
const page = await context.newPage();
|
||||
|
||||
console.log('🚀 快速验证菜单点击修复...');
|
||||
|
||||
try {
|
||||
// 登录
|
||||
await page.goto('http://localhost:8891/login', { waitUntil: 'networkidle' });
|
||||
await page.locator('input[type="text"]').first().fill('admin');
|
||||
await page.locator('input[type="password"]').first().fill('111111');
|
||||
await page.locator('button[type="submit"]').first().click();
|
||||
await page.waitForTimeout(2000);
|
||||
|
||||
// 访问主页
|
||||
await page.goto('http://localhost:8891/home', { waitUntil: 'networkidle' });
|
||||
await page.waitForTimeout(2000);
|
||||
|
||||
console.log('✅ 已登录并访问主页');
|
||||
|
||||
// 测试菜单点击
|
||||
const urlBefore = page.url();
|
||||
console.log(`点击前URL: ${urlBefore}`);
|
||||
|
||||
// 尝试点击第一个子菜单
|
||||
const firstSubmenu = await page.locator('.ivu-menu-submenu-title').first();
|
||||
if (await firstSubmenu.count() > 0) {
|
||||
const submenuText = await firstSubmenu.textContent();
|
||||
console.log(`点击子菜单: "${submenuText}"`);
|
||||
await firstSubmenu.click();
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
// 点击子菜单项
|
||||
const submenuItem = await page.locator('.ivu-menu-item').first();
|
||||
if (await submenuItem.count() > 0) {
|
||||
const itemText = await submenuItem.textContent();
|
||||
console.log(`点击菜单项: "${itemText}"`);
|
||||
await submenuItem.click();
|
||||
await page.waitForTimeout(2000);
|
||||
|
||||
const urlAfter = page.url();
|
||||
console.log(`点击后URL: ${urlAfter}`);
|
||||
|
||||
if (urlBefore !== urlAfter) {
|
||||
console.log('🎉 SUCCESS! 菜单点击已修复!路由导航正常工作');
|
||||
} else {
|
||||
console.log('❌ FAILED: 菜单点击仍然无效');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} catch (error) {
|
||||
console.error('❌ 测试失败:', error.message);
|
||||
}
|
||||
|
||||
await page.waitForTimeout(5000);
|
||||
await browser.close();
|
||||
}
|
||||
|
||||
quickMenuTest().catch(console.error);
|
||||
Reference in New Issue
Block a user