From b6a19c50b04b7800f54a3bfef7271fedb1a9d50c Mon Sep 17 00:00:00 2001 From: Colomban Wendling Date: Wed, 14 May 2025 23:58:39 +0200 Subject: Fix tests with AT-SPI2 >= 2.53 Role name for push buttons changed from "push button" to "button" for uniformizing APIs, but that means the names Dogtail use have to match, as it's not using the role IDs but names. Fix this by trying to ask AT-SPI2 for the name, and falling back on the historical name in the odd case it'd fail. --- test/test7.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'test/test7.py') diff --git a/test/test7.py b/test/test7.py index 03792c6c..f0b71582 100755 --- a/test/test7.py +++ b/test/test7.py @@ -3,16 +3,12 @@ # Test printing import os -import dogtail.config -import time -dogtail.config.config.logDebugToStdOut = True -dogtail.config.config.logDebugToFile = False - -os.environ['LANG']='C' -srcdir = os.environ['srcdir'] +from testCommon import pushButton from dogtail.procedural import * +srcdir = os.environ['srcdir'] + run('atril', arguments=' '+srcdir+'/test-page-labels.pdf') focus.application('atril') @@ -27,7 +23,7 @@ focus.dialog('Print') click('Page Setup', roleName='page tab', raw=True) click('All sheets') click('Odd sheets', roleName='menu item') -click('Preview', roleName='push button') +click('Preview', roleName=pushButton) keyCombo('') # Close atril -- cgit v1.2.1