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/test1.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'test/test1.py') diff --git a/test/test1.py b/test/test1.py index 97db085c..f485b3dd 100755 --- a/test/test1.py +++ b/test/test1.py @@ -2,27 +2,23 @@ # This test opens the interface and just clicks around a bit. -import os -import dogtail.config -dogtail.config.config.logDebugToStdOut = True -dogtail.config.config.logDebugToFile = False +from testCommon import pushButton from dogtail.procedural import * -os.environ['LANG']='C' run('atril') # Test file->open focus.application('atril') click('File', roleName='menu') click('Open…', roleName='menu item') -click('Cancel', roleName='push button') +click('Cancel', roleName=pushButton) # Toolbar editor focus.application('atril') click('Edit', roleName='menu') click('Toolbar', roleName='menu item') -click('Close', roleName='push button') +click('Close', roleName=pushButton) # About dialog focus.application('atril') @@ -30,7 +26,7 @@ click('Help', roleName='menu') click('About', roleName='menu item') click('Credits', roleName='toggle button') click('Credits', roleName='toggle button') -click('Close', roleName='push button') +click('Close', roleName=pushButton) # Close atril focus.application('atril') -- cgit v1.2.1