Skip to content

Commit

Permalink
QA & A11y (#967)
Browse files Browse the repository at this point in the history
* Broaden reach of sitemap to every page

* Site wide A11y using staging

* Retest workflow trigger

* sssssss

* Use frontend PRs

* Change trigger to centralise what we deem frontend changes

* Do nested vars work?

* Retest

* Nested interpolation is not supported
  • Loading branch information
peterdavidhamilton authored Dec 19, 2023
1 parent 2c9cff4 commit 14d5cc8
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 63 deletions.
30 changes: 13 additions & 17 deletions .github/workflows/pa11y.yml
Original file line number Diff line number Diff line change
@@ -1,33 +1,29 @@
---
# Pa11y-CI automated accessibility audit
#
# - automatically runs when new code is merged into main and deployed
# - a manually trigger run tests release candidate in pre-production by default
# manual dispatch audits integration by default
# ------------------------------------------------------------------------------
---
name: Check WCAG Standards

on:
workflow_run:
workflows:
- 'App Deploy [Azure - DEV]'
branches:
- main
types:
- completed
workflow_dispatch:
inputs:
workspace:
description: Deployment workspace to test against (staging, dev, review-pr-xxx)
type: string
default: staging
# workflow_dispatch:
# inputs:
# workspace:
# description: Deployment workspace to test against (dev, review-pr-xxx)
# type: string
# default: dev
merge_group:
pull_request:

jobs:
test:
if: contains(github.event.pull_request.labels.*.name, 'review')
runs-on: ubuntu-latest
environment: development
env:
BOT_TOKEN: ${{ secrets.WEBAPP_CONFIG_BOT_TOKEN }}
DOMAIN: eyrecovery-${{ inputs.workspace || 'dev' }}.azurewebsites.net
# DOMAIN: eyrecovery-${{ inputs.workspace }}.azurewebsites.net
DOMAIN: eyrecovery-review-pr-${{ github.event.number }}.azurewebsites.net
steps:
-
name: Checkout Code
Expand Down
63 changes: 17 additions & 46 deletions config/sitemap.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,9 @@
SitemapGenerator::Sitemap.create do
# TODO: test dynamic page content like question feedback

# non-course pages
%w[
accessibility-statement
new-registration
other-problems-signing-in
privacy-policy
promotional-materials
sitemap
terms-and-conditions
whats-new
email-preferences
wifi-and-data
].each do |path|
add static_path(path)
# static pages
Page.order(:heading).load.each do |page|
add static_path(page.name)
end

# settings
Expand Down Expand Up @@ -78,8 +67,8 @@
add edit_registration_local_authority_path
add edit_registration_role_type_path
add edit_registration_role_type_other_path
# TODO: missing paths
# add edit_registration_training_email_path
add edit_registration_training_emails_path
add edit_registration_early_years_emails_path

# close account
add edit_reason_user_close_account_path
Expand All @@ -91,34 +80,16 @@
add my_modules_path
add user_notes_path

# Representative content
mod = Training::Module.ordered.first
add training_module_path(mod.name)
add training_module_page_path(mod.name, mod.interruption_page.name)
add training_module_page_path(mod.name, mod.first_content_page.name)
add training_module_page_path(mod.name, mod.text_pages.first.name)
add training_module_page_path(mod.name, mod.video_pages.first.name)
add training_module_page_path(mod.name, mod.summary_intro_page.name)
add training_module_page_path(mod.name, mod.assessment_intro_page.name)
add training_module_page_path(mod.name, mod.confidence_intro_page.name)
add training_module_page_path(mod.name, mod.thankyou_page.name)
add training_module_page_path(mod.name, mod.certificate_page.name)
add training_module_question_path(mod.name, mod.formative_questions.first.name)
add training_module_question_path(mod.name, mod.summative_questions.first.name)
add training_module_question_path(mod.name, mod.confidence_questions.first.name)
add training_module_assessment_path(mod.name, mod.assessment_results_page.name)

# All content
# mods = Training::Module.ordered
# mods.each do |mod|
# mod.content.each do |page|
# if page.is_question?
# add training_module_question_path(mod.name, page.name)
# elsif page.assessment_results?
# add training_module_assessment_path(mod.name, page.name)
# else
# add training_module_page_path(mod.name, page.name)
# end
# end
# end
# Course content
Training::Module.ordered.each do |mod|
mod.content.each do |page|
if page.is_question?
add training_module_question_path(mod.name, page.name)
elsif page.assessment_results?
add training_module_assessment_path(mod.name, page.name)
else
add training_module_page_path(mod.name, page.name)
end
end
end
end

0 comments on commit 14d5cc8

Please sign in to comment.