1515
1616# Imported for type information
1717from robot .libraries .Process import Process as _ProcessLib
18+ from robot .utils .asserts import assert_true , assert_false
1819
1920from AssertsLib import AssertsLib as _AssertsLib
2021
2122import os
2223from typing import Optional
2324import NvdaLib as _nvdaLib
2425from NvdaLib import NvdaLib as _nvdaRobotLib
26+ from tests .system .libraries .SystemTestSpy .windows import GetVisibleWindowTitles
2527_nvdaProcessAlias = _nvdaRobotLib .nvdaProcessAlias
2628
2729_builtIn : BuiltIn = BuiltIn ()
@@ -38,7 +40,7 @@ def navigate_to_settings(settingsName):
3840 spy .emulateKeyPress ("leftWindows+upArrow" ) # maximise
3941 spy .wait_for_speech_to_finish ()
4042
41- # naviagte to setting
43+ # navigate to setting
4244 for letter in settingsName .lower ():
4345 spy .emulateKeyPress (letter )
4446
@@ -70,3 +72,58 @@ def read_settings(settingsName, cacheFolder, currentVersion, compareVersion: Opt
7072 compareText = f .read ()
7173
7274 _asserts .strings_match (compareText , actualSpeech )
75+
76+
77+ def open_general_to_braille_then_speech ():
78+ spy = _nvdaLib .getSpyLib ()
79+ # open the general settings dialog
80+ spy .emulateKeyPress ("nvda+control+g" )
81+ # navigate to the panel selection
82+ spy .emulateKeyPress ("shift+tab" )
83+ # open the braille settings dialog
84+ spy .emulateKeyPress ("b" )
85+
86+ # enter the panel
87+ spy .wait_for_speech_to_finish ()
88+ spy .emulateKeyPress ("tab" )
89+ # open the braille driver dialog
90+ spy .emulateKeyPress ("alt+h" )
91+
92+ # change window focus to desktop
93+ spy .emulateKeyPress ("windows+d" )
94+
95+ # open the speech settings dialog
96+ spy .emulateKeyPress ("nvda+control+v" )
97+ spy .wait_for_speech_to_finish ()
98+
99+ windowsTitles = GetVisibleWindowTitles ()
100+ errMsg = f'open windows titles: { "," .join (windowsTitles )} '
101+ assert_true ("NVDA Settings: Braille (normal configuration)" in windowsTitles , msg = errMsg )
102+ assert_true ("Select Braille Display" in windowsTitles , msg = errMsg )
103+ assert_true ("NVDA Settings: Speech (normal configuration)" in windowsTitles , msg = errMsg )
104+
105+
106+ def open_braille_then_speech ():
107+ spy = _nvdaLib .getSpyLib ()
108+ # open the braille settings dialog directly
109+ # using gesture defined in settings-gestures.ini
110+ spy .emulateKeyPress ("control+/" )
111+
112+ # enter the panel
113+ spy .wait_for_speech_to_finish ()
114+ spy .emulateKeyPress ("tab" )
115+ # open the braille driver dialog
116+ spy .emulateKeyPress ("alt+h" )
117+
118+ # change window focus to desktop
119+ spy .emulateKeyPress ("windows+d" )
120+
121+ # open the speech settings dialog
122+ spy .emulateKeyPress ("nvda+control+v" )
123+ spy .wait_for_speech_to_finish ()
124+
125+ windowsTitles = GetVisibleWindowTitles ()
126+ errMsg = f'open windows titles: { "," .join (windowsTitles )} '
127+ assert_true ("NVDA Settings: Braille (normal configuration)" in windowsTitles , msg = errMsg )
128+ assert_true ("Select Braille Display" in windowsTitles , msg = errMsg )
129+ assert_false ("NVDA Settings: Speech (normal configuration)" in windowsTitles , msg = errMsg )
0 commit comments