180 lines
6.4 KiB
Python
180 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 icon output."""
|
|
|
|
from macaroon.playback import *
|
|
import utils
|
|
|
|
sequence = MacroSequence()
|
|
|
|
sequence.append(KeyComboAction("<Control>f"))
|
|
sequence.append(TypeAction("Images"))
|
|
sequence.append(KeyComboAction("Escape"))
|
|
sequence.append(KeyComboAction("Up"))
|
|
sequence.append(KeyComboAction("<Shift>Right"))
|
|
sequence.append(KeyComboAction("Down"))
|
|
sequence.append(KeyComboAction("Return"))
|
|
sequence.append(PauseAction(3000))
|
|
|
|
sequence.append(utils.StartRecordingAction())
|
|
sequence.append(KeyComboAction("Down"))
|
|
sequence.append(utils.AssertPresentationAction(
|
|
"1. bin icon",
|
|
["BRAILLE LINE: 'gtk3-demo application Icon View Basics frame layered pane bin icon'",
|
|
" VISIBLE: 'bin icon', cursor=1",
|
|
"SPEECH OUTPUT: 'bin icon.'"]))
|
|
|
|
sequence.append(utils.StartRecordingAction())
|
|
sequence.append(KeyComboAction("KP_8"))
|
|
sequence.append(utils.AssertPresentationAction(
|
|
"2. Review current line",
|
|
["BRAILLE LINE: 'bin boot dev $l'",
|
|
" VISIBLE: 'bin boot dev $l', cursor=1",
|
|
"SPEECH OUTPUT: 'bin boot dev'"]))
|
|
|
|
sequence.append(utils.StartRecordingAction())
|
|
sequence.append(KeyComboAction("KP_5"))
|
|
sequence.append(utils.AssertPresentationAction(
|
|
"3. Review current word",
|
|
["BRAILLE LINE: 'bin boot dev $l'",
|
|
" VISIBLE: 'bin boot dev $l', cursor=1",
|
|
"SPEECH OUTPUT: 'bin'"]))
|
|
|
|
sequence.append(utils.StartRecordingAction())
|
|
sequence.append(KeyComboAction("KP_6"))
|
|
sequence.append(utils.AssertPresentationAction(
|
|
"4. Review next word",
|
|
["BRAILLE LINE: 'bin boot dev $l'",
|
|
" VISIBLE: 'bin boot dev $l', cursor=5",
|
|
"SPEECH OUTPUT: 'boot'"]))
|
|
|
|
sequence.append(utils.StartRecordingAction())
|
|
sequence.append(KeyComboAction("KP_2"))
|
|
sequence.append(utils.AssertPresentationAction(
|
|
"5. Review current char",
|
|
["BRAILLE LINE: 'bin boot dev $l'",
|
|
" VISIBLE: 'bin boot dev $l', cursor=5",
|
|
"SPEECH OUTPUT: 'boot'"]))
|
|
|
|
sequence.append(utils.StartRecordingAction())
|
|
sequence.append(KeyPressAction(0, None, "KP_Insert"))
|
|
sequence.append(KeyComboAction("KP_6"))
|
|
sequence.append(KeyReleaseAction(0, None, "KP_Insert"))
|
|
sequence.append(utils.AssertPresentationAction(
|
|
"6. Review item below",
|
|
["BRAILLE LINE: 'etc home lib $l'",
|
|
" VISIBLE: 'etc home lib $l', cursor=5",
|
|
"SPEECH OUTPUT: 'home'"]))
|
|
|
|
sequence.append(PauseAction(3000))
|
|
|
|
sequence.append(utils.StartRecordingAction())
|
|
sequence.append(KeyPressAction(0, None, "KP_Insert"))
|
|
sequence.append(KeyComboAction("KP_6"))
|
|
sequence.append(KeyReleaseAction(0, None, "KP_Insert"))
|
|
sequence.append(utils.AssertPresentationAction(
|
|
"7. Review item below",
|
|
["BRAILLE LINE: 'lib64 lost+found media $l'",
|
|
" VISIBLE: 'lib64 lost+found media $l', cursor=7",
|
|
"SPEECH OUTPUT: 'lost+found'"]))
|
|
|
|
sequence.append(utils.StartRecordingAction())
|
|
sequence.append(KeyPressAction(0, None, "KP_Insert"))
|
|
sequence.append(KeyComboAction("KP_4"))
|
|
sequence.append(KeyReleaseAction(0, None, "KP_Insert"))
|
|
sequence.append(utils.AssertPresentationAction(
|
|
"8. Review item above",
|
|
["BRAILLE LINE: 'etc home lib $l'",
|
|
" VISIBLE: 'etc home lib $l', cursor=5",
|
|
"SPEECH OUTPUT: 'home'"]))
|
|
|
|
sequence.append(utils.StartRecordingAction())
|
|
sequence.append(KeyPressAction(0, None, "KP_Insert"))
|
|
sequence.append(KeyComboAction("KP_4"))
|
|
sequence.append(KeyReleaseAction(0, None, "KP_Insert"))
|
|
sequence.append(utils.AssertPresentationAction(
|
|
"9. Review item above",
|
|
["BRAILLE LINE: 'bin boot dev $l'",
|
|
" VISIBLE: 'bin boot dev $l', cursor=5",
|
|
"SPEECH OUTPUT: 'boot'"]))
|
|
|
|
sequence.append(utils.StartRecordingAction())
|
|
sequence.append(KeyComboAction("KP_9"))
|
|
sequence.append(utils.AssertPresentationAction(
|
|
"10. Review next line",
|
|
["BRAILLE LINE: 'etc home lib $l'",
|
|
" VISIBLE: 'etc home lib $l', cursor=1",
|
|
"SPEECH OUTPUT: 'etc home lib'"]))
|
|
|
|
sequence.append(utils.StartRecordingAction())
|
|
sequence.append(KeyComboAction("KP_6"))
|
|
sequence.append(utils.AssertPresentationAction(
|
|
"11. Review next word",
|
|
["BRAILLE LINE: 'etc home lib $l'",
|
|
" VISIBLE: 'etc home lib $l', cursor=5",
|
|
"SPEECH OUTPUT: 'home'"]))
|
|
|
|
sequence.append(utils.StartRecordingAction())
|
|
sequence.append(KeyComboAction("KP_3"))
|
|
sequence.append(utils.AssertPresentationAction(
|
|
"12. Review next char",
|
|
["BRAILLE LINE: 'etc home lib $l'",
|
|
" VISIBLE: 'etc home lib $l', cursor=10",
|
|
"SPEECH OUTPUT: 'lib'"]))
|
|
|
|
sequence.append(utils.StartRecordingAction())
|
|
sequence.append(KeyComboAction("KP_7"))
|
|
sequence.append(utils.AssertPresentationAction(
|
|
"13. Review previous line",
|
|
["BRAILLE LINE: 'bin boot dev $l'",
|
|
" VISIBLE: 'bin boot dev $l', cursor=1",
|
|
"SPEECH OUTPUT: 'bin boot dev'"]))
|
|
|
|
sequence.append(utils.StartRecordingAction())
|
|
sequence.append(KeyComboAction("KP_7"))
|
|
sequence.append(utils.AssertPresentationAction(
|
|
"14. Review previous line",
|
|
["BRAILLE LINE: 'vertical scroll bar 0% $l'",
|
|
" VISIBLE: 'vertical scroll bar 0% $l', cursor=1",
|
|
"SPEECH OUTPUT: 'vertical scroll bar 0 percent.'"]))
|
|
|
|
sequence.append(utils.StartRecordingAction())
|
|
sequence.append(KeyComboAction("KP_7"))
|
|
sequence.append(utils.AssertPresentationAction(
|
|
"15. Review previous line",
|
|
["BRAILLE LINE: 'Up Home $l'",
|
|
" VISIBLE: 'Up Home $l', cursor=1",
|
|
"SPEECH OUTPUT: 'Up Home'"]))
|
|
|
|
sequence.append(utils.StartRecordingAction())
|
|
sequence.append(KeyComboAction("KP_7"))
|
|
sequence.append(utils.AssertPresentationAction(
|
|
"16. Review previous line",
|
|
[""]))
|
|
|
|
sequence.append(utils.AssertionSummaryAction())
|
|
sequence.start()
|