Files
kt-financial-system/apps/web-finance/test-analytics-simple.js
你的用户名 675fe0a1a8 feat: 增强财务管理系统功能与分析能力
主要更新:
- 🎯 新增综合分析仪表板,包含关键指标卡片、预算对比、智能洞察等组件
- 📊 增强数据可视化能力,新增标签云分析、时间维度分析等图表
- 📱 优化移动端响应式设计,改进触控交互体验
- 🔧 新增多个API模块(base、budget、tag),完善数据管理
- 🗂️ 重构路由结构,新增贷款、快速添加、设置、统计等独立模块
- 🔄 优化数据导入导出功能,增强数据迁移能力
- 🐛 修复多个已知问题,提升系统稳定性

技术改进:
- 使用IndexedDB提升本地存储性能
- 实现模拟API服务,支持离线开发
- 增加自动化测试脚本,确保功能稳定
- 优化打包配置,提升构建效率

文件变更:
- 新增42个文件
- 修改55个文件
- 包含测试脚本、配置文件、组件和API模块

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-24 16:41:58 +08:00

72 lines
2.0 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { chromium } from 'playwright';
(async () => {
const browser = await chromium.launch({
headless: false, // 有头模式,方便观察
});
const context = await browser.newContext();
const page = await context.newPage();
try {
console.log('开始简单测试统计分析页面...');
// 直接访问统计分析页面
await page.goto('http://localhost:5666/analytics/overview', {
waitUntil: 'domcontentloaded',
timeout: 30_000,
});
console.log('页面URL:', page.url());
// 等待页面加载
await page.waitForTimeout(5000);
// 截图查看页面状态
await page.screenshot({
path: 'analytics-page-state.png',
fullPage: true,
});
console.log('已保存页面截图: analytics-page-state.png');
// 检查是否有错误信息
const errorMessages = await page.locator('.ant-message-error').count();
if (errorMessages > 0) {
console.log(`发现 ${errorMessages} 个错误信息`);
}
// 检查页面标题
const pageTitle = await page
.locator('h1, .page-header-title')
.first()
.textContent();
console.log('页面标题:', pageTitle);
// 检查是否有卡片组件
const cards = await page.locator('.ant-card').count();
console.log(`找到 ${cards} 个卡片组件`);
// 检查是否有canvas元素图表通常渲染在canvas中
const canvasElements = await page.locator('canvas').count();
console.log(`找到 ${canvasElements} 个canvas元素图表`);
// 查看控制台日志
page.on('console', (msg) => {
if (msg.type() === 'error') {
console.error('浏览器控制台错误:', msg.text());
}
});
console.log('\n测试完成');
} catch (error) {
console.error('测试失败:', error);
await page.screenshot({
path: 'analytics-error-simple.png',
fullPage: true,
});
} finally {
// 等待用户查看
await page.waitForTimeout(10_000);
await browser.close();
}
})();