Files
jiaoyu/frontend/_br_test.cjs
T
Zhang Jing Xuan 0841b1a103 智教助手平台:完整初始化
- 前端:Vue3 + TS + Element Plus,24 个页面路由(课件/组题/教案/动画/思维导图/作文批改/命题/课堂/资源/社区等)
- 后端:FastAPI + SQLAlchemy + SQLite,17 个路由模块,AI 服务层含降级模板
- AI:glm-5.x 推理模型已禁用思维链,确保输出真实内容
- 修复:ai_service 两处请求体注入 enable_thinking/thinking disabled
- 测试账号:13900999999 / test1234
2026-07-29 16:29:10 +08:00

36 lines
1.9 KiB
JavaScript

const { chromium } = require('playwright-core');
(async () => {
const browser = await chromium.launch({ channel: 'chrome', headless: true, executablePath: 'C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe' });
const page = await browser.newPage({ viewport: { width: 1400, height: 900 } });
const errors = [];
page.on('console', m => { if (m.type() === 'error') errors.push(m.text()); });
page.on('pageerror', e => errors.push('PAGEERR: ' + e.message));
// 登录
await page.goto('http://127.0.0.1:5173/login', { waitUntil: 'networkidle' });
await page.waitForTimeout(800);
await page.fill('input[placeholder="请输入手机号"]', '13943441149');
await page.fill('input[type="password"]', 'Test1234');
await page.click('button.gradient-btn');
await page.waitForTimeout(3000);
const url1 = page.url();
console.log('登录后URL:', url1);
// 思维导图
await page.goto('http://127.0.0.1:5173/mindmap', { waitUntil: 'networkidle' });
await page.waitForTimeout(1000);
await page.fill('input[placeholder*="光合作用"]', '中国历史朝代');
await page.waitForTimeout(400);
await page.click('button:has-text("生成导图")');
console.log('已点生成导图');
await page.waitForTimeout(9000);
await page.screenshot({ path: 'D:\\AI\\jiaoyu\\_shot_mindmap.png', fullPage: true });
const bodyText = await page.evaluate(() => document.body.innerText);
console.log('含先秦文明:', bodyText.includes('先秦文明'));
console.log('含秦汉大一统:', bodyText.includes('秦汉大一统'));
console.log('含隋唐盛世:', bodyText.includes('隋唐盛世'));
console.log('含概念定义(旧通用):', bodyText.includes('概念定义'));
console.log('含知识结构(旧通用):', bodyText.includes('知识结构'));
console.log('错误数:', errors.length);
if (errors.length) console.log('错误:', errors.slice(0,5).join(' | '));
await browser.close();
})();