cthulhu/test/keystrokes/helpcontent/struct_nav_list.py
2024-12-18 10:05:44 -05:00

139 lines
6.4 KiB
Python

#!/usr/bin/env python3
#
# Copyright (c) 2024 Stormux
# Copyright (c) 2010-2012 The Orca Team
# Copyright (c) 2012 Igalia, S.L.
# Copyright (c) 2005-2010 Sun Microsystems Inc.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the
# Free Software Foundation, Inc., Franklin Street, Fifth Floor,
# Boston MA 02110-1301 USA.
#
# Fork of Orca Screen Reader (GNOME)
# Original source: https://gitlab.gnome.org/GNOME/orca
"""Test of learn mode."""
from macaroon.playback import *
import utils
sequence = MacroSequence()
sequence.append(KeyPressAction(0, None, "KP_Insert"))
sequence.append(TypeAction("h"))
sequence.append(KeyReleaseAction(0, None, "KP_Insert"))
sequence.append(KeyComboAction("F1"))
sequence.append(PauseAction(2000))
sequence.append(utils.StartRecordingAction())
sequence.append(KeyComboAction("k"))
sequence.append(utils.AssertPresentationAction(
"1. k for next link",
["BRAILLE LINE: ' Welcome to Cthulhu'",
" VISIBLE: ' Welcome to Cthulhu', cursor=2",
"BRAILLE LINE: ' Welcome to Cthulhu'",
" VISIBLE: ' Welcome to Cthulhu', cursor=2",
"SPEECH OUTPUT: 'Welcome to Cthulhu",
"Introducing the Cthulhu screen reader",
" link'"]))
sequence.append(KeyComboAction("Return"))
sequence.append(PauseAction(2000))
sequence.append(utils.StartRecordingAction())
sequence.append(KeyComboAction("l"))
sequence.append(utils.AssertPresentationAction(
"2. l for next list",
["BRAILLE LINE: 'List with 3 items'",
" VISIBLE: 'List with 3 items', cursor=0",
"BRAILLE LINE: ' The method for configuring Cthulhu to be launched automatically as your preferred screen reader will depend upon which desktop environment you use. For instance, in GNOME 3.x this option can be found in the Universal Access Control Center panel on the Seeing page.'",
" VISIBLE: ' The method for configuring Cthulhu', cursor=0",
"BRAILLE LINE: ' The method for configuring Cthulhu to be launched automatically as your preferred screen reader will depend upon which desktop environment you use. For instance, in GNOME 3.x this option can be found in the Universal Access Control Center panel on the Seeing page.'",
" VISIBLE: ' The method for configuring Cthulhu', cursor=0",
"SPEECH OUTPUT: 'List with 3 items'",
"SPEECH OUTPUT: '\u2022 The method for configuring Cthulhu to be launched automatically as '"]))
sequence.append(utils.StartRecordingAction())
sequence.append(KeyComboAction("l"))
sequence.append(utils.AssertPresentationAction(
"3. l for next list",
["BRAILLE LINE: 'List with 11 items'",
" VISIBLE: 'List with 11 items', cursor=0",
"BRAILLE LINE: ' -h, --help: Show the help message'",
" VISIBLE: ' -h, --help: Show the help messa', cursor=0",
"BRAILLE LINE: ' -h, --help: Show the help message'",
" VISIBLE: ' -h, --help: Show the help messa', cursor=0",
"SPEECH OUTPUT: 'List with 11 items'",
"SPEECH OUTPUT: '\u2022 -h, --help: Show the help message'"]))
sequence.append(utils.StartRecordingAction())
sequence.append(KeyComboAction("l"))
sequence.append(utils.AssertPresentationAction(
"4. l for next list",
["BRAILLE LINE: 'List with 3 items'",
" VISIBLE: 'List with 3 items', cursor=0",
"BRAILLE LINE: ' speech'",
" VISIBLE: ' speech', cursor=0",
"BRAILLE LINE: ' speech'",
" VISIBLE: ' speech', cursor=0",
"SPEECH OUTPUT: 'List with 3 items'",
"SPEECH OUTPUT: '\u25e6 speech'"]))
sequence.append(utils.StartRecordingAction())
sequence.append(KeyComboAction("<Shift>l"))
sequence.append(utils.AssertPresentationAction(
"5. shift+l for previous list",
["BRAILLE LINE: 'List with 3 items'",
" VISIBLE: 'List with 3 items', cursor=0",
"BRAILLE LINE: ' The method for configuring Cthulhu to be launched automatically as your preferred screen reader will depend upon which desktop environment you use. For instance, in GNOME 3.x this option can be found in the Universal Access Control Center panel on the Seeing page.'",
" VISIBLE: ' The method for configuring Cthulhu', cursor=0",
"BRAILLE LINE: ' The method for configuring Cthulhu to be launched automatically as your preferred screen reader will depend upon which desktop environment you use. For instance, in GNOME 3.x this option can be found in the Universal Access Control Center panel on the Seeing page.'",
" VISIBLE: ' The method for configuring Cthulhu', cursor=0",
"SPEECH OUTPUT: 'List with 3 items'",
"SPEECH OUTPUT: '\u2022 The method for configuring Cthulhu to be launched automatically as '"]))
sequence.append(utils.StartRecordingAction())
sequence.append(KeyComboAction("<Shift>l"))
sequence.append(utils.AssertPresentationAction(
"6. shift+l for previous list",
["BRAILLE LINE: 'Wrapping to bottom.'",
" VISIBLE: 'Wrapping to bottom.', cursor=0",
"BRAILLE LINE: 'List with 1 item'",
" VISIBLE: 'List with 1 item', cursor=0",
"BRAILLE LINE: ' Getting Started'",
" VISIBLE: ' Getting Started', cursor=0",
"BRAILLE LINE: ' Getting Started'",
" VISIBLE: ' Getting Started', cursor=0",
"SPEECH OUTPUT: 'Wrapping to bottom.'",
"SPEECH OUTPUT: 'List with 1 item'",
"SPEECH OUTPUT: 'Getting Started link'"]))
sequence.append(utils.StartRecordingAction())
sequence.append(KeyComboAction("<Shift>l"))
sequence.append(utils.AssertPresentationAction(
"7. shift+l for previous list",
["BRAILLE LINE: 'List with 3 items'",
" VISIBLE: 'List with 3 items', cursor=0",
"BRAILLE LINE: ' speech'",
" VISIBLE: ' speech', cursor=0",
"BRAILLE LINE: ' speech'",
" VISIBLE: ' speech', cursor=0",
"SPEECH OUTPUT: 'List with 3 items'",
"SPEECH OUTPUT: '\u25e6 speech'"]))
sequence.append(KeyComboAction("<Alt>F4"))
sequence.append(utils.AssertionSummaryAction())
sequence.start()