新增 AutoRDO 需求清洗工作台与消息中枢,迭代 OneOS V2 设计规范及租赁合同/工作台/车辆等原型,同步云效技能与导航注册;并归档一批 legacy 原型快照。
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
62
scripts/shot-h5-vehicle-all.mjs
Normal file
62
scripts/shot-h5-vehicle-all.mjs
Normal file
@@ -0,0 +1,62 @@
|
||||
import puppeteer from 'puppeteer';
|
||||
|
||||
async function main() {
|
||||
const browser = await puppeteer.launch({
|
||||
executablePath: '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome',
|
||||
headless: true,
|
||||
args: ['--no-sandbox', '--disable-setuid-sandbox']
|
||||
});
|
||||
|
||||
const page = await browser.newPage();
|
||||
await page.setViewport({ width: 1440, height: 960, deviceScaleFactor: 2 });
|
||||
|
||||
const url = 'http://localhost:51721/prototypes/oneos-v2?view=h5-vehicle';
|
||||
console.log('Navigating to', url);
|
||||
await page.goto(url, { waitUntil: 'networkidle2', timeout: 15000 });
|
||||
await new Promise(r => setTimeout(r, 1500));
|
||||
|
||||
// 1. List View Screenshot
|
||||
await page.screenshot({ path: '/Users/sylvawong/oneos1.2/.tmp-h5-vehicle-list.png', fullPage: false });
|
||||
console.log('Saved List View screenshot');
|
||||
|
||||
// 2. Click Kanban Mode
|
||||
const buttons = await page.$$('button');
|
||||
for (const btn of buttons) {
|
||||
const text = await page.evaluate(el => el.textContent, btn);
|
||||
if (text && text.includes('2. 看板模式')) {
|
||||
await btn.click();
|
||||
break;
|
||||
}
|
||||
}
|
||||
await new Promise(r => setTimeout(r, 1000));
|
||||
await page.screenshot({ path: '/Users/sylvawong/oneos1.2/.tmp-h5-vehicle-kanban.png', fullPage: false });
|
||||
console.log('Saved Kanban View screenshot');
|
||||
|
||||
// 3. Click Workbench Mode
|
||||
for (const btn of buttons) {
|
||||
const text = await page.evaluate(el => el.textContent, btn);
|
||||
if (text && text.includes('3. 档案工作台')) {
|
||||
await btn.click();
|
||||
break;
|
||||
}
|
||||
}
|
||||
await new Promise(r => setTimeout(r, 1000));
|
||||
await page.screenshot({ path: '/Users/sylvawong/oneos1.2/.tmp-h5-vehicle-workbench.png', fullPage: false });
|
||||
console.log('Saved Workbench View screenshot');
|
||||
|
||||
// 4. Click Dark Mode toggle
|
||||
for (const btn of buttons) {
|
||||
const text = await page.evaluate(el => el.textContent, btn);
|
||||
if (text && (text.includes('暗色') || text.includes('深色'))) {
|
||||
await btn.click();
|
||||
break;
|
||||
}
|
||||
}
|
||||
await new Promise(r => setTimeout(r, 1000));
|
||||
await page.screenshot({ path: '/Users/sylvawong/oneos1.2/.tmp-h5-vehicle-dark.png', fullPage: false });
|
||||
console.log('Saved Dark Mode screenshot');
|
||||
|
||||
await browser.close();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
||||
Reference in New Issue
Block a user