Files
seaislee1209 3fda75ce65 fix(product-detail): 修素材类型标签映射 + 审核态只显送审类
- PD_ASSET_TYPE_LABEL 改对并补全:person→角色(原误为「模特上身图」)、scene→场景(原误为
  「平台套图」)、补 model_portrait/model_tryon/platform_kit/free_create/storyboard/video_clip
  (老数据里分镜=scene、形象图=person 因此前张冠李戴)
- 审核态(火山人像审核)只渲染在送审三类(person/tri_view/storyboard)上;其余素材根本不送审,
  此前一律标「待审核」是误导,现不显

验收:tsc+build 绿;无头核对(角色显「角色」+待审核、商品图无审核态、0 console error)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-21 22:13:36 +08:00

24 lines
1.5 KiB
JavaScript

import { chromium } from "playwright";
import path from "node:path"; import fs from "node:fs";
const PID="53d7a7c3-2f41-431b-82d3-3acc97900310";
const OUT=path.resolve("../../../_qa_shots/pd"); 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:1000}})).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/products/"+PID); await p.waitForTimeout(3000);
// 收集每张素材卡的 类型标签 + 是否有审核态
const cards=await p.locator(".asset-card").count();
const rows=[];
for(let i=0;i<Math.min(cards,20);i++){
const c=p.locator(".asset-card").nth(i);
const type=await c.locator(".type-pill").innerText().catch(()=>"");
const status=await c.locator(".meta .pill").innerText().catch(()=>"");
rows.push({type, status: status||"(无)"});
}
r.cards=cards; r.sample=rows;
await p.locator("#asset-grid, .asset-grid").first().screenshot({path:path.join(OUT,"pd-materials.png")}).catch(()=>p.screenshot({path:path.join(OUT,"pd-full.png"),fullPage:true}));
await b.close(); console.log(JSON.stringify(r,null,2));