智教助手平台:完整初始化
- 前端:Vue3 + TS + Element Plus,24 个页面路由(课件/组题/教案/动画/思维导图/作文批改/命题/课堂/资源/社区等) - 后端:FastAPI + SQLAlchemy + SQLite,17 个路由模块,AI 服务层含降级模板 - AI:glm-5.x 推理模型已禁用思维链,确保输出真实内容 - 修复:ai_service 两处请求体注入 enable_thinking/thinking disabled - 测试账号:13900999999 / test1234
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
import { chromium } from 'playwright-core';
|
||||
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: 1280, height: 800 } });
|
||||
const errors = [];
|
||||
page.on('console', m => { if (m.type() === 'error') errors.push(m.text()); });
|
||||
page.on('pageerror', e => errors.push('PAGEERROR: ' + e.message));
|
||||
|
||||
// Login
|
||||
await page.goto('http://127.0.0.1:5175/login', { waitUntil: 'networkidle' });
|
||||
await page.fill('input[placeholder*="手机"], input[type="tel"]', '13943441149');
|
||||
await page.fill('input[type="password"]', 'Test1234');
|
||||
await page.click('button:has-text("登录")');
|
||||
await page.waitForURL(/\/(home|courseware|exercise)/, { timeout: 8000 }).catch(() => {});
|
||||
await page.waitForTimeout(1500);
|
||||
|
||||
// Visit AI generation pages, check they render
|
||||
const pages = ['/exercise', '/exam', '/animation', '/lesson-plan', '/mindmap', '/essay-grade', '/courseware/create'];
|
||||
for (const p of pages) {
|
||||
await page.goto('http://127.0.0.1:5175' + p, { waitUntil: 'networkidle' }).catch(() => {});
|
||||
await page.waitForTimeout(800);
|
||||
const h = await page.textContent('h1, h2').catch(() => '(none)');
|
||||
console.log(p, '->', h?.trim()?.substring(0, 40));
|
||||
}
|
||||
|
||||
// Check exercise loading tip text exists in DOM (even if hidden)
|
||||
const tipExists = await page.evaluate(() => document.body.innerHTML.includes('模型深度推理中'));
|
||||
console.log('TIP_TEXT_PRESENT:', tipExists);
|
||||
|
||||
console.log('CONSOLE_ERRORS:', errors.length);
|
||||
errors.slice(0, 8).forEach(e => console.log(' ERR:', e.substring(0, 120)));
|
||||
await browser.close();
|
||||
Reference in New Issue
Block a user