merge-main-ui-host-compatibility
Core regression / Python core and release configuration (push) Successful in 16s
Core regression / JavaScript syntax (push) Successful in 3s
Core regression / Python core and release configuration (pull_request) Successful in 16s
Core regression / JavaScript syntax (pull_request) Successful in 3s
Core regression / Python core and release configuration (push) Successful in 16s
Core regression / JavaScript syntax (push) Successful in 3s
Core regression / Python core and release configuration (pull_request) Successful in 16s
Core regression / JavaScript syntax (pull_request) Successful in 3s
This commit is contained in:
commit
56588a9203
14 files changed
+621
-21
No files matched your search
@@ -31,6 +31,7 @@ def main():
|
||||
parser.add_argument('--output',type=Path,default=Path('build/acrylic-acceptance'))
|
||||
parser.add_argument('--webengine-roundtrip',action='store_true')
|
||||
parser.add_argument('--history',action='store_true')
|
||||
parser.add_argument('--dsh-switch',action='store_true',help='Measure live Acrylic after entering the actual DSH WebEngine page')
|
||||
args=parser.parse_args();out=args.output.resolve();out.mkdir(parents=True,exist_ok=True)
|
||||
app=QApplication([]);app.setFont(QFont('Microsoft YaHei UI',9))
|
||||
def settle(seconds=.2):
|
||||
@@ -83,6 +84,9 @@ def main():
|
||||
report['native_enabled']=True
|
||||
def capture(name):
|
||||
QCursor.setPos(window.mapToGlobal(QPoint(12,12)))
|
||||
report.setdefault('surfaces',{})[name]={
|
||||
'hwnd':int(window.winId()),'translucent':window.testAttribute(Qt.WidgetAttribute.WA_TranslucentBackground),
|
||||
'alpha':window.windowHandle().format().alphaBufferSize(),'acrylic':window.property('acrylicEnabled')}
|
||||
settle(.7)
|
||||
QToolTip.hideText();settle(.12)
|
||||
geo=window.geometry();scale=screen.devicePixelRatio()
|
||||
@@ -149,6 +153,40 @@ def main():
|
||||
(out/'roundtrip-probe.json').write_text(json.dumps(report,indent=2),encoding='utf8')
|
||||
assert report[f'roundtrip_{index}_sidebar_difference']>2,report
|
||||
assert report[f'roundtrip_{index}_table_difference']<1.5,report
|
||||
if args.dsh_switch:
|
||||
from PySide6.QtTest import QTest
|
||||
QTest.mouseClick(window.dsh_navigation,Qt.MouseButton.LeftButton)
|
||||
deadline=time.monotonic()+120
|
||||
while time.monotonic()<deadline:
|
||||
settle(.1)
|
||||
if window._dsh_view is not None and window._dsh_view._started:break
|
||||
assert window._dsh_view is not None and window._dsh_view._started,'DSH did not start'
|
||||
# READY precedes the Chromium load; require the real visible page.
|
||||
loaded=[]
|
||||
window._dsh_view.web.page().runJavaScript("document.body?.innerText?.includes('DSH助手')",loaded.append)
|
||||
deadline=time.monotonic()+60
|
||||
while time.monotonic()<deadline:
|
||||
settle(.1)
|
||||
if loaded and loaded[-1]:break
|
||||
if loaded:
|
||||
loaded.clear()
|
||||
window._dsh_view.web.page().runJavaScript("document.body?.innerText?.includes('DSH助手')",loaded.append)
|
||||
assert loaded and loaded[-1],'Official DSH UI did not load'
|
||||
capture('dsh-before-return')
|
||||
QTest.mouseClick(window.task_center_navigation,Qt.MouseButton.LeftButton)
|
||||
settle(.5)
|
||||
background.phase=0;background.update();capture('returned-backdrop-a')
|
||||
background.phase=1;background.update();capture('returned-backdrop-b')
|
||||
returned=ImageChops.difference(captures['returned-backdrop-a'],captures['returned-backdrop-b'])
|
||||
assert report['surfaces']['native-app-backdrop-a']['hwnd']==report['surfaces']['returned-backdrop-a']['hwnd'],report
|
||||
report['after_dsh_sidebar_difference']=mean(returned.crop(sidebar))
|
||||
report['after_dsh_header_difference']=mean(returned.crop(header))
|
||||
report['after_dsh_table_difference']=mean(returned.crop(table))
|
||||
(out/'surface-probe.json').write_text(json.dumps(report,indent=2),encoding='utf8')
|
||||
assert report['after_dsh_sidebar_difference']>2,report
|
||||
assert report['after_dsh_header_difference']>2,report
|
||||
assert report['after_dsh_table_difference']<1.5,report
|
||||
report['real_dsh_switch_restored_acrylic']=True
|
||||
window.plan_panel.find_text.setText('RV');window.plan_panel.find()
|
||||
report['visible_search_feedback']=window.plan_panel.find_result.isVisible()
|
||||
assert '2 / 6'in window.plan_panel.find_result.text()
|
||||
@@ -234,15 +272,21 @@ def main():
|
||||
modal.grab().save(str(out/'native-app-history-clear-confirm.png'))
|
||||
QTest.mouseClick(modal.button(QMessageBox.StandardButton.Yes),Qt.MouseButton.LeftButton)
|
||||
QTimer.singleShot(100,confirm_history)
|
||||
assert panel.clear_button.isEnabled(),{'status':panel.status.text(),'mutation_enabled':panel._mutations_enabled}
|
||||
panel.clear_button.click();wait_history()
|
||||
assert panel.table.rowCount()==0
|
||||
assert panel.table.rowCount()==0,{'status':panel.status.text(),'clear_success':panel._clear_success,
|
||||
'mutation_enabled':panel._mutations_enabled,'rows':panel.table.rowCount()}
|
||||
assert len(service.tasks())==2
|
||||
capture('native-app-history-cleared')
|
||||
report['history_search_clear_and_task_preservation']=True
|
||||
window.task_center_action.trigger();settle(.2)
|
||||
window.project_options_button.setChecked(True);settle(.2)
|
||||
report['options_exposed']=window.run_panel.copy_value_check.isVisible()
|
||||
window.plan_panel.discard_all();window.close();settle(.3);store.close();logging.shutdown()
|
||||
window.plan_panel.discard_all();window.close()
|
||||
deadline=time.monotonic()+15
|
||||
while window.isVisible() and time.monotonic()<deadline:settle(.1)
|
||||
assert not window.isVisible(),'Window did not finish shutdown'
|
||||
settle(.3);store.close();logging.shutdown()
|
||||
background.close();app.processEvents()
|
||||
(out/'acceptance.json').write_text(json.dumps(report,ensure_ascii=False,indent=2)+'\n',encoding='utf-8')
|
||||
print(json.dumps(report,ensure_ascii=True))
|
||||
|
||||
Reference in new issue
Block a user