From fb6139d45c65cf8a2421c0d504aee335fa3d120e Mon Sep 17 00:00:00 2001 From: leefer Date: Thu, 22 Oct 2026 07:43:33 +0800 Subject: [PATCH] test(HEL-771): wait for sample border transition before capture Co-authored-by: multica-agent --- scripts/compare-hel771.py | 2 +- scripts/verify-hel771.mjs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/compare-hel771.py b/scripts/compare-hel771.py index 5c31a347..f012c431 100644 --- a/scripts/compare-hel771.py +++ b/scripts/compare-hel771.py @@ -26,7 +26,7 @@ for g in r['groups']: b=Image.open(OUT/(g['name']+'-sample.png')).convert('RGB') assert a.size==b.size d=ImageChops.difference(a,b) - pixels=sum(1 for p in d.getdata() if p!=(0,0,0)) + pixels=sum(1 for p in d.get_flattened_data() if p!=(0,0,0)) summary['pixels'].append({'name':g['name'],'different_pixels':pixels,'total_pixels':a.width*a.height,'max_channel_delta':max(x[1] for x in d.getextrema())}) if g['width']==1440 and g['theme']=='night' and g['card'] in (0,1): pair=Image.new('RGB',(a.width*2,a.height+24),'#151515') diff --git a/scripts/verify-hel771.mjs b/scripts/verify-hel771.mjs index 8e857769..7ed18079 100644 --- a/scripts/verify-hel771.mjs +++ b/scripts/verify-hel771.mjs @@ -217,7 +217,7 @@ try { await ref.locator(b).evaluate((e,on)=>e.classList.toggle("on",on), state === "selected"); await app.mouse.move(1200,600); await ref.mouse.move(1200,600); if (state === "hover") { await app.locator(a).hover(); await ref.locator(b).hover(); } - await app.waitForTimeout(150); + await app.waitForTimeout(300); const name = `${key}-card${i}-${state}`; results.groups.push({name, theme, width, card:i, state, app:await app.evaluate(MEASURE,a), sample:await ref.evaluate(MEASURE,b)}); await app.locator(a).screenshot({path:path.join(OUT,`${name}-app.png`)});