From c95d87e94c809114a40c88992e8c6b714fe0c28a Mon Sep 17 00:00:00 2001 From: Michael Ball Date: Thu, 20 Jun 2024 15:20:39 -0700 Subject: [PATCH] Enable WCAG 2.2 tests with an additional tag/test suite --- .github/workflows/specs.yml | 5 ++++- utilities/spec/accessibility_spec.rb | 15 +++++++-------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/.github/workflows/specs.yml b/.github/workflows/specs.yml index bbf6ab34f..f5f25b0c2 100644 --- a/.github/workflows/specs.yml +++ b/.github/workflows/specs.yml @@ -18,6 +18,9 @@ jobs: - sparks - bjc4nyc_teacher - sparks-teacher + suite: + - wcag20 + - wcag22 steps: - uses: actions/checkout@v3 - uses: ruby/setup-ruby@v1 @@ -27,4 +30,4 @@ jobs: ruby-version: 3.2.2 bundler-cache: true - name: ${{ matrix.course }} - a11y tests - run: bundle exec rspec utilities/spec --tag ${{ matrix.course }} + run: bundle exec rspec utilities/spec --tag ${{ matrix.course }} --tag ${{ matrix.suite }} diff --git a/utilities/spec/accessibility_spec.rb b/utilities/spec/accessibility_spec.rb index 8c0307b7f..ea8052b21 100644 --- a/utilities/spec/accessibility_spec.rb +++ b/utilities/spec/accessibility_spec.rb @@ -105,7 +105,7 @@ def load_all_urls_in_course(course) end # These tests should always be enabled. - it 'according to WCAG 2.0 AA' do + it 'according to WCAG 2.0 AA', wcag20: true do if page.html.match?(/File not found:/) skip("TODO: #{url} is a 404 page.") end @@ -116,13 +116,12 @@ def load_all_urls_in_course(course) .excluding(*excluded_elements) end - # TODO: This is commented out just to reduce the noise... - # it 'according to WCAG 2.2 and all additional standards', :skip do - # expect(page).to be_axe_clean - # .according_to(*complete_a11y_standards) - # .skipping(*skipped_rules) - # .excluding(*excluded_elements) - # end + it 'according to WCAG 2.2 and all additional standards', wcag22: true do + expect(page).to be_axe_clean + .according_to(*complete_a11y_standards) + .skipping(*skipped_rules) + .excluding(*excluded_elements) + end end end end