From 510e74ad2a287b7309532851c048fa324f93f5b7 Mon Sep 17 00:00:00 2001 From: Simon Pieters Date: Tue, 1 Dec 2020 15:11:40 +0100 Subject: [PATCH 1/8] Add a prototype automated test file (not generated) See https://github.com/w3c/aria-at/issues/349 --- ...ate-to-unchecked-checkbox-reading.nvda.txt | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 tests/checkbox/automated/test-01-navigate-to-unchecked-checkbox-reading.nvda.txt diff --git a/tests/checkbox/automated/test-01-navigate-to-unchecked-checkbox-reading.nvda.txt b/tests/checkbox/automated/test-01-navigate-to-unchecked-checkbox-reading.nvda.txt new file mode 100644 index 000000000..e5de30190 --- /dev/null +++ b/tests/checkbox/automated/test-01-navigate-to-unchecked-checkbox-reading.nvda.txt @@ -0,0 +1,43 @@ +nav: reference/two-state-checkbox.html +press: h +assert_contains: Checkbox Example (Two State) +press: x +assert_role: checkbox +assert_checked: false +assert_accname: Lettuce +assert_equals: Sandwich Condiments grouping list with 4 items Lettuce check box not checked +press: x +assert_accname: Tomato +press: Shift+x +assert_role: checkbox +assert_checked: false +assert_accname: Lettuce +assert_equals: Lettuce check box not checked +press: Shift+h +assert_contains: Sandwich Condiments +press: f +assert_role: checkbox +assert_checked: false +assert_accname: Lettuce +assert_equals: Sandwich Condiments grouping list with 4 items Lettuce check box not checked +press: f +assert_accname: Tomato +press: Shift+f +assert_role: checkbox +assert_checked: false +assert_accname: Lettuce +assert_equals: Lettuce check box not checked +press: Shift+h +assert_contains: Sandwich Condiments +press: Tab +assert_role: checkbox +assert_checked: false +assert_accname: Lettuce +assert_equals: Sandwich Condiments grouping list with 4 items Lettuce check box not checked +press: Tab +assert_accname: Tomato +press: Shift+Tab +assert_role: checkbox +assert_checked: false +assert_accname: Lettuce +assert_equals: Lettuce check box not checked From b85bd037efde45fc5d50f6d59bac9dbc7c8a5038 Mon Sep 17 00:00:00 2001 From: Simon Pieters Date: Wed, 9 Dec 2020 15:36:23 +0100 Subject: [PATCH 2/8] Switch to JSON --- ...te-to-unchecked-checkbox-reading.nvda.json | 217 ++++++++++++++++++ ...ate-to-unchecked-checkbox-reading.nvda.txt | 43 ---- 2 files changed, 217 insertions(+), 43 deletions(-) create mode 100644 tests/checkbox/automated/test-01-navigate-to-unchecked-checkbox-reading.nvda.json delete mode 100644 tests/checkbox/automated/test-01-navigate-to-unchecked-checkbox-reading.nvda.txt diff --git a/tests/checkbox/automated/test-01-navigate-to-unchecked-checkbox-reading.nvda.json b/tests/checkbox/automated/test-01-navigate-to-unchecked-checkbox-reading.nvda.json new file mode 100644 index 000000000..bd706b124 --- /dev/null +++ b/tests/checkbox/automated/test-01-navigate-to-unchecked-checkbox-reading.nvda.json @@ -0,0 +1,217 @@ +[ + { + "nav": [ + "reference/two-state-checkbox.html" + ] + }, + { + "press": [ + "h" + ] + }, + { + "assert_contains": [ + "Checkbox Example (Two State)" + ] + }, + { + "press": [ + "x" + ] + }, + { + "assert_role": [ + "checkbox" + ] + }, + { + "assert_checked": [ + "false" + ] + }, + { + "assert_accname": [ + "Lettuce" + ] + }, + { + "assert_equals": [ + "Sandwich Condiments grouping list with 4 items Lettuce check box not checked" + ] + }, + { + "press": [ + "x" + ] + }, + { + "assert_accname": [ + "Tomato" + ] + }, + { + "press": [ + "Shift+x" + ] + }, + { + "assert_role": [ + "checkbox" + ] + }, + { + "assert_checked": [ + "false" + ] + }, + { + "assert_accname": [ + "Lettuce" + ] + }, + { + "assert_equals": [ + "Lettuce check box not checked" + ] + }, + { + "press": [ + "Shift+h" + ] + }, + { + "assert_contains": [ + "Sandwich Condiments" + ] + }, + { + "press": [ + "f" + ] + }, + { + "assert_role": [ + "checkbox" + ] + }, + { + "assert_checked": [ + "false" + ] + }, + { + "assert_accname": [ + "Lettuce" + ] + }, + { + "assert_equals": [ + "Sandwich Condiments grouping list with 4 items Lettuce check box not checked" + ] + }, + { + "press": [ + "f" + ] + }, + { + "assert_accname": [ + "Tomato" + ] + }, + { + "press": [ + "Shift+f" + ] + }, + { + "assert_role": [ + "checkbox" + ] + }, + { + "assert_checked": [ + "false" + ] + }, + { + "assert_accname": [ + "Lettuce" + ] + }, + { + "assert_equals": [ + "Lettuce check box not checked" + ] + }, + { + "press": [ + "Shift+h" + ] + }, + { + "assert_contains": [ + "Sandwich Condiments" + ] + }, + { + "press": [ + "Tab" + ] + }, + { + "assert_role": [ + "checkbox" + ] + }, + { + "assert_checked": [ + "false" + ] + }, + { + "assert_accname": [ + "Lettuce" + ] + }, + { + "assert_equals": [ + "Sandwich Condiments grouping list with 4 items Lettuce check box not checked" + ] + }, + { + "press": [ + "Tab" + ] + }, + { + "assert_accname": [ + "Tomato" + ] + }, + { + "press": [ + "Shift+Tab" + ] + }, + { + "assert_role": [ + "checkbox" + ] + }, + { + "assert_checked": [ + "false" + ] + }, + { + "assert_accname": [ + "Lettuce" + ] + }, + { + "assert_equals": [ + "Lettuce check box not checked" + ] + } +] diff --git a/tests/checkbox/automated/test-01-navigate-to-unchecked-checkbox-reading.nvda.txt b/tests/checkbox/automated/test-01-navigate-to-unchecked-checkbox-reading.nvda.txt deleted file mode 100644 index e5de30190..000000000 --- a/tests/checkbox/automated/test-01-navigate-to-unchecked-checkbox-reading.nvda.txt +++ /dev/null @@ -1,43 +0,0 @@ -nav: reference/two-state-checkbox.html -press: h -assert_contains: Checkbox Example (Two State) -press: x -assert_role: checkbox -assert_checked: false -assert_accname: Lettuce -assert_equals: Sandwich Condiments grouping list with 4 items Lettuce check box not checked -press: x -assert_accname: Tomato -press: Shift+x -assert_role: checkbox -assert_checked: false -assert_accname: Lettuce -assert_equals: Lettuce check box not checked -press: Shift+h -assert_contains: Sandwich Condiments -press: f -assert_role: checkbox -assert_checked: false -assert_accname: Lettuce -assert_equals: Sandwich Condiments grouping list with 4 items Lettuce check box not checked -press: f -assert_accname: Tomato -press: Shift+f -assert_role: checkbox -assert_checked: false -assert_accname: Lettuce -assert_equals: Lettuce check box not checked -press: Shift+h -assert_contains: Sandwich Condiments -press: Tab -assert_role: checkbox -assert_checked: false -assert_accname: Lettuce -assert_equals: Sandwich Condiments grouping list with 4 items Lettuce check box not checked -press: Tab -assert_accname: Tomato -press: Shift+Tab -assert_role: checkbox -assert_checked: false -assert_accname: Lettuce -assert_equals: Lettuce check box not checked From 6844f08b7438a8d1c252004563e237909f1348af Mon Sep 17 00:00:00 2001 From: Simon Pieters Date: Thu, 10 Dec 2020 11:05:08 +0100 Subject: [PATCH 3/8] Use press_until_* and clear_output --- ...te-to-unchecked-checkbox-reading.nvda.json | 47 ++++++++++++++----- 1 file changed, 34 insertions(+), 13 deletions(-) diff --git a/tests/checkbox/automated/test-01-navigate-to-unchecked-checkbox-reading.nvda.json b/tests/checkbox/automated/test-01-navigate-to-unchecked-checkbox-reading.nvda.json index bd706b124..5770cc21f 100644 --- a/tests/checkbox/automated/test-01-navigate-to-unchecked-checkbox-reading.nvda.json +++ b/tests/checkbox/automated/test-01-navigate-to-unchecked-checkbox-reading.nvda.json @@ -5,14 +5,13 @@ ] }, { - "press": [ - "h" + "press_until_contains": [ + "h", + "Sandwich Condiments" ] }, { - "assert_contains": [ - "Checkbox Example (Two State)" - ] + "clear_output": [] }, { "press": [ @@ -39,6 +38,9 @@ "Sandwich Condiments grouping list with 4 items Lettuce check box not checked" ] }, + { + "clear_output": [] + }, { "press": [ "x" @@ -49,6 +51,9 @@ "Tomato" ] }, + { + "clear_output": [] + }, { "press": [ "Shift+x" @@ -75,15 +80,17 @@ ] }, { - "press": [ - "Shift+h" - ] + "clear_output": [] }, { - "assert_contains": [ + "press_until_contains": [ + "Shift+h", "Sandwich Condiments" ] }, + { + "clear_output": [] + }, { "press": [ "f" @@ -109,6 +116,9 @@ "Sandwich Condiments grouping list with 4 items Lettuce check box not checked" ] }, + { + "clear_output": [] + }, { "press": [ "f" @@ -119,6 +129,9 @@ "Tomato" ] }, + { + "clear_output": [] + }, { "press": [ "Shift+f" @@ -145,15 +158,17 @@ ] }, { - "press": [ - "Shift+h" - ] + "clear_output": [] }, { - "assert_contains": [ + "press_until_contains": [ + "Shift+h", "Sandwich Condiments" ] }, + { + "clear_output": [] + }, { "press": [ "Tab" @@ -179,6 +194,9 @@ "Sandwich Condiments grouping list with 4 items Lettuce check box not checked" ] }, + { + "clear_output": [] + }, { "press": [ "Tab" @@ -189,6 +207,9 @@ "Tomato" ] }, + { + "clear_output": [] + }, { "press": [ "Shift+Tab" From de8c7eb06c16d6191c8ddeed60630527b93dd4d0 Mon Sep 17 00:00:00 2001 From: Simon Pieters Date: Wed, 16 Dec 2020 15:25:45 +0100 Subject: [PATCH 4/8] Change assert_checked to assert_state_or_property --- ...ate-to-unchecked-checkbox-reading.nvda.json | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/tests/checkbox/automated/test-01-navigate-to-unchecked-checkbox-reading.nvda.json b/tests/checkbox/automated/test-01-navigate-to-unchecked-checkbox-reading.nvda.json index 5770cc21f..7f0272c9f 100644 --- a/tests/checkbox/automated/test-01-navigate-to-unchecked-checkbox-reading.nvda.json +++ b/tests/checkbox/automated/test-01-navigate-to-unchecked-checkbox-reading.nvda.json @@ -24,7 +24,8 @@ ] }, { - "assert_checked": [ + "assert_state_or_property": [ + "aria-checked", "false" ] }, @@ -65,7 +66,8 @@ ] }, { - "assert_checked": [ + "assert_state_or_property": [ + "aria-checked", "false" ] }, @@ -102,7 +104,8 @@ ] }, { - "assert_checked": [ + "assert_state_or_property": [ + "aria-checked", "false" ] }, @@ -143,7 +146,8 @@ ] }, { - "assert_checked": [ + "assert_state_or_property": [ + "aria-checked", "false" ] }, @@ -180,7 +184,8 @@ ] }, { - "assert_checked": [ + "assert_state_or_property": [ + "aria-checked", "false" ] }, @@ -221,7 +226,8 @@ ] }, { - "assert_checked": [ + "assert_state_or_property": [ + "aria-checked", "false" ] }, From cdae13d5e3bd5934276f466349fa09b99eda26b6 Mon Sep 17 00:00:00 2001 From: Simon Pieters Date: Fri, 18 Dec 2020 11:43:22 +0100 Subject: [PATCH 5/8] Replace assert_accname with assert_contains --- ...ate-to-unchecked-checkbox-reading.nvda.json | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/tests/checkbox/automated/test-01-navigate-to-unchecked-checkbox-reading.nvda.json b/tests/checkbox/automated/test-01-navigate-to-unchecked-checkbox-reading.nvda.json index 7f0272c9f..985f74528 100644 --- a/tests/checkbox/automated/test-01-navigate-to-unchecked-checkbox-reading.nvda.json +++ b/tests/checkbox/automated/test-01-navigate-to-unchecked-checkbox-reading.nvda.json @@ -30,7 +30,7 @@ ] }, { - "assert_accname": [ + "assert_contains": [ "Lettuce" ] }, @@ -48,7 +48,7 @@ ] }, { - "assert_accname": [ + "assert_contains": [ "Tomato" ] }, @@ -72,7 +72,7 @@ ] }, { - "assert_accname": [ + "assert_contains": [ "Lettuce" ] }, @@ -110,7 +110,7 @@ ] }, { - "assert_accname": [ + "assert_contains": [ "Lettuce" ] }, @@ -128,7 +128,7 @@ ] }, { - "assert_accname": [ + "assert_contains": [ "Tomato" ] }, @@ -152,7 +152,7 @@ ] }, { - "assert_accname": [ + "assert_contains": [ "Lettuce" ] }, @@ -190,7 +190,7 @@ ] }, { - "assert_accname": [ + "assert_contains": [ "Lettuce" ] }, @@ -208,7 +208,7 @@ ] }, { - "assert_accname": [ + "assert_contains": [ "Tomato" ] }, @@ -232,7 +232,7 @@ ] }, { - "assert_accname": [ + "assert_contains": [ "Lettuce" ] }, From 2f278caed3f3fb38a17768725a1515044ac5cd37 Mon Sep 17 00:00:00 2001 From: Simon Pieters Date: Fri, 18 Dec 2020 11:49:44 +0100 Subject: [PATCH 6/8] Move automated test into the same folder as the manual test and make 'nav' base the repo root --- .../test-01-navigate-to-unchecked-checkbox-reading.nvda.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename tests/checkbox/{automated => }/test-01-navigate-to-unchecked-checkbox-reading.nvda.json (98%) diff --git a/tests/checkbox/automated/test-01-navigate-to-unchecked-checkbox-reading.nvda.json b/tests/checkbox/test-01-navigate-to-unchecked-checkbox-reading.nvda.json similarity index 98% rename from tests/checkbox/automated/test-01-navigate-to-unchecked-checkbox-reading.nvda.json rename to tests/checkbox/test-01-navigate-to-unchecked-checkbox-reading.nvda.json index 985f74528..cbe2c9ef2 100644 --- a/tests/checkbox/automated/test-01-navigate-to-unchecked-checkbox-reading.nvda.json +++ b/tests/checkbox/test-01-navigate-to-unchecked-checkbox-reading.nvda.json @@ -1,7 +1,7 @@ [ { "nav": [ - "reference/two-state-checkbox.html" + "tests/checkbox/reference/two-state-checkbox.html" ] }, { From 144ea0fd3a8504d878744fcf8eec360fda1a69b0 Mon Sep 17 00:00:00 2001 From: Simon Pieters Date: Fri, 18 Dec 2020 12:36:59 +0100 Subject: [PATCH 7/8] Checkbox reference file moved --- .../test-01-navigate-to-unchecked-checkbox-reading.nvda.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/checkbox/test-01-navigate-to-unchecked-checkbox-reading.nvda.json b/tests/checkbox/test-01-navigate-to-unchecked-checkbox-reading.nvda.json index cbe2c9ef2..df6619295 100644 --- a/tests/checkbox/test-01-navigate-to-unchecked-checkbox-reading.nvda.json +++ b/tests/checkbox/test-01-navigate-to-unchecked-checkbox-reading.nvda.json @@ -1,7 +1,7 @@ [ { "nav": [ - "tests/checkbox/reference/two-state-checkbox.html" + "tests/checkbox/reference/2020-11-23_175030/checkbox-1/checkbox-1.html" ] }, { From 58a9a978aea707ab0566a52252bff9ba0f36535b Mon Sep 17 00:00:00 2001 From: Simon Pieters Date: Fri, 18 Dec 2020 13:35:21 +0100 Subject: [PATCH 8/8] Support an argument to assert_contains for how many times the string is expected --- ...te-to-unchecked-checkbox-reading.nvda.json | 27 ++++++++++++------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/tests/checkbox/test-01-navigate-to-unchecked-checkbox-reading.nvda.json b/tests/checkbox/test-01-navigate-to-unchecked-checkbox-reading.nvda.json index df6619295..a9baa9763 100644 --- a/tests/checkbox/test-01-navigate-to-unchecked-checkbox-reading.nvda.json +++ b/tests/checkbox/test-01-navigate-to-unchecked-checkbox-reading.nvda.json @@ -31,7 +31,8 @@ }, { "assert_contains": [ - "Lettuce" + "Lettuce", + 1 ] }, { @@ -49,7 +50,8 @@ }, { "assert_contains": [ - "Tomato" + "Tomato", + 1 ] }, { @@ -73,7 +75,8 @@ }, { "assert_contains": [ - "Lettuce" + "Lettuce", + 1 ] }, { @@ -111,7 +114,8 @@ }, { "assert_contains": [ - "Lettuce" + "Lettuce", + 1 ] }, { @@ -129,7 +133,8 @@ }, { "assert_contains": [ - "Tomato" + "Tomato", + 1 ] }, { @@ -153,7 +158,8 @@ }, { "assert_contains": [ - "Lettuce" + "Lettuce", + 1 ] }, { @@ -191,7 +197,8 @@ }, { "assert_contains": [ - "Lettuce" + "Lettuce", + 1 ] }, { @@ -209,7 +216,8 @@ }, { "assert_contains": [ - "Tomato" + "Tomato", + 1 ] }, { @@ -233,7 +241,8 @@ }, { "assert_contains": [ - "Lettuce" + "Lettuce", + 1 ] }, {