Files
seaislee1209 612ab6864d feat(pipeline): 基础资产页 A三视图手动 + B进故事板拦截 + C采用/未采用 + D删除
- A 三视图改手动:删"打开角色详情自动出三视图"逻辑、角色生成只出立绘(不再链式自动三视图);
  详情弹窗保留「AI 生成三视图」按钮作手动入口(提示文案去掉"自动")
- B 进下一步拦截:「确认资产,进入故事板」按钮挂 guardGen —— 被引用角色/场景缺"已采用"参考图就弹窗拦
- C 采用/未采用:角色/场景卡加 toggle 徽章(已采用绿/未采用灰);默认按"实体名是否在脚本里"派生,
  用户可点击覆盖并持久化(metadata.adopt);后端 set-base-asset-adopt 端点;下游 _storyboard_reference_images
  只取已采用组(商品组永远保留、顺带排除未采用/三视图组的兜底误抓)
- D 删除:角色/场景卡 hover 显删除按钮(二次确认),商品主卡不给删;后端 delete-base-asset(连带三视图组)
- 顺手:提取闸门按钮去掉"不自动花钱"文案

验收:projects/assets/ai 全套(基线既有 7 失败零新增,新增 set-adopt/delete 3 测过);tsc+build 绿;
无头核对(采用 toggle/hover 删除/待审核盾齐活、0 console error)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-22 19:23:02 +08:00

19 lines
1.5 KiB
JavaScript

import { chromium } from "playwright";
import path from "node:path"; import fs from "node:fs";
const OUT=path.resolve("../../../_qa_shots/adopt"); fs.mkdirSync(OUT,{recursive:true});
const b=await chromium.launch({headless:true}); const r={consoleErrors:[]};
const p=await (await b.newContext({viewport:{width:1440,height:900}})).newPage();
p.on("console",m=>{if(m.type()==="error")r.consoleErrors.push(m.text())}); p.on("pageerror",e=>r.consoleErrors.push("PE:"+e.message));
await p.goto("http://localhost:5200/login"); await p.waitForTimeout(300);
await p.fill("#auth-username","airshelf"); await p.fill("#auth-pwd","Restraint2026");
await p.click("button.btn-cta"); await p.waitForFunction(()=>!location.pathname.startsWith("/login"),{timeout:12000});
await p.goto("http://localhost:5200/pipeline/bdbf39d3-1a89-4135-b1b7-26d3331a7021"); await p.waitForTimeout(2200);
await p.locator('a[data-stage="2"]').first().click().catch(()=>{}); await p.waitForTimeout(2200);
r.adoptToggles=await p.locator(".adopt-toggle").count();
r.toggleTexts=await p.locator(".adopt-toggle").allInnerTexts().catch(()=>[]);
// hover 第一张角色卡看删除按钮
const card=p.locator(".asset-card-2[data-asset-kind='person']").first();
if(await card.count()){ await card.hover(); await p.waitForTimeout(500); r.delBtnVisible=await card.locator(".asset-card-del").isVisible().catch(()=>false); }
await p.screenshot({path:path.join(OUT,"adopt-del.png"),fullPage:true});
await b.close(); console.log(JSON.stringify(r,null,2));