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/test2.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'test/test2.py') diff --git a/test/test2.py b/test/test2.py index d690edbb..b4f3a5c8 100755 --- a/test/test2.py +++ b/test/test2.py @@ -3,26 +3,26 @@ # This test opens a password encrypted file and tries to unlock it. import os -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-encrypt.pdf') # Try an incorrect password first focus.application('atril') type('wrong password') -click('Unlock Document', roleName='push button') +click('Unlock Document', roleName=pushButton) focus.dialog('Enter password') -click('Cancel', roleName='push button') +click('Cancel', roleName=pushButton) # Try again with the correct password focus.frame('test-encrypt.pdf — Password Required') -click('Unlock Document', roleName='push button') +click('Unlock Document', roleName=pushButton) focus.dialog('Enter password') type('Foo') -click('Unlock Document', roleName='push button') +click('Unlock Document', roleName=pushButton) # Close atril focus.application('atril') -- cgit v1.2.1