From b1419e048b199f2a91853b9a5cc30240591d5258 Mon Sep 17 00:00:00 2001 From: Matthew Landauer Date: Tue, 31 Oct 2023 01:04:00 +0000 Subject: [PATCH] We can now simplify the automated accessibility tests --- spec/features/comment_to_authority_spec.rb | 20 ++-------- spec/features/documentation_pages_spec.rb | 40 ++++--------------- spec/features/home_page_spec.rb | 9 +---- spec/features/search_for_applications_spec.rb | 18 ++------- 4 files changed, 18 insertions(+), 69 deletions(-) diff --git a/spec/features/comment_to_authority_spec.rb b/spec/features/comment_to_authority_spec.rb index 5b9d7be1a..7830f9611 100644 --- a/spec/features/comment_to_authority_spec.rb +++ b/spec/features/comment_to_authority_spec.rb @@ -47,20 +47,14 @@ visit(application_path(application)) end - it "main content passes" do - # Limiting check to main content to ignore (for the time being) colour contrast issues with the header and footer - expect(page).to be_axe_clean.within("main").excluding("[data-lat]") + it "page passes most" do + expect(page).to be_axe_clean.excluding("[data-lat]") end it "google maps content passes" do pending "We have to figure out how to get the aria-labels inside the map and streetview to be different" expect(page).to be_axe_clean.within("[data-lat]") end - - it "page passes most" do - # Also doing check across whole page so we catch issues like h1 not being used - expect(page).to be_axe_clean.skipping("color-contrast").excluding("[data-lat]") - end end it "Adding a comment" do @@ -99,14 +93,8 @@ end describe "accessibility tests", js: true do - it "main content passes" do - # Limiting check to main content to ignore (for the time being) colour contrast issues with the header and footer - expect(page).to be_axe_clean.within("main") - end - - it "page passes most" do - # Also doing check across whole page so we catch issues like h1 not being used - expect(page).to be_axe_clean.skipping("color-contrast") + it "passes" do + expect(page).to be_axe_clean end end diff --git a/spec/features/documentation_pages_spec.rb b/spec/features/documentation_pages_spec.rb index 347f17952..91a5fe3d4 100644 --- a/spec/features/documentation_pages_spec.rb +++ b/spec/features/documentation_pages_spec.rb @@ -20,14 +20,8 @@ end describe "accessibility test", js: true do - it "main content passes" do - # Limiting check to main content to ignore (for the time being) colour contrast issues with the header and footer - expect(page).to be_axe_clean.within("main") - end - - it "page passes most" do - # Also doing check across whole page so we catch issues like h1 not being used - expect(page).to be_axe_clean.skipping("color-contrast") + it "passes" do + expect(page).to be_axe_clean end end end @@ -44,14 +38,8 @@ end describe "accessibility tests", js: true do - it "main content passes" do - # Limiting check to main content to ignore (for the time being) colour contrast issues with the header and footer - expect(page).to be_axe_clean.within("main") - end - - it "page passes most" do - # Also doing check across whole page so we catch issues like h1 not being used - expect(page).to be_axe_clean.skipping("color-contrast") + it "passes" do + expect(page).to be_axe_clean end end end @@ -63,14 +51,8 @@ end describe "accessibility tests", js: true do - it "main content passes" do - # Limiting check to main content to ignore (for the time being) colour contrast issues with the header and footer - expect(page).to be_axe_clean.within("main") - end - - it "page passes most" do - # Also doing check across whole page so we catch issues like h1 not being used - expect(page).to be_axe_clean.skipping("color-contrast") + it "passes" do + expect(page).to be_axe_clean end end end @@ -82,14 +64,8 @@ end describe "accessibility tests", js: true do - it "main content passes" do - # Limiting check to main content to ignore (for the time being) colour contrast issues with the header and footer - expect(page).to be_axe_clean.within("main") - end - - it "page passes most" do - # Also doing check across whole page so we catch issues like h1 not being used - expect(page).to be_axe_clean.skipping("color-contrast") + it "passes" do + expect(page).to be_axe_clean end end end diff --git a/spec/features/home_page_spec.rb b/spec/features/home_page_spec.rb index ac6330133..00475bfac 100644 --- a/spec/features/home_page_spec.rb +++ b/spec/features/home_page_spec.rb @@ -13,13 +13,8 @@ visit root_path end - it "passes most" do - expect(page).to be_axe_clean.skipping("color-contrast") - end - - it "passes color-contrast" do - pending "there are still outstanding issues" - expect(page).to be_axe_clean.checking_only("color-contrast") + it "passes" do + expect(page).to be_axe_clean end end end diff --git a/spec/features/search_for_applications_spec.rb b/spec/features/search_for_applications_spec.rb index 96bd3abf7..bac0205fe 100644 --- a/spec/features/search_for_applications_spec.rb +++ b/spec/features/search_for_applications_spec.rb @@ -64,14 +64,8 @@ click_button "Search" end - it "main content passes" do - # Limiting check to main content to ignore (for the time being) colour contrast issues with the header and footer - expect(page).to be_axe_clean.within("main") - end - - it "page passes most" do - # Also doing check across whole page so we catch issues like h1 not being used - expect(page).to be_axe_clean.skipping("color-contrast") + it "passes" do + expect(page).to be_axe_clean end end @@ -81,12 +75,8 @@ visit address_applications_path end - it "main content passes" do - expect(page).to be_axe_clean.within("main") - end - - it "mostly passes" do - expect(page).to be_axe_clean.skipping("color-contrast") + it "passes" do + expect(page).to be_axe_clean end end