Files
mxaccessgw/docs/ui-validation/fault_identity.py
T
Joseph Doherty 26a90883fa
ci / java (push) Failing after 15m11s
ci / nightly-windev (push) Failing after 10m18s
ci / portable (push) Failing after 27m42s
ci / windows-x86 (push) Failing after 22m19s
Unify gateway styling and preserve identity through recovery
2026-11-13 20:12:00 -05:00

11 lines
1.5 KiB
Python

import json,re,sys
from pathlib import Path
from playwright.sync_api import sync_playwright,expect
ROOT=Path(__file__).resolve().parent;BASE=re.search(r'Now listening on: (http://127.0.0.1:\d+)',Path('/tmp/mx-ui-final-host.log').read_text()).group(1);OUT=ROOT/'evidence/mx-fault-identity';OUT.mkdir(exist_ok=True);rows=[]
with sync_playwright() as p:
b=p.chromium.launch(channel='chromium',headless=True);page=b.new_page()
for mode in ['compact','table']:
page.goto(BASE+'/fault-identity-fixture');page.wait_for_selector('html[data-mx-ready="true"]');page.evaluate('Promise.all(document.getAnimations().map(a=>a.finished.catch(()=>{})))');container=page.locator('[data-fault-mode='+mode+']');row=container.locator('article' if mode=='compact' else 'tbody tr').filter(has=page.locator('a[href="sessions/session-a"]'));detail=row.locator('details');detail.locator('summary').click();pre=detail.locator('pre');page.get_by_role('button',name='Arm synthetic next snapshot').click();pre.focus();handle=pre.element_handle();expect(page.get_by_role('status')).to_have_text('Snapshot 1');rows.append({'mode':mode,'aStillOpen':detail.get_attribute('open') is not None,'focusedDiagnosticStillSessionA':handle.evaluate('e=>document.activeElement===e && e.closest("article,tr").querySelector("a").getAttribute("href")==="sessions/session-a"'),'originalElementStillConnected':handle.evaluate('e=>e.isConnected')})
b.close()
(OUT/(sys.argv[1]+'.json')).write_text(json.dumps(rows,indent=2));print(json.dumps(rows));assert all(r['aStillOpen'] and r['focusedDiagnosticStillSessionA'] for r in rows)