前后端目录重命名: - reading-platform-java/ → lesingle-edu-reading-platform-backend/ - reading-platform-frontend/ → lesingle-edu-reading-platform-frontend/ 更新相关文件: - 所有 shell 脚本中的目录引用 - pom.xml 和 application.yml 中的项目名称 - package.json 中的项目名称 - .claude/CLAUDE.md 中的路径引用 - README 文档中的路径引用
54 lines
1.5 KiB
JavaScript
54 lines
1.5 KiB
JavaScript
import { chromium } from 'playwright';
|
|
|
|
(async () => {
|
|
const browser = await chromium.launch({ headless: false });
|
|
const page = await browser.newPage();
|
|
|
|
// 监听控制台消息
|
|
page.on('console', msg => {
|
|
if (msg.type() === 'error') {
|
|
console.log('Console Error:', msg.text());
|
|
}
|
|
});
|
|
|
|
page.on('pageerror', error => {
|
|
console.log('Page Error:', error.message);
|
|
});
|
|
|
|
try {
|
|
console.log('访问登录页面...');
|
|
await page.goto('http://localhost:5173/login');
|
|
await page.waitForTimeout(2000);
|
|
|
|
console.log('尝试登录...');
|
|
await page.fill('input[type="text"]', 'teacher1');
|
|
await page.fill('input[type="password"]', '123456');
|
|
await page.click('button[type="submit"]');
|
|
await page.waitForTimeout(3000);
|
|
|
|
console.log('当前URL:', page.url());
|
|
|
|
console.log('访问课程中心...');
|
|
await page.click('text=课程中心');
|
|
await page.waitForTimeout(2000);
|
|
|
|
console.log('点击第一个课程...');
|
|
const firstCourse = page.locator('.course-card, [class*="course"]').first();
|
|
await firstCourse.click();
|
|
await page.waitForTimeout(2000);
|
|
|
|
console.log('点击开始备课...');
|
|
await page.click('button:has-text("开始备课")');
|
|
await page.waitForTimeout(3000);
|
|
|
|
console.log('当前URL:', page.url());
|
|
console.log('页面加载完成,检查控制台错误...');
|
|
|
|
await page.waitForTimeout(5000);
|
|
} catch (error) {
|
|
console.error('发生错误:', error.message);
|
|
}
|
|
|
|
await browser.close();
|
|
})();
|