chore: 生成记录功能遗留产物提交与远程仓库迁移
- pillow>=12.3.0 依赖入库(支撑 AI 生成图持久化处理) - e2e 辅助脚本: _e2e_opt/_e2e_upload/_rec_ui - 巡检/审计/多结果/记录抽屉测试截图归档 shots/ - 远程仓库迁移至 git.djxx.club/hanzhicheng/menchuang
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
import puppeteer from 'puppeteer-core'
|
||||
import path from 'path'
|
||||
const browser = await puppeteer.launch({
|
||||
executablePath: 'C:/Program Files (x86)/Microsoft/Edge/Application/msedge.exe',
|
||||
headless: 'new', args: ['--window-size=1440,900', '--enable-unsafe-swiftshader'],
|
||||
defaultViewport: { width: 1440, height: 900 },
|
||||
})
|
||||
const page = await browser.newPage()
|
||||
const token = process.argv[2]
|
||||
const sketch = process.argv[3]
|
||||
await page.goto(`http://localhost:8000/ai_render?token=${encodeURIComponent(token)}`, { waitUntil: 'networkidle2' })
|
||||
await new Promise(r => setTimeout(r, 2000))
|
||||
await page.evaluate(() => {
|
||||
[...document.querySelectorAll('.el-radio-button')].find(b => b.textContent.includes('工程大样图'))?.querySelector('input')?.click()
|
||||
})
|
||||
await new Promise(r => setTimeout(r, 1000))
|
||||
// 上传草图
|
||||
const input = await page.$('.el-upload input[type=file]')
|
||||
await input.uploadFile(path.resolve(sketch))
|
||||
await new Promise(r => setTimeout(r, 1500))
|
||||
await page.screenshot({ path: '../shots/bp-upload.png' })
|
||||
console.log('上传预览截图完成')
|
||||
await browser.close()
|
||||
Reference in New Issue
Block a user