From 4f7a52134c0f87a1ef08838f8700eb2f7717ffcc Mon Sep 17 00:00:00 2001 From: Nicolas Merget Date: Wed, 24 Apr 2024 15:22:34 +0200 Subject: [PATCH] test: screen-reader --- .../DBButton-should-not-have-icon-in-screen-reader.txt | 1 + .../chromium/DBInput-should-have-message-and-label.txt | 1 + .../macos/chromium/DBRadio-should-label-duplicated.txt | 1 + .../DBButton-should-not-have-icon-in-screen-reader.txt | 1 + .../firefox/DBInput-should-have-message-and-label.txt | 1 + .../macos/firefox/DBRadio-should-label-duplicated.txt | 1 + .../DBButton-should-not-have-icon-in-screen-reader.txt | 1 + .../firefox/DBInput-should-have-message-and-label.txt | 1 + .../windows/firefox/DBRadio-should-label-duplicated.txt | 1 + screen-reader-test/screen-reader/default.ts | 3 ++- screen-reader-test/screen-reader/tests/radio.spec.ts | 9 +++++---- 11 files changed, 16 insertions(+), 5 deletions(-) create mode 100644 screen-reader-test/screen-reader/__snapshots__/macos/chromium/DBButton-should-not-have-icon-in-screen-reader.txt create mode 100644 screen-reader-test/screen-reader/__snapshots__/macos/chromium/DBInput-should-have-message-and-label.txt create mode 100644 screen-reader-test/screen-reader/__snapshots__/macos/chromium/DBRadio-should-label-duplicated.txt create mode 100644 screen-reader-test/screen-reader/__snapshots__/macos/firefox/DBButton-should-not-have-icon-in-screen-reader.txt create mode 100644 screen-reader-test/screen-reader/__snapshots__/macos/firefox/DBInput-should-have-message-and-label.txt create mode 100644 screen-reader-test/screen-reader/__snapshots__/macos/firefox/DBRadio-should-label-duplicated.txt create mode 100644 screen-reader-test/screen-reader/__snapshots__/windows/firefox/DBButton-should-not-have-icon-in-screen-reader.txt create mode 100644 screen-reader-test/screen-reader/__snapshots__/windows/firefox/DBInput-should-have-message-and-label.txt create mode 100644 screen-reader-test/screen-reader/__snapshots__/windows/firefox/DBRadio-should-label-duplicated.txt diff --git a/screen-reader-test/screen-reader/__snapshots__/macos/chromium/DBButton-should-not-have-icon-in-screen-reader.txt b/screen-reader-test/screen-reader/__snapshots__/macos/chromium/DBButton-should-not-have-icon-in-screen-reader.txt new file mode 100644 index 0000000..e2ab413 --- /dev/null +++ b/screen-reader-test/screen-reader/__snapshots__/macos/chromium/DBButton-should-not-have-icon-in-screen-reader.txt @@ -0,0 +1 @@ +["Default","Default","Text"] \ No newline at end of file diff --git a/screen-reader-test/screen-reader/__snapshots__/macos/chromium/DBInput-should-have-message-and-label.txt b/screen-reader-test/screen-reader/__snapshots__/macos/chromium/DBInput-should-have-message-and-label.txt new file mode 100644 index 0000000..67192fe --- /dev/null +++ b/screen-reader-test/screen-reader/__snapshots__/macos/chromium/DBInput-should-have-message-and-label.txt @@ -0,0 +1 @@ +["Label","Label (Default) Basic edit text"] \ No newline at end of file diff --git a/screen-reader-test/screen-reader/__snapshots__/macos/chromium/DBRadio-should-label-duplicated.txt b/screen-reader-test/screen-reader/__snapshots__/macos/chromium/DBRadio-should-label-duplicated.txt new file mode 100644 index 0000000..97093ca --- /dev/null +++ b/screen-reader-test/screen-reader/__snapshots__/macos/chromium/DBRadio-should-label-duplicated.txt @@ -0,0 +1 @@ +["","",""] \ No newline at end of file diff --git a/screen-reader-test/screen-reader/__snapshots__/macos/firefox/DBButton-should-not-have-icon-in-screen-reader.txt b/screen-reader-test/screen-reader/__snapshots__/macos/firefox/DBButton-should-not-have-icon-in-screen-reader.txt new file mode 100644 index 0000000..e2ab413 --- /dev/null +++ b/screen-reader-test/screen-reader/__snapshots__/macos/firefox/DBButton-should-not-have-icon-in-screen-reader.txt @@ -0,0 +1 @@ +["Default","Default","Text"] \ No newline at end of file diff --git a/screen-reader-test/screen-reader/__snapshots__/macos/firefox/DBInput-should-have-message-and-label.txt b/screen-reader-test/screen-reader/__snapshots__/macos/firefox/DBInput-should-have-message-and-label.txt new file mode 100644 index 0000000..1608d70 --- /dev/null +++ b/screen-reader-test/screen-reader/__snapshots__/macos/firefox/DBInput-should-have-message-and-label.txt @@ -0,0 +1 @@ +["Label clickable","end of Label group"] \ No newline at end of file diff --git a/screen-reader-test/screen-reader/__snapshots__/macos/firefox/DBRadio-should-label-duplicated.txt b/screen-reader-test/screen-reader/__snapshots__/macos/firefox/DBRadio-should-label-duplicated.txt new file mode 100644 index 0000000..97093ca --- /dev/null +++ b/screen-reader-test/screen-reader/__snapshots__/macos/firefox/DBRadio-should-label-duplicated.txt @@ -0,0 +1 @@ +["","",""] \ No newline at end of file diff --git a/screen-reader-test/screen-reader/__snapshots__/windows/firefox/DBButton-should-not-have-icon-in-screen-reader.txt b/screen-reader-test/screen-reader/__snapshots__/windows/firefox/DBButton-should-not-have-icon-in-screen-reader.txt new file mode 100644 index 0000000..a1a0345 --- /dev/null +++ b/screen-reader-test/screen-reader/__snapshots__/windows/firefox/DBButton-should-not-have-icon-in-screen-reader.txt @@ -0,0 +1 @@ +["button, (Default) Text","button, user Icon and Text","button, user Icon"] diff --git a/screen-reader-test/screen-reader/__snapshots__/windows/firefox/DBInput-should-have-message-and-label.txt b/screen-reader-test/screen-reader/__snapshots__/windows/firefox/DBInput-should-have-message-and-label.txt new file mode 100644 index 0000000..ab3e505 --- /dev/null +++ b/screen-reader-test/screen-reader/__snapshots__/windows/firefox/DBInput-should-have-message-and-label.txt @@ -0,0 +1 @@ +["Label, edit, has auto complete, (Default) Basic, blank","Label, edit, has auto complete, information circle Helper Message, Helper Message, blank"] diff --git a/screen-reader-test/screen-reader/__snapshots__/windows/firefox/DBRadio-should-label-duplicated.txt b/screen-reader-test/screen-reader/__snapshots__/windows/firefox/DBRadio-should-label-duplicated.txt new file mode 100644 index 0000000..ea019b1 --- /dev/null +++ b/screen-reader-test/screen-reader/__snapshots__/windows/firefox/DBRadio-should-label-duplicated.txt @@ -0,0 +1 @@ +["Expressive, radio button, checked, 3 of 3","Functional, radio button, checked, 1 of 3","(Default) Regular, radio button, checked, 2 of 3"] diff --git a/screen-reader-test/screen-reader/default.ts b/screen-reader-test/screen-reader/default.ts index 19372d2..09ee62e 100644 --- a/screen-reader-test/screen-reader/default.ts +++ b/screen-reader-test/screen-reader/default.ts @@ -30,7 +30,8 @@ const cleanSpeakInstructions = (phraseLog: string[]): string[] => sPhrase.startsWith("You are currently") || sPhrase.startsWith("To enter") || sPhrase.startsWith("To exit") || - sPhrase.startsWith("To click") + sPhrase.startsWith("To click") || + sPhrase.startsWith("To select") ), ) .join(". "), diff --git a/screen-reader-test/screen-reader/tests/radio.spec.ts b/screen-reader-test/screen-reader/tests/radio.spec.ts index be4bdbf..4bb9c63 100644 --- a/screen-reader-test/screen-reader/tests/radio.spec.ts +++ b/screen-reader-test/screen-reader/tests/radio.spec.ts @@ -7,10 +7,11 @@ test.describe("DBRadio", () => { title: "should label duplicated", url: "./#/03/radio?page=density", testFn: async (voiceOver, nvda) => { - const screenReader = voiceOver ?? nvda; - await screenReader.press("ArrowLeft"); - await screenReader.press("ArrowRight"); - await screenReader.press("ArrowRight"); + const screenReader = voiceOver ?? nvda; + await screenReader.press("Spacebar"); + await screenReader.press("ArrowLeft"); + await screenReader.press("ArrowRight"); + await screenReader.press("ArrowRight"); }, }); });