16 lines
2.1 KiB
Python
16 lines
2.1 KiB
Python
"""Focused correction of premature Clear measurement; await actual interactive render."""
|
|
import json,sys
|
|
from pathlib import Path
|
|
from playwright.sync_api import sync_playwright
|
|
sys.path.insert(0,'/Users/dohertj2/.codex/worktrees/scada-ui-consistency/scadaproj/components/ui-theme/validation/theme-1.0.0/canary')
|
|
from browser_zoom import zoom_browser,set_browser_zoom
|
|
out=[]
|
|
with sync_playwright() as p:
|
|
with zoom_browser(p) as (context,worker):
|
|
for scheme in ['light','dark']:
|
|
for width,zoom in [(1440,1),(390,1),(1440,2)]:
|
|
page=context.new_page();page.set_viewport_size({'width':width,'height':1000});page.goto('http://127.0.0.1:5201/batch-two',wait_until='networkidle');page.evaluate('s=>window.sbTheme.set(s)',scheme);set_browser_zoom(worker,page,zoom)
|
|
page.locator('details[data-test=filter-more] summary').click();page.locator('#audit-actor').fill('synthetic-operator');page.locator('#audit-target').fill('synthetic-system');page.get_by_role('button',name='Apply',exact=True).click();page.locator('[data-test=filter-submitted-summary]').wait_for();page.get_by_role('button',name='Clear',exact=True).click();page.wait_for_function("document.querySelector('#audit-actor').value === ''");page.locator('[data-test=filter-pending]').wait_for()
|
|
record={'scheme':scheme,'requestedWidth':width,'zoom':zoom,'actor':page.locator('#audit-actor').input_value(),'target':page.locator('#audit-target').input_value(),'summary':page.locator('[data-test=filter-submitted-summary]').inner_text(),'pending':page.locator('[data-test=filter-pending]').inner_text(),'layout':page.evaluate('({width:innerWidth,document:document.documentElement.scrollWidth,dpr:devicePixelRatio})')};record['passed']=record['actor']=='' and record['target']=='' and 'Actor: synthetic-operator' in record['summary'] and 'Target: synthetic-system' in record['summary'] and 'Unsubmitted changes' in record['pending'];out.append(record);page.close()
|
|
Path('docs/ui-consistency/evidence/sb13-15/audit-clear-confirmation.json').write_text(json.dumps(out,indent=2));print({'cases':len(out),'passed':sum(r['passed'] for r in out)})
|