WIP: AX port and noatspi work

This commit is contained in:
Storm Dragon
2025-12-25 20:51:34 -05:00
parent 0a18de8e87
commit e134bf97d5
103 changed files with 12882 additions and 3556 deletions

View File

@@ -26,6 +26,9 @@
"""Test of check menu items in Java's SwingSet2.
"""
import gi
gi.require_version('Atspi', '2.0')
from gi.repository import Atspi
from macaroon.playback import *
import utils
@@ -35,18 +38,18 @@ sequence = MacroSequence()
# We wait for the demo to come up and for focus to be on the toggle button
#
#sequence.append(WaitForWindowActivate("SwingSet2",None))
sequence.append(WaitForFocus("", acc_role=pyatspi.ROLE_TOGGLE_BUTTON))
sequence.append(WaitForFocus("", acc_role=Atspi.Role.TOGGLE_BUTTON))
sequence.append(PauseAction(5000))
sequence.append(KeyComboAction("F10"))
sequence.append(WaitForFocus("File", acc_role=pyatspi.ROLE_MENU))
sequence.append(WaitForFocus("File", acc_role=Atspi.Role.MENU))
sequence.append(KeyComboAction("Right"))
sequence.append(WaitForFocus("Look & Feel", acc_role=pyatspi.ROLE_MENU))
sequence.append(WaitForFocus("Look & Feel", acc_role=Atspi.Role.MENU))
sequence.append(KeyComboAction("Right"))
sequence.append(WaitForFocus("Themes", acc_role=pyatspi.ROLE_MENU))
sequence.append(WaitForFocus("Themes", acc_role=Atspi.Role.MENU))
sequence.append(KeyComboAction("Right"))
sequence.append(WaitForFocus("Options", acc_role=pyatspi.ROLE_MENU))
sequence.append(WaitForFocus("Options", acc_role=Atspi.Role.MENU))
########################################################################
# Go Down to the Enable Tool Tips menu item
@@ -54,7 +57,7 @@ sequence.append(WaitForFocus("Options", acc_role=pyatspi.ROLE_MENU))
sequence.append(utils.StartRecordingAction())
sequence.append(KeyComboAction("Down"))
sequence.append(WaitForFocus("Enable Tool Tips",
acc_role=pyatspi.ROLE_CHECK_BOX))
acc_role=Atspi.Role.CHECK_BOX))
sequence.append(utils.AssertPresentationAction(
"Enable Tool Tips checked check menu item",
["BRAILLE LINE: 'SwingSet2 Application SwingSet2 Frame RootPane LayeredPane Swing demo menu bar MenuBar <x> Enable Tool Tips CheckBox'",
@@ -67,7 +70,7 @@ sequence.append(utils.AssertPresentationAction(
sequence.append(utils.StartRecordingAction())
sequence.append(KeyComboAction("Down"))
sequence.append(WaitForFocus("Enable Drag Support",
acc_role=pyatspi.ROLE_CHECK_BOX))
acc_role=Atspi.Role.CHECK_BOX))
sequence.append(utils.AssertPresentationAction(
"Enable Drag Support unchecked menu item",
["BRAILLE LINE: 'SwingSet2 Application SwingSet2 Frame RootPane LayeredPane Swing demo menu bar MenuBar < > Enable Drag Support CheckBox'",
@@ -93,18 +96,18 @@ sequence.append(utils.AssertPresentationAction(
#
sequence.append(TypeAction(" "))
sequence.append(WaitAction("object:state-changed:checked", None,
None, pyatspi.ROLE_CHECK_BOX, 5000))
None, Atspi.Role.CHECK_BOX, 5000))
########################################################################
# Go directly back to the checked menu item.
#
sequence.append(KeyComboAction("<Alt>p"))
sequence.append(WaitForFocus("", acc_role=pyatspi.ROLE_TOGGLE_BUTTON))
sequence.append(WaitForFocus("", acc_role=Atspi.Role.TOGGLE_BUTTON))
sequence.append(utils.StartRecordingAction())
sequence.append(KeyComboAction("Down"))
sequence.append(WaitForFocus("Enable Drag Support",
acc_role=pyatspi.ROLE_CHECK_BOX))
acc_role=Atspi.Role.CHECK_BOX))
sequence.append(utils.AssertPresentationAction(
"Enable Drag Support checked menu item",
["BRAILLE LINE: 'SwingSet2 Application SwingSet2 Frame RootPane LayeredPane Swing demo menu bar MenuBar <x> Enable Drag Support CheckBox'",