From 63f9ec9b405e03b5e3c2ab9c8a27b3e21fca127d Mon Sep 17 00:00:00 2001 From: Simey Lameze Date: Thu, 10 Nov 2022 12:44:14 +0800 Subject: [PATCH] MDL-75982 tiny_accessibilitychecker: tests for accessibility checker --- .../tests/behat/accessibilitychecker.feature | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 lib/editor/tiny/plugins/accessibilitychecker/tests/behat/accessibilitychecker.feature diff --git a/lib/editor/tiny/plugins/accessibilitychecker/tests/behat/accessibilitychecker.feature b/lib/editor/tiny/plugins/accessibilitychecker/tests/behat/accessibilitychecker.feature new file mode 100644 index 00000000000..7db1ff56178 --- /dev/null +++ b/lib/editor/tiny/plugins/accessibilitychecker/tests/behat/accessibilitychecker.feature @@ -0,0 +1,45 @@ +@editor @editor_tiny +Feature: Tiny editor accessibility checker + To write accessible content in Tiny, I need to check for accessibility warnings. + + @javascript + Scenario Outline: Perform basic accessibility validations + Given I log in as "admin" + And I open my profile in edit mode + And I set the field "Description" to "" + When I click on the "Tools > Accessibility checker" menu item for the "Description" TinyMCE editor + Then I should see "" in the "Accessibility checker" "dialogue" + + Examples: + | result | content | + | The colours of the foreground and background text do not have enough contrast. |

Hard to read

| + | There is a lot of text with no headings. |

Sweet roll oat cake jelly-o macaroon donut oat cake. Caramels macaroon cookie sweet roll croissant cheesecake candy jelly-o. Gummies sugar plum sugar plum gingerbread dessert. Tiramisu bonbon jujubes danish marshmallow cookie chocolate cake cupcake tiramisu. Bear claw oat cake chocolate bar croissant. Lollipop cookie topping liquorice croissant. Brownie cookie cupcake lollipop cupcake cupcake. Fruitcake dessert sweet biscuit dragée caramels marzipan brownie. Chupa chups gingerbread apple pie cookie liquorice caramels carrot cake cookie gingerbread. Croissant candy jelly beans. Tiramisu apple pie dessert apple pie macaroon soufflé. Brownie powder carrot cake chocolate. Tart applicake croissant dragée macaroon chocolate donut.

Jelly beans gingerbread tootsie roll. Sugar plum tiramisu cotton candy toffee pie cotton candy tiramisu. Carrot cake chocolate bar sesame snaps cupcake cake dessert sweet fruitcake wafer. Marshmallow cupcake gingerbread pie sweet candy canes powder gummi bears. Jujubes cake muffin marshmallow candy jelly beans tootsie roll pie. Gummi bears applicake chocolate cake sweet jelly sesame snaps lollipop lollipop carrot cake. Marshmallow cake jelly beans. Jelly beans sesame snaps muffin halvah cookie ice cream candy canes carrot cake. Halvah donut marshmallow tiramisu. Cookie dessert gummi bears. Sugar plum apple pie jelly beans gummi bears tart chupa chups. Liquorice macaroon gummi bears gummies macaroon marshmallow sweet roll cake topping. Lemon drops caramels pie icing danish. Chocolate cake oat cake dessert halvah danish carrot cake apple pie.

| + | Tables should not contain merged cells. |
Dogs that look good in pants
BreedCoolness
PoodleNOT COOL
Doberman
| + | Tables should use row and/or column headers. |
Dogs that look good in pants
BreedCoolness
PoodleNOT COOL
DobermanCOOL
| + | Tables should have captions. |
BreedCoolness
PoodleNOT COOL
DobermanCOOL
| + + @javascript + Scenario: Perform accessibility validation on images with no alt attribute + Given I log in as "admin" + And I open my profile in edit mode + And I set the field "Description" to "

Some plain text

Some more text

" + And I click on the "Tools > Accessibility checker" menu item for the "Description" TinyMCE editor + And I should see "Images require alternative text." in the "Accessibility checker" "dialogue" + And I click on "View" "link" in the "Accessibility checker" "dialogue" + And I click on the "Image" button for the "Description" TinyMCE editor + And the field "Enter URL" matches value "/broken-image" + And I set the field "Describe this image for someone who cannot see it" to "No more warning!" + And I press "Save image" + And I click on the "Tools > Accessibility checker" menu item for the "Description" TinyMCE editor + And I should see "Congratulations, no accessibility issues found!" in the "Accessibility checker" "dialogue" + And I click on "Close" "button" in the "Accessibility checker" "dialogue" + And I select the "img" element in position "2" of the "Description" TinyMCE editor + And I click on the "Image" button for the "Description" TinyMCE editor + And I set the field "Enter URL" to "/decorative-image.png" + And I set the field "Describe this image for someone who cannot see it" to "" + And I set the field "Width" to "1" + And I set the field "Height" to "1" + And I click on "This image is decorative only" "checkbox" + When I press "Save image" + And I click on the "Tools > Accessibility checker" menu item for the "Description" TinyMCE editor + Then I should see "Congratulations, no accessibility issues found!" in the "Accessibility checker" "dialogue"