Files
metin2-client/audit/evidence/ava2-products-device-20261021/run-touch.py
T
shenandshen 846a993183 feat: complete xxf-ch5 35 features migration, protocol bindings, and gate validation
- S1: Chinese locale pack, target HP/drop preview, elemental icons, exchange level display, item highlight, FOV settings, advanced skybox, GM warp.
- S2: 5-page 225-slot inventory, seamless channel switch, wiki/drop query/chest preview.
- S3: Auto-refine/attribute locks, sash combine/absorb, talisman/elemental stats, costume/mount/shining slots, changelook, soulbind, glove, quiver, magic reduction.
- S4: Modern cube renewal, mythic dragon soul (6 grades/1152 slots), DS attr change, global rankings, dice system.
- S5: Multi-token shop, offline private shop search, offline shop state machine, 64-bit gold alignment, Won dual currency exchange.
- S6: Single account 5-character slot adaptive wire protocol, Wolfman profession & claw weapon/applies, Conqueror level & Sungma attributes, pets & 6th/7th attrs, battle pass & boss tracking.
- Pass 42/42 platform gate test suites in scripts/port_gate.sh macos.
2026-10-22 01:29:14 -07:00

36 lines
3.1 KiB
Python

import subprocess,time,json,pathlib
ADB=['/Users/shen/Library/Android/sdk/platform-tools/adb','-s','3B1F5RE8WTX884UM'];Q=pathlib.Path(__file__).resolve().parent
commands=[]
def shell(*args):
commands.append(list(args));subprocess.run(ADB+['shell',*map(str,args)],check=True)
def state():return json.loads(subprocess.check_output(ADB+['exec-out','run-as','org.metin2port.client','cat','files/products-qa-result.json']))
def wait(name,predicate,timeout=8):
end=time.monotonic()+timeout
while time.monotonic()<end:
time.sleep(.35)
try:r=state()
except (ValueError,subprocess.CalledProcessError):continue
if predicate(r):
(Q/(name+'.json')).write_text(json.dumps(r,indent=2));print(name,'PASS',flush=True);return r
raise AssertionError(name+': '+str({k:v for k,v in r.items() if k!='icons'}))
def shot(name):(Q/(name+'.png')).write_bytes(subprocess.check_output(ADB+['exec-out','screencap','-p']))
def tap(x,y):shell('input','tap',x,y)
def confirm_action(name,ending):
tap(1115,585);r=wait(name,lambda r:r['actions'] and r['actions'][-1].endswith(ending) and r.get('ready'))
return r
# All financial operations are blocked and recorded by device-qa.py.
tap(1985,70);r=wait('fixed-shop-open',lambda r:r.get('ready') and r.get('visible'));assert len(r['icons'])==168 and all(i['match'] for i in r['icons'])
tap(1110,315);wait('fixed-buy-confirm',lambda r:r.get('confirmation_visible'));shot('fixed-buy-confirm');confirm_action('fixed-buy-action','buy 9007199254740993 750')
tap(770,407);wait('fixed-orders-page',lambda r:r.get('ready') and r.get('mode')==2)
tap(1110,315);wait('fixed-claim-confirm',lambda r:r.get('confirmation_visible'));confirm_action('fixed-claim-action','claim 9007199254740993')
shell('input','swipe',1110,315,1110,315,800);wait('fixed-refund-confirm',lambda r:r.get('confirmation_visible'));shot('fixed-refund-confirm');confirm_action('fixed-refund-action','refund 9007199254740993')
tap(770,359);wait('fixed-owned-page',lambda r:r.get('ready') and r.get('mode')==1)
tap(1110,315);wait('fixed-cancel-confirm',lambda r:r.get('confirmation_visible'));confirm_action('fixed-cancel-action','cancel 9007199254740993')
tap(770,644);wait('fixed-withdraw-confirm',lambda r:r.get('confirmation_visible'));confirm_action('fixed-withdraw-action','withdraw')
shell('input','swipe',2155,470,1170,315,650);wait('fixed-list-price',lambda r:r.get('price_text') is not None);shot('fixed-list-price')
tap(1185,533);time.sleep(1.5);shell('input','text','2000000000000000');wait('fixed-list-typed',lambda r:r.get('price_text')=='2000000000000000');shot('fixed-list-typed')
shell('input','keyevent',66);wait('fixed-list-confirm',lambda r:r.get('confirmation_visible') and r.get('price_text') is None);shell('input','keyevent',4);time.sleep(.7);shot('fixed-list-confirm')
r=confirm_action('fixed-list-action','list 3 2000000000000000 30006 1');assert len(r['actions'])==6
(Q/'touch-commands.json').write_text(json.dumps(commands,indent=2))
(Q/'touch-result.json').write_text(json.dumps({'status':'PASS','icon_matches':168,'actions':r['actions'],'scope':'actual Android touch and controller requests, fake game session, actual C++ snapshot fixture, blocked economic transport; no real settlement'},indent=2))