8884e100f9
Overlay 190 upstream items (V8.22→8.31) preserving trade-pro theme, registry tests, and design docs. Re-applied full patch set on identical anchors (discovery/env_for/blocks.css/type-mapping/locale-override/ theme_color/frontend entries/test_theme_pro_v3 mods) plus compose pins. Verified: theme suites 35/35; dual-baseline full run 415 passed vs pristine 386+29 ours, FAILED-set diff EMPTY (same 10 Windows env fails). Live: container 8.31.1-dev.1 healthy, hesupipe 192 entries intact, trade-pro build 203 pages 0 errors. Co-Authored-By: Claude Code <noreply@anthropic.com>
41 lines
2.1 KiB
Python
41 lines
2.1 KiB
Python
"""V8.24 isolated Chromium demo test; does NOT claim logged-in production E2E.
|
|
Run: python scripts/studio_nested_browser_v824.py
|
|
"""
|
|
from pathlib import Path
|
|
from playwright.sync_api import sync_playwright
|
|
ROOT=Path(__file__).resolve().parents[1]
|
|
HTML=ROOT/'examples/Studio_V8_24_深层嵌套可视化编辑器_交互演示.html'
|
|
|
|
|
|
def main():
|
|
with sync_playwright() as pl:
|
|
browser=pl.chromium.launch(executable_path='/usr/bin/chromium',headless=True,args=['--no-sandbox','--disable-dev-shm-usage'])
|
|
try:
|
|
page=browser.new_page(viewport={'width':1440,'height':920},device_scale_factor=1)
|
|
errors=[]
|
|
page.on('pageerror',lambda error:errors.append(str(error)))
|
|
page.set_content(HTML.read_text(encoding='utf-8'))
|
|
assert page.locator('.unit').count()==4
|
|
page.locator('.unit').filter(has_text='车辆选择').click()
|
|
assert '第二层组件' in page.locator('#selectedInfo').inner_text()
|
|
page.locator('#title').fill('ROX 01 海外交付')
|
|
assert page.locator('.unit h2').filter(has_text='ROX 01 海外交付').count()==1
|
|
page.get_by_role('button',name='复制组件',exact=True).click()
|
|
assert page.locator('.unit').count()==5
|
|
page.get_by_role('button',name='手机',exact=True).click()
|
|
assert 'phone' in page.locator('#page').get_attribute('class')
|
|
page.get_by_role('button',name='手机 2 列',exact=True).click()
|
|
assert '手机设置:2 列' in page.locator('#mobileStatus').inner_text()
|
|
page.get_by_role('button',name='保存草稿').click()
|
|
assert '演示草稿已保存' in page.locator('#status').inner_text()
|
|
page.get_by_role('button',name='电脑',exact=True).click()
|
|
out=ROOT/'reports/v824/studio-v824-demo.png';out.parent.mkdir(parents=True,exist_ok=True)
|
|
page.screenshot(path=str(out),full_page=True)
|
|
assert not errors,errors
|
|
print('PASS: Chromium set_content demo; select / edit / duplicate / responsive / save; 0 script errors')
|
|
finally:
|
|
browser.close()
|
|
|
|
|
|
if __name__=='__main__':main()
|