summaryrefslogtreecommitdiff
path: root/test/testCommon.py
diff options
context:
space:
mode:
authorColomban Wendling <[email protected]>2025-05-14 23:58:39 +0200
committerVictor Kareh <[email protected]>2026-02-13 09:29:25 -0500
commit481968b14fb7082a5233a47173c462f179811cde (patch)
treed6d0d98bec89393d34553696c92f3864db43a907 /test/testCommon.py
parent56853727df29fe2918ebec89eae5b38cda98c5d0 (diff)
downloadatril-481968b14fb7082a5233a47173c462f179811cde.tar.bz2
atril-481968b14fb7082a5233a47173c462f179811cde.tar.xz
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.
Diffstat (limited to 'test/testCommon.py')
-rw-r--r--test/testCommon.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/testCommon.py b/test/testCommon.py
index dd6ec51a..c4aa3a0e 100644
--- a/test/testCommon.py
+++ b/test/testCommon.py
@@ -6,6 +6,16 @@ import signal
os.environ['LANG'] = 'C'
+# try and figure out the role name for push buttons, which changed in ATSPI 2.53
+try:
+ import gi
+ gi.require_version('Atspi', '2.0')
+ from gi.repository import Atspi
+
+ pushButton = Atspi.role_get_name(Atspi.Role.PUSH_BUTTON)
+except ImportError:
+ pushButton = 'push button'
+
from dogtail.config import config
config.logDebugToStdOut = True
config.logDebugToFile = False