Skip to content

Commit 00c9d55

Browse files
authored
Merge 43288d3 into 86fe20f
2 parents 86fe20f + 43288d3 commit 00c9d55

5 files changed

Lines changed: 74 additions & 7 deletions

File tree

tests/system/libraries/NvdaLib.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,11 +114,12 @@ def _createTestIdFileName(name):
114114
return outputFileName
115115

116116
@staticmethod
117-
def setup_nvda_profile(configFileName):
117+
def setup_nvda_profile(configFileName, gesturesFileName: Optional[str] = None):
118118
configManager.setupProfile(
119119
_locations.repoRoot,
120120
configFileName,
121-
_locations.stagingDir
121+
_locations.stagingDir,
122+
gesturesFileName,
122123
)
123124

124125
@staticmethod
@@ -247,9 +248,9 @@ def start_NVDAInstaller(self, settingsFileName):
247248
self.nvdaSpy.wait_for_NVDA_startup_to_complete()
248249
return nvdaProcessHandle
249250

250-
def start_NVDA(self, settingsFileName):
251+
def start_NVDA(self, settingsFileName: str, gesturesFileName: Optional[str] = None):
251252
builtIn.log(f"Starting NVDA with config: {settingsFileName}")
252-
self.setup_nvda_profile(settingsFileName)
253+
self.setup_nvda_profile(settingsFileName, gesturesFileName)
253254
nvdaProcessHandle = self._startNVDAProcess()
254255
process.process_should_be_running(nvdaProcessHandle)
255256
self._connectToRemoteServer()

tests/system/libraries/SystemTestSpy/configManager.py

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
from os.path import join as _pJoin
1212
from .getLib import _getLib
1313
import sys
14-
14+
from typing import Optional
1515

1616
# Imported for type information
1717
from robot.libraries.BuiltIn import BuiltIn
@@ -91,13 +91,24 @@ def _copyPythonLibs(pythonImports, libsDest):
9191
opSys.copy_file(libSource, libsDest)
9292

9393

94-
def setupProfile(repoRoot: str, settingsFileName: str, stagingDir: str):
94+
def setupProfile(
95+
repoRoot: str,
96+
settingsFileName: str,
97+
stagingDir: str,
98+
gesturesFileName: Optional[str] = None,
99+
):
95100
builtIn.log("Copying files into NVDA profile", level='DEBUG')
96101
opSys.copy_file(
97102
# Despite duplication, specify full paths for clarity.
98103
_pJoin(repoRoot, "tests", "system", "nvdaSettingsFiles", settingsFileName),
99104
_pJoin(stagingDir, "nvdaProfile", "nvda.ini")
100105
)
106+
if gesturesFileName is not None:
107+
opSys.copy_file(
108+
# Despite duplication, specify full paths for clarity.
109+
_pJoin(repoRoot, "tests", "system", "nvdaSettingsFiles", gesturesFileName),
110+
_pJoin(stagingDir, "nvdaProfile", "gestures.ini")
111+
)
101112
# create a package to use as the globalPlugin
102113
_installSystemTestSpyToScratchPad(
103114
repoRoot,
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[browseMode.BrowseModeDocumentTreeInterceptor]
2+
activateAriaDetailsSummary = kb:nvda+\

tests/system/robot/chromeTests.py

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,55 @@ def checkbox_labelled_by_inner_element():
4848
)
4949

5050

51+
def test_aria_details():
52+
_chrome.prepareChrome(
53+
"""
54+
<div>
55+
<p>The word <mark aria-details="cat-details">cat</mark> has a comment tied to it.</p>
56+
<div id="cat-details" role="comment">
57+
Cats go woof BTW<br>&mdash;Jonathon Commentor
58+
<div role="comment">
59+
No they don't<br>&mdash;Zara
60+
</div>
61+
<div role="form">
62+
<textarea cols="80" placeholder="Add reply..."></textarea>
63+
<input type="submit">
64+
</div>
65+
</div>
66+
</div>
67+
"""
68+
)
69+
actualSpeech = _chrome.getSpeechAfterKey('downArrow')
70+
_asserts.strings_match(
71+
actualSpeech,
72+
"The word marked content cat out of marked content has a comment tied to it."
73+
)
74+
# this word has no details attached
75+
actualSpeech = _chrome.getSpeechAfterKey("control+rightArrow")
76+
_asserts.strings_match(
77+
actualSpeech,
78+
"word"
79+
)
80+
# check that there is no summary reported
81+
actualSpeech = _chrome.getSpeechAfterKey("NVDA+\\")
82+
_asserts.strings_match(
83+
actualSpeech,
84+
"No additional details"
85+
)
86+
# this word has details attached to it
87+
actualSpeech = _chrome.getSpeechAfterKey("control+rightArrow")
88+
_asserts.strings_match(
89+
actualSpeech,
90+
"marked content cat out of marked content"
91+
)
92+
# read the details summary
93+
actualSpeech = _chrome.getSpeechAfterKey("NVDA+\\")
94+
_asserts.strings_match(
95+
actualSpeech,
96+
"Cats go woof BTW —Jonathon Commentor No they don't —Zara"
97+
)
98+
99+
51100
def announce_list_item_when_moving_by_word_or_character():
52101
_chrome.prepareChrome(
53102
r"""

tests/system/robot/chromeTests.robot

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ default teardown
2323
quit NVDA
2424
2525
default setup
26-
start NVDA standard-dontShowWelcomeDialog.ini
26+
start NVDA standard-dontShowWelcomeDialog.ini chrome-gestures.ini
2727
Sleep 5s
2828
2929
*** Test Cases ***
@@ -51,6 +51,10 @@ ARIA checkbox
5151
[Documentation] Navigate to an unchecked checkbox in reading mode.
5252
[Tags] aria-at
5353
test_ariaCheckbox_browseMode
54+
ARIA details
55+
[Documentation] Ensure a summary of aria-details is read on command.
56+
[Tags] annotations
57+
test aria details
5458
i12147
5559
[Documentation] New focus target should be announced if the triggering element is removed when activated
5660
test_i12147

0 commit comments

Comments
 (0)