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

@@ -25,6 +25,9 @@
"""Test of radio buttons in Java's SwingSet2."""
import gi
gi.require_version('Atspi', '2.0')
from gi.repository import Atspi
from macaroon.playback import *
import utils
@@ -34,7 +37,7 @@ 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))
# Wait for entire window to get populated.
sequence.append(PauseAction(5000))
@@ -43,50 +46,50 @@ sequence.append(PauseAction(5000))
# Tab over to the button demo, and activate it.
#
sequence.append(KeyComboAction("Tab"))
sequence.append(WaitForFocus("", acc_role=pyatspi.ROLE_TOGGLE_BUTTON))
sequence.append(WaitForFocus("", acc_role=Atspi.Role.TOGGLE_BUTTON))
sequence.append(TypeAction(" "))
##########################################################################
# Tab all the way down to the button page tab.
#
sequence.append(KeyComboAction("Tab"))
sequence.append(WaitForFocus("", acc_role=pyatspi.ROLE_TOGGLE_BUTTON))
sequence.append(WaitForFocus("", acc_role=Atspi.Role.TOGGLE_BUTTON))
sequence.append(KeyComboAction("Tab"))
sequence.append(WaitForFocus("", acc_role=pyatspi.ROLE_TOGGLE_BUTTON))
sequence.append(WaitForFocus("", acc_role=Atspi.Role.TOGGLE_BUTTON))
sequence.append(KeyComboAction("Tab"))
sequence.append(WaitForFocus("", acc_role=pyatspi.ROLE_TOGGLE_BUTTON))
sequence.append(WaitForFocus("", acc_role=Atspi.Role.TOGGLE_BUTTON))
sequence.append(KeyComboAction("Tab"))
sequence.append(WaitForFocus("", acc_role=pyatspi.ROLE_TOGGLE_BUTTON))
sequence.append(WaitForFocus("", acc_role=Atspi.Role.TOGGLE_BUTTON))
sequence.append(KeyComboAction("Tab"))
sequence.append(WaitForFocus("", acc_role=pyatspi.ROLE_TOGGLE_BUTTON))
sequence.append(WaitForFocus("", acc_role=Atspi.Role.TOGGLE_BUTTON))
sequence.append(KeyComboAction("Tab"))
sequence.append(WaitForFocus("", acc_role=pyatspi.ROLE_TOGGLE_BUTTON))
sequence.append(WaitForFocus("", acc_role=Atspi.Role.TOGGLE_BUTTON))
sequence.append(KeyComboAction("Tab"))
sequence.append(WaitForFocus("", acc_role=pyatspi.ROLE_TOGGLE_BUTTON))
sequence.append(WaitForFocus("", acc_role=Atspi.Role.TOGGLE_BUTTON))
sequence.append(KeyComboAction("Tab"))
sequence.append(WaitForFocus("", acc_role=pyatspi.ROLE_TOGGLE_BUTTON))
sequence.append(WaitForFocus("", acc_role=Atspi.Role.TOGGLE_BUTTON))
sequence.append(KeyComboAction("Tab"))
sequence.append(WaitForFocus("", acc_role=pyatspi.ROLE_TOGGLE_BUTTON))
sequence.append(WaitForFocus("", acc_role=Atspi.Role.TOGGLE_BUTTON))
sequence.append(KeyComboAction("Tab"))
sequence.append(WaitForFocus("", acc_role=pyatspi.ROLE_TOGGLE_BUTTON))
sequence.append(WaitForFocus("", acc_role=Atspi.Role.TOGGLE_BUTTON))
sequence.append(KeyComboAction("Tab"))
sequence.append(WaitForFocus("", acc_role=pyatspi.ROLE_TOGGLE_BUTTON))
sequence.append(WaitForFocus("", acc_role=Atspi.Role.TOGGLE_BUTTON))
sequence.append(KeyComboAction("Tab"))
sequence.append(WaitForFocus("", acc_role=pyatspi.ROLE_TOGGLE_BUTTON))
sequence.append(WaitForFocus("", acc_role=Atspi.Role.TOGGLE_BUTTON))
sequence.append(KeyComboAction("Tab"))
sequence.append(WaitForFocus("", acc_role=pyatspi.ROLE_TOGGLE_BUTTON))
sequence.append(WaitForFocus("", acc_role=Atspi.Role.TOGGLE_BUTTON))
sequence.append(KeyComboAction("Tab"))
sequence.append(WaitForFocus("", acc_role=pyatspi.ROLE_TOGGLE_BUTTON))
sequence.append(WaitForFocus("", acc_role=Atspi.Role.TOGGLE_BUTTON))
sequence.append(KeyComboAction("Tab"))
sequence.append(WaitForFocus("Button Demo", acc_role=pyatspi.ROLE_PAGE_TAB))
sequence.append(WaitForFocus("Button Demo", acc_role=Atspi.Role.PAGE_TAB))
sequence.append(KeyComboAction("Tab"))
##########################################################################
# Select Check Boxes tab
#
sequence.append(WaitForFocus("Buttons", acc_role=pyatspi.ROLE_PAGE_TAB))
sequence.append(WaitForFocus("Buttons", acc_role=Atspi.Role.PAGE_TAB))
sequence.append(KeyComboAction("Right"))
sequence.append(WaitForFocus("Radio Buttons", acc_role=pyatspi.ROLE_PAGE_TAB))
sequence.append(WaitForFocus("Radio Buttons", acc_role=Atspi.Role.PAGE_TAB))
sequence.append(PauseAction(5000))
##########################################################################
@@ -94,7 +97,7 @@ sequence.append(PauseAction(5000))
#
sequence.append(utils.StartRecordingAction())
sequence.append(KeyComboAction("Tab"))
sequence.append(WaitForFocus("Radio One ", acc_role=pyatspi.ROLE_RADIO_BUTTON))
sequence.append(WaitForFocus("Radio One ", acc_role=Atspi.Role.RADIO_BUTTON))
sequence.append(utils.AssertPresentationAction(
"1. Move to Radio One radio button",
["BRAILLE LINE: 'SwingSet2 Application SwingSet2 Frame RootPane LayeredPane Button Demo TabList Button Demo Page Radio Buttons TabList Radio Buttons Page Text Radio Buttons Panel Text Radio Buttons & y Radio One RadioButton'",
@@ -111,7 +114,7 @@ sequence.append(utils.AssertPresentationAction(
sequence.append(utils.StartRecordingAction())
sequence.append(TypeAction(" "))
sequence.append(WaitAction("object:property-change:accessible-value", None,
None, pyatspi.ROLE_RADIO_BUTTON, 5000))
None, Atspi.Role.RADIO_BUTTON, 5000))
sequence.append(utils.AssertPresentationAction(
"2. Select the focused radio button",
["BRAILLE LINE: 'SwingSet2 Application SwingSet2 Frame RootPane LayeredPane Button Demo TabList Button Demo Page Radio Buttons TabList Radio Buttons Page Text Radio Buttons Panel Text Radio Buttons &=y Radio One RadioButton'",
@@ -123,7 +126,7 @@ sequence.append(utils.AssertPresentationAction(
#
sequence.append(utils.StartRecordingAction())
sequence.append(KeyComboAction("Tab"))
sequence.append(WaitForFocus("Radio Two", acc_role=pyatspi.ROLE_RADIO_BUTTON))
sequence.append(WaitForFocus("Radio Two", acc_role=Atspi.Role.RADIO_BUTTON))
sequence.append(utils.AssertPresentationAction(
"3. Move to Radio Two radio button",
["BRAILLE LINE: 'SwingSet2 Application SwingSet2 Frame RootPane LayeredPane Button Demo TabList Button Demo Page Radio Buttons TabList Radio Buttons Page Text Radio Buttons Panel Text Radio Buttons & y Radio Two RadioButton'",
@@ -136,7 +139,7 @@ sequence.append(utils.AssertPresentationAction(
sequence.append(utils.StartRecordingAction())
sequence.append(TypeAction(" "))
sequence.append(WaitAction("object:property-change:accessible-value", None,
None, pyatspi.ROLE_RADIO_BUTTON, 5000))
None, Atspi.Role.RADIO_BUTTON, 5000))
sequence.append(utils.AssertPresentationAction(
"4. Select the focused radio button",
["BRAILLE LINE: 'SwingSet2 Application SwingSet2 Frame RootPane LayeredPane Button Demo TabList Button Demo Page Radio Buttons TabList Radio Buttons Page Text Radio Buttons Panel Text Radio Buttons &=y Radio Two RadioButton'",
@@ -148,7 +151,7 @@ sequence.append(utils.AssertPresentationAction(
#
sequence.append(utils.StartRecordingAction())
sequence.append(KeyComboAction("Tab"))
sequence.append(WaitForFocus("Radio Three", acc_role=pyatspi.ROLE_RADIO_BUTTON))
sequence.append(WaitForFocus("Radio Three", acc_role=Atspi.Role.RADIO_BUTTON))
sequence.append(utils.AssertPresentationAction(
"5. Move to Radio Three radio button",
["BRAILLE LINE: 'SwingSet2 Application SwingSet2 Frame RootPane LayeredPane Button Demo TabList Button Demo Page Radio Buttons TabList Radio Buttons Page Text Radio Buttons Panel Text Radio Buttons & y Radio Three RadioButton'",
@@ -161,7 +164,7 @@ sequence.append(utils.AssertPresentationAction(
sequence.append(utils.StartRecordingAction())
sequence.append(TypeAction(" "))
sequence.append(WaitAction("object:property-change:accessible-value", None,
None, pyatspi.ROLE_RADIO_BUTTON, 5000))
None, Atspi.Role.RADIO_BUTTON, 5000))
sequence.append(utils.AssertPresentationAction(
"6. Select the focused radio button",
["BRAILLE LINE: 'SwingSet2 Application SwingSet2 Frame RootPane LayeredPane Button Demo TabList Button Demo Page Radio Buttons TabList Radio Buttons Page Text Radio Buttons Panel Text Radio Buttons &=y Radio Three RadioButton'",
@@ -173,7 +176,7 @@ sequence.append(utils.AssertPresentationAction(
#
sequence.append(utils.StartRecordingAction())
sequence.append(KeyComboAction("Tab"))
sequence.append(WaitForFocus("Radio One ", acc_role=pyatspi.ROLE_RADIO_BUTTON))
sequence.append(WaitForFocus("Radio One ", acc_role=Atspi.Role.RADIO_BUTTON))
sequence.append(utils.AssertPresentationAction(
"7. Move to Radio One radio button",
["BRAILLE LINE: 'SwingSet2 Application SwingSet2 Frame RootPane LayeredPane Button Demo TabList Button Demo Page Radio Buttons TabList Radio Buttons Page Image Radio Buttons Panel Image Radio Buttons & y Radio One RadioButton'",
@@ -198,7 +201,7 @@ sequence.append(utils.AssertPresentationAction(
sequence.append(utils.StartRecordingAction())
sequence.append(TypeAction(" "))
sequence.append(WaitAction("object:property-change:accessible-value", None,
None, pyatspi.ROLE_RADIO_BUTTON, 5000))
None, Atspi.Role.RADIO_BUTTON, 5000))
sequence.append(utils.AssertPresentationAction(
"9. Select the focused radio button",
["BRAILLE LINE: 'SwingSet2 Application SwingSet2 Frame RootPane LayeredPane Button Demo TabList Button Demo Page Radio Buttons TabList Radio Buttons Page Image Radio Buttons Panel Image Radio Buttons &=y Radio One RadioButton'",
@@ -222,7 +225,7 @@ sequence.append(utils.AssertPresentationAction(
#
sequence.append(utils.StartRecordingAction())
sequence.append(KeyComboAction("Tab"))
sequence.append(WaitForFocus("Radio Two", acc_role=pyatspi.ROLE_RADIO_BUTTON))
sequence.append(WaitForFocus("Radio Two", acc_role=Atspi.Role.RADIO_BUTTON))
sequence.append(utils.AssertPresentationAction(
"11. Move to Radio Two radio button",
["BRAILLE LINE: 'SwingSet2 Application SwingSet2 Frame RootPane LayeredPane Button Demo TabList Button Demo Page Radio Buttons TabList Radio Buttons Page Image Radio Buttons Panel Image Radio Buttons & y Radio Two RadioButton'",
@@ -247,7 +250,7 @@ sequence.append(utils.AssertPresentationAction(
sequence.append(utils.StartRecordingAction())
sequence.append(TypeAction(" "))
sequence.append(WaitAction("object:property-change:accessible-value", None,
None, pyatspi.ROLE_RADIO_BUTTON, 5000))
None, Atspi.Role.RADIO_BUTTON, 5000))
sequence.append(utils.AssertPresentationAction(
"13. Select the focused radio button",
["BRAILLE LINE: 'SwingSet2 Application SwingSet2 Frame RootPane LayeredPane Button Demo TabList Button Demo Page Radio Buttons TabList Radio Buttons Page Image Radio Buttons Panel Image Radio Buttons &=y Radio Two RadioButton'",
@@ -271,7 +274,7 @@ sequence.append(utils.AssertPresentationAction(
#
sequence.append(utils.StartRecordingAction())
sequence.append(KeyComboAction("Tab"))
sequence.append(WaitForFocus("Radio Three", acc_role=pyatspi.ROLE_RADIO_BUTTON))
sequence.append(WaitForFocus("Radio Three", acc_role=Atspi.Role.RADIO_BUTTON))
sequence.append(utils.AssertPresentationAction(
"15. Move to Radio Three radio button",
["BRAILLE LINE: 'SwingSet2 Application SwingSet2 Frame RootPane LayeredPane Button Demo TabList Button Demo Page Radio Buttons TabList Radio Buttons Page Image Radio Buttons Panel Image Radio Buttons & y Radio Three RadioButton'",
@@ -284,7 +287,7 @@ sequence.append(utils.AssertPresentationAction(
sequence.append(utils.StartRecordingAction())
sequence.append(TypeAction(" "))
sequence.append(WaitAction("object:property-change:accessible-value", None,
None, pyatspi.ROLE_RADIO_BUTTON, 5000))
None, Atspi.Role.RADIO_BUTTON, 5000))
sequence.append(utils.AssertPresentationAction(
"16. Select the focused radio button",
["BRAILLE LINE: 'SwingSet2 Application SwingSet2 Frame RootPane LayeredPane Button Demo TabList Button Demo Page Radio Buttons TabList Radio Buttons Page Image Radio Buttons Panel Image Radio Buttons &=y Radio Three RadioButton'",
@@ -293,21 +296,21 @@ sequence.append(utils.AssertPresentationAction(
# Tab back up to beginning
sequence.append(KeyComboAction("Tab"))
sequence.append(WaitForFocus("Paint Border", acc_role=pyatspi.ROLE_CHECK_BOX))
sequence.append(WaitForFocus("Paint Border", acc_role=Atspi.Role.CHECK_BOX))
sequence.append(KeyComboAction("Tab"))
sequence.append(WaitForFocus("Paint Focus", acc_role=pyatspi.ROLE_CHECK_BOX))
sequence.append(WaitForFocus("Paint Focus", acc_role=Atspi.Role.CHECK_BOX))
sequence.append(KeyComboAction("Tab"))
sequence.append(WaitForFocus("Enabled", acc_role=pyatspi.ROLE_CHECK_BOX))
sequence.append(WaitForFocus("Enabled", acc_role=Atspi.Role.CHECK_BOX))
sequence.append(KeyComboAction("Tab"))
sequence.append(WaitForFocus("Content Filled", acc_role=pyatspi.ROLE_CHECK_BOX))
sequence.append(WaitForFocus("Content Filled", acc_role=Atspi.Role.CHECK_BOX))
sequence.append(KeyComboAction("Tab"))
sequence.append(WaitForFocus("Default", acc_role=pyatspi.ROLE_RADIO_BUTTON))
sequence.append(WaitForFocus("Default", acc_role=Atspi.Role.RADIO_BUTTON))
sequence.append(KeyComboAction("Tab"))
sequence.append(WaitForFocus("0", acc_role=pyatspi.ROLE_RADIO_BUTTON))
sequence.append(WaitForFocus("0", acc_role=Atspi.Role.RADIO_BUTTON))
sequence.append(KeyComboAction("Tab"))
sequence.append(WaitForFocus("10", acc_role=pyatspi.ROLE_RADIO_BUTTON))
sequence.append(WaitForFocus("10", acc_role=Atspi.Role.RADIO_BUTTON))
sequence.append(KeyComboAction("Tab"))
sequence.append(WaitForFocus("", acc_role=pyatspi.ROLE_TEXT))
sequence.append(WaitForFocus("", acc_role=Atspi.Role.TEXT))
sequence.append(KeyComboAction("Tab"))
# Toggle the top left button, to return to normal state.