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/testEncryptedFile.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'test/testEncryptedFile.py') diff --git a/test/testEncryptedFile.py b/test/testEncryptedFile.py index 83c48a60..808efac4 100755 --- a/test/testEncryptedFile.py +++ b/test/testEncryptedFile.py @@ -2,7 +2,7 @@ # Test opening a password encrypted file and unlocking it. -from testCommon import run_app, bail +from testCommon import run_app, bail, pushButton from dogtail.procedural import * @@ -13,16 +13,16 @@ try: # Try an incorrect password first focus.dialog('Enter password') 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) type('Foo') focus.dialog('Enter password') - click('Unlock Document', roleName='push button') + click('Unlock Document', roleName=pushButton) # Close Atril focus.frame('test-encrypt.pdf — Dokument1') -- cgit v1.2.1