feat(product-detail): AI素材成组(A)— 按类型归组,点组卡弹窗看整组
商品详情「AI 生成素材」从一堆散卡(单拎着)改为按类型成组:角色(形象图+三视图)/ 商品图 / 模特上身图 / 平台套图 / 自由创作 / 场景 / 分镜图 / 视频素材 各一组卡(带数量角标), 点组卡 → 弹窗看这组所有素材(缩图可放大;送审类才显审核态)。去掉「加载更多」(组少不分页)。 验收:tsc+build 绿;无头核对(2 组卡 角色/商品图、点开弹窗显组内素材 + 审核态、0 console error) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
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);
|
||||
r.groupCards=await p.locator(".pd-group-card").count();
|
||||
r.groups=await p.locator(".pd-group-card .type-pill").allInnerTexts().catch(()=>[]);
|
||||
await p.screenshot({path:path.join(OUT,"pd-grouped.png"),fullPage:true});
|
||||
if(r.groupCards>0){
|
||||
await p.locator(".pd-group-card").first().click(); await p.waitForTimeout(1200);
|
||||
r.modalOpen=await p.locator(".pack-modal").count();
|
||||
r.modalItems=await p.locator(".pd-group-item").count();
|
||||
await p.screenshot({path:path.join(OUT,"pd-group-modal.png")});
|
||||
}
|
||||
await b.close(); console.log(JSON.stringify(r,null,2));
|
||||
Reference in New Issue
Block a user