Skip to content

Commit

Permalink
We can now simplify the automated accessibility tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mlandauer committed Oct 31, 2023
1 parent d8301e3 commit b1419e0
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 69 deletions.
20 changes: 4 additions & 16 deletions spec/features/comment_to_authority_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down
40 changes: 8 additions & 32 deletions spec/features/documentation_pages_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
9 changes: 2 additions & 7 deletions spec/features/home_page_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
18 changes: 4 additions & 14 deletions spec/features/search_for_applications_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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

Expand Down

0 comments on commit b1419e0

Please sign in to comment.