Skip to content

Commit 3e28f2c

Browse files
authored
Temporary fix for jaws double escape (#89)
* double parse speech strings on JAWS * add comment to issue
1 parent 97427a4 commit 3e28f2c

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/runner/driver-test-runner.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,8 +347,15 @@ export class DriverTestRunner {
347347
*/
348348
async _collectSpeech(debounceDelay, asyncOperation) {
349349
let spoken = [];
350+
const isJAWS = (await this.collectedCapabilities).atName == 'JAWS';
351+
350352
const speechJob = startJob(async signal => {
351-
for await (const speech of signal.cancelable(this.atDriver.speeches())) {
353+
for await (let speech of signal.cancelable(this.atDriver.speeches())) {
354+
if (isJAWS) {
355+
// temporary workaround to double-escaped string literals.
356+
// see https://github.com/w3c/aria-at-automation-harness/issues/90
357+
speech = JSON.parse(`"${speech}"`);
358+
}
352359
spoken.push(speech);
353360
this.log(RunnerMessage.SPEECH_EVENT, { spokenText: speech });
354361
}

0 commit comments

Comments
 (0)