From 3d76cbd124500f0b5e6ee6a14dfe22189bbd7d4e Mon Sep 17 00:00:00 2001
From: IsaDC <70024509+IsaDC@users.noreply.github.com>
Date: Tue, 4 Jun 2024 17:00:38 -0600
Subject: [PATCH] Update Bump into the top edge of a Nested modal dialog Test
(#1077)
* Modify Bump into the top edge of a Nested modal dialog test for more accurate navigation
* Update setupScript
* Correct Screen reader commands for test
* Update setupScritp
---
tests/modal-dialog/data/jaws-commands.csv | 2 +-
...sAddedDialogAndFocusAddressAddedHeading.js | 4 +
tests/modal-dialog/data/nvda-commands.csv | 2 +-
tests/modal-dialog/data/scripts.csv | 1 +
tests/modal-dialog/data/tests.csv | 2 +-
.../data/voiceover_macos-commands.csv | 2 +-
.../reference/2022-4-7_15544/dialog.html | 2 +-
...g.moveFocusToAddDeliveryAddressButton.html | 2 +-
...eliveryAddressDialogAndFocusAddButton.html | 2 +-
...veryAddressDialogAndFocusCancelButton.html | 2 +-
...liveryAddressDialogAndFocusFirstInput.html | 2 +-
...ddedDialogAndFocusAddressAddedHeading.html | 195 ++++++++++++++++++
...essAddedDialogAndFocusYourProfileLink.html | 2 +-
...cationResultDialogAndFocusCloseButton.html | 2 +-
14 files changed, 211 insertions(+), 11 deletions(-)
create mode 100644 tests/modal-dialog/data/js/openAddressAddedDialogAndFocusAddressAddedHeading.js
create mode 100644 tests/modal-dialog/reference/2022-4-7_15544/dialog.openAddressAddedDialogAndFocusAddressAddedHeading.html
diff --git a/tests/modal-dialog/data/jaws-commands.csv b/tests/modal-dialog/data/jaws-commands.csv
index d353b5e81..500605dc8 100644
--- a/tests/modal-dialog/data/jaws-commands.csv
+++ b/tests/modal-dialog/data/jaws-commands.csv
@@ -25,5 +25,5 @@ closeNestedModalDialog,space,virtualCursor,,24.1
closeNestedModalDialog,enter,virtualCursor,,24.2
closeNestedModalDialog,space,pcCursor,,24.3
closeNestedModalDialog,enter,pcCursor,,24.4
-bumpTopEdgeOfNestedModal,ctrl+home up up ins+up,virtualCursor,,30
+bumpTopEdgeOfNestedModal,up up ins+up,virtualCursor,,30
bumpBottomEdgeOfNestedModal,ctrl+end down down ins+up,virtualCursor,,31
diff --git a/tests/modal-dialog/data/js/openAddressAddedDialogAndFocusAddressAddedHeading.js b/tests/modal-dialog/data/js/openAddressAddedDialogAndFocusAddressAddedHeading.js
new file mode 100644
index 000000000..c8a5c4b19
--- /dev/null
+++ b/tests/modal-dialog/data/js/openAddressAddedDialogAndFocusAddressAddedHeading.js
@@ -0,0 +1,4 @@
+// opens the 'Add Delivery Address' dialog followed by the 'Address Added' dialog, and sets focus on the 'Address added' heading inside the second dialog
+const btn = testPageDocument.querySelector('#ex1 > button');
+testPageDocument.defaultView.openDialog('dialog1', btn, 'dialog1_add');
+testPageDocument.defaultView.replaceDialog('dialog3', undefined, 'dialog3_label');
diff --git a/tests/modal-dialog/data/nvda-commands.csv b/tests/modal-dialog/data/nvda-commands.csv
index ad369367e..aeb3207d5 100644
--- a/tests/modal-dialog/data/nvda-commands.csv
+++ b/tests/modal-dialog/data/nvda-commands.csv
@@ -25,5 +25,5 @@ closeNestedModalDialog,space,browseMode,,24.1
closeNestedModalDialog,enter,browseMode,,24.2
closeNestedModalDialog,space,focusMode,,24.3
closeNestedModalDialog,enter,focusMode,,24.4
-bumpTopEdgeOfNestedModal,ctrl+home up up ins+up,browseMode,,30
+bumpTopEdgeOfNestedModal,up up ins+up,browseMode,,30
bumpBottomEdgeOfNestedModal,ctrl+end down down ins+up,browseMode,,31
diff --git a/tests/modal-dialog/data/scripts.csv b/tests/modal-dialog/data/scripts.csv
index ebfa62da0..d8a8d8a0c 100644
--- a/tests/modal-dialog/data/scripts.csv
+++ b/tests/modal-dialog/data/scripts.csv
@@ -5,3 +5,4 @@ openAddDeliveryAddressDialogAndFocusCancelButton,"opens the 'Add Delivery Addres
openAddDeliveryAddressDialogAndFocusFirstInput,"opens the 'Add Delivery Address' modal dialog, and sets focus on the first input"
openAddressAddedDialogAndFocusYourProfileLink,"opens the 'Add Delivery Address' dialog followed by the 'Address Added' dialog, and sets focus on the 'your profile' link inside the second dialog"
openVerificationResultDialogAndFocusCloseButton,"opens the 'Add Delivery Address' dialog followed by the 'Verification Result' dialog, and sets focus on the 'Close' button inside the second dialog"
+openAddressAddedDialogAndFocusAddressAddedHeading,"opens the 'Add Delivery Address' dialog followed by the 'Address Added' dialog, and sets focus on the 'Address added' heading inside the second dialog"
diff --git a/tests/modal-dialog/data/tests.csv b/tests/modal-dialog/data/tests.csv
index 151805eca..138006c36 100644
--- a/tests/modal-dialog/data/tests.csv
+++ b/tests/modal-dialog/data/tests.csv
@@ -9,5 +9,5 @@ bumpTopEdge,Bump into the top edge of a modal dialog,16,openAddDeliveryAddressDi
bumpBottomEdge,Bump into the bottom edge of a modal dialog,16.1,openAddDeliveryAddressDialogAndFocusAddButton,"Starting at the 'Add' button inside the dialog, navigate to the bottom of the dialog and make multiple attempts to navigate past the bottom edge.",cursorAtCancelButton
openNestedModalDialog,Open a nested modal dialog ,20,openAddDeliveryAddressDialogAndFocusAddButton,"Starting at the 'Add' button inside the dialog, activate it to open the nested 'Address Added' dialog.",roleDialog nameAddressAdded dialogDescriptionAsTheAddressYouProvidedHasBeenAddedToYourListDeliveryAddressesItIsReadyForImmediateUseIfYouWishToRemoveItYouCanDoSoFromYourProfile roleFocusedElementButton nameFocusedElementOk
closeNestedModalDialog,Close a nested modal dialog,30,openVerificationResultDialogAndFocusCloseButton,"Starting at the 'Close' button inside the nested dialog, close the dialog.",roleDialog nameAddDeliveryAddress roleButton nameVerifyAddress
-bumpTopEdgeOfNestedModal,Bump into the top edge of a Nested modal dialog,40,openAddressAddedDialogAndFocusYourProfileLink,"Starting at the 'Your Profile' link inside the nested dialog, navigate to the top of the dialog and make multiple attempts to navigate past the top edge.",cursorAtAddressAddedHeading
+bumpTopEdgeOfNestedModal,Bump into the top edge of a Nested modal dialog,40,openAddressAddedDialogAndFocusAddressAddedHeading,"Starting at the 'Address Added' heading inside the nested dialog, navigate to the top of the dialog and make multiple attempts to navigate past the top edge.",cursorAtAddressAddedHeading
bumpBottomEdgeOfNestedModal,Bump into the bottom edge of a Nested modal dialog,40.1,openAddressAddedDialogAndFocusYourProfileLink,"Starting at the 'Your Profile' link inside the nested dialog, navigate to the bottom of the dialog and make multiple attempts to navigate past the bottom edge.",cursorAtOKButton
diff --git a/tests/modal-dialog/data/voiceover_macos-commands.csv b/tests/modal-dialog/data/voiceover_macos-commands.csv
index f0ebd6b2c..003cac57b 100644
--- a/tests/modal-dialog/data/voiceover_macos-commands.csv
+++ b/tests/modal-dialog/data/voiceover_macos-commands.csv
@@ -19,5 +19,5 @@ closeNestedModalDialog,esc,,,23
closeNestedModalDialog,ctrl+opt+space,,,23.1
closeNestedModalDialog,space,,,23.2
closeNestedModalDialog,enter,,,23.3
-bumpTopEdgeOfNestedModal,ctrl+opt+home ctrl+opt+left ctrl+opt+left ctrl+opt+f3,,,30
+bumpTopEdgeOfNestedModal,ctrl+opt+left ctrl+opt+left ctrl+opt+f3,,,30
bumpBottomEdgeOfNestedModal,ctrl+opt+end ctrl+opt+right ctrl+opt+right ctrl+opt+f3,,,31
diff --git a/tests/modal-dialog/reference/2022-4-7_15544/dialog.html b/tests/modal-dialog/reference/2022-4-7_15544/dialog.html
index f714d8edc..abef188e2 100644
--- a/tests/modal-dialog/reference/2022-4-7_15544/dialog.html
+++ b/tests/modal-dialog/reference/2022-4-7_15544/dialog.html
@@ -137,7 +137,7 @@
Verification Result
-
Address Added
+
Address Added
The address you provided has been added to your list of delivery addresses. It is ready
for immediate use. If you wish to remove it, you can do so from
diff --git a/tests/modal-dialog/reference/2022-4-7_15544/dialog.moveFocusToAddDeliveryAddressButton.html b/tests/modal-dialog/reference/2022-4-7_15544/dialog.moveFocusToAddDeliveryAddressButton.html
index 498486152..9c42165bb 100644
--- a/tests/modal-dialog/reference/2022-4-7_15544/dialog.moveFocusToAddDeliveryAddressButton.html
+++ b/tests/modal-dialog/reference/2022-4-7_15544/dialog.moveFocusToAddDeliveryAddressButton.html
@@ -155,7 +155,7 @@
Verification Result
-
Address Added
+
Address Added
The address you provided has been added to your list of delivery addresses. It is ready
for immediate use. If you wish to remove it, you can do so from
diff --git a/tests/modal-dialog/reference/2022-4-7_15544/dialog.openAddDeliveryAddressDialogAndFocusAddButton.html b/tests/modal-dialog/reference/2022-4-7_15544/dialog.openAddDeliveryAddressDialogAndFocusAddButton.html
index 3a208e913..2f01d94cc 100644
--- a/tests/modal-dialog/reference/2022-4-7_15544/dialog.openAddDeliveryAddressDialogAndFocusAddButton.html
+++ b/tests/modal-dialog/reference/2022-4-7_15544/dialog.openAddDeliveryAddressDialogAndFocusAddButton.html
@@ -156,7 +156,7 @@
Verification Result
-
Address Added
+
Address Added
The address you provided has been added to your list of delivery addresses. It is ready
for immediate use. If you wish to remove it, you can do so from
diff --git a/tests/modal-dialog/reference/2022-4-7_15544/dialog.openAddDeliveryAddressDialogAndFocusCancelButton.html b/tests/modal-dialog/reference/2022-4-7_15544/dialog.openAddDeliveryAddressDialogAndFocusCancelButton.html
index 6b07b2027..106d54825 100644
--- a/tests/modal-dialog/reference/2022-4-7_15544/dialog.openAddDeliveryAddressDialogAndFocusCancelButton.html
+++ b/tests/modal-dialog/reference/2022-4-7_15544/dialog.openAddDeliveryAddressDialogAndFocusCancelButton.html
@@ -156,7 +156,7 @@
Verification Result
-
Address Added
+
Address Added
The address you provided has been added to your list of delivery addresses. It is ready
for immediate use. If you wish to remove it, you can do so from
diff --git a/tests/modal-dialog/reference/2022-4-7_15544/dialog.openAddDeliveryAddressDialogAndFocusFirstInput.html b/tests/modal-dialog/reference/2022-4-7_15544/dialog.openAddDeliveryAddressDialogAndFocusFirstInput.html
index 9c83316de..94fe88b2a 100644
--- a/tests/modal-dialog/reference/2022-4-7_15544/dialog.openAddDeliveryAddressDialogAndFocusFirstInput.html
+++ b/tests/modal-dialog/reference/2022-4-7_15544/dialog.openAddDeliveryAddressDialogAndFocusFirstInput.html
@@ -156,7 +156,7 @@
Verification Result
-
Address Added
+
Address Added
The address you provided has been added to your list of delivery addresses. It is ready
for immediate use. If you wish to remove it, you can do so from
diff --git a/tests/modal-dialog/reference/2022-4-7_15544/dialog.openAddressAddedDialogAndFocusAddressAddedHeading.html b/tests/modal-dialog/reference/2022-4-7_15544/dialog.openAddressAddedDialogAndFocusAddressAddedHeading.html
new file mode 100644
index 000000000..3e4d4b52f
--- /dev/null
+++ b/tests/modal-dialog/reference/2022-4-7_15544/dialog.openAddressAddedDialogAndFocusAddressAddedHeading.html
@@ -0,0 +1,195 @@
+
+
+
+ Following is an example implementation of the
+ design pattern for modal dialogs.
+ The below Add Delivery Address button opens a modal dialog that contains two buttons that open other dialogs.
+
+ For example, gate code or other information to help the driver find you
+
+
+
+
+
+
+
+
+
+
+
+
+
Verification Result
+
+
This is just a demonstration. If it were a real application, it would
+ provide a message telling whether the entered address is valid.
+
+ For demonstration purposes, this dialog has a lot of text. It demonstrates a
+ scenario where:
+
+
+
The first interactive element, the help link, is at the bottom of the dialog.
+
If focus is placed on the first interactive element when the dialog opens, the
+ validation message may not be visible.
+
If the validation message is visible and the focus is on the help link, then
+ the focus may not be visible.
+
+ When the dialog opens, it is important that both:
+
+
The beginning of the text is visible so users do not have to scroll back to
+ start reading.
+
The keyboard focus always remains visible.
+
+
+
+
There are several ways to resolve this issue:
+
+
Place an interactive element at the top of the dialog, e.g., a button or link.
+
Make a static element focusable, e.g., the dialog title or the first block of
+ text.
+
+
+ Please DO NOT make the element with role dialog focusable!
+
+
+
The larger a focusable element is, the more difficult it is to visually
+ identify the location of focus, especially for users with a narrow field of view.
+
The dialog has a visual border, so creating a clear visual indicator of focus
+ when the entire dialog has focus is not very feasible.
+
Screen readers read the label and content of focusable elements. The dialog
+ contains its label and a lot of content! If a dialog like this one has focus, the
+ actual focus is difficult to comprehend.
+
+
+ In this dialog, the first paragraph has tabindex=-1. The first
+ paragraph is also contained inside the element that provides the dialog description, i.e., the element that is referenced
+ by aria-describedby. With some screen readers, this may have one negative
+ but relatively insignificant side effect when the dialog opens -- the first paragraph
+ may be announced twice. Nonetheless, making the first paragraph focusable and setting
+ the initial focus on it is the most broadly accessible option.
+
+ The address you provided has been added to your list of delivery addresses. It is ready
+ for immediate use. If you wish to remove it, you can do so from
+ your profile.
+
+
+
+
+
+
+
+
End of the Road!
+
+ You activated a fake link or button that goes nowhere!
+ The link or button is present for demonstration purposes only.
+
The address you provided has been added to your list of delivery addresses. It is ready
for immediate use. If you wish to remove it, you can do so from
diff --git a/tests/modal-dialog/reference/2022-4-7_15544/dialog.openVerificationResultDialogAndFocusCloseButton.html b/tests/modal-dialog/reference/2022-4-7_15544/dialog.openVerificationResultDialogAndFocusCloseButton.html
index 99524e44d..a72319122 100644
--- a/tests/modal-dialog/reference/2022-4-7_15544/dialog.openVerificationResultDialogAndFocusCloseButton.html
+++ b/tests/modal-dialog/reference/2022-4-7_15544/dialog.openVerificationResultDialogAndFocusCloseButton.html
@@ -157,7 +157,7 @@
Verification Result
-
Address Added
+
Address Added
The address you provided has been added to your list of delivery addresses. It is ready
for immediate use. If you wish to remove it, you can do so from