Skip to content

Commit

Permalink
Upgrade axe-matchers to axe-core-rspec
Browse files Browse the repository at this point in the history
[#267]

Co-authored-by: Ben Golder <[email protected]>
  • Loading branch information
Colt Borg and bengolder committed Jul 26, 2021
1 parent 0537424 commit 8578a64
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 23 deletions.
24 changes: 16 additions & 8 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,16 @@ GEM
ast (2.4.1)
autoprefixer-rails (10.2.4.0)
execjs
axe-matchers (2.2.1)
dumb_delegator (~> 0.8)
virtus (~> 1.0)
axe-core-api (4.2.1)
capybara
dumb_delegator
selenium-webdriver
virtus
watir
axe-core-rspec (4.2.1)
axe-core-api
dumb_delegator
virtus
axiom-types (0.1.1)
descendants_tracker (~> 0.0.4)
ice_nine (~> 0.11.0)
Expand Down Expand Up @@ -89,8 +96,7 @@ GEM
thread_safe (~> 0.3, >= 0.3.1)
diff-lcs (1.4.4)
dotenv (2.7.6)
dumb_delegator (0.8.1)
equalizer (0.0.11)
dumb_delegator (1.0.0)
erubi (1.10.0)
execjs (2.7.0)
faraday (1.3.0)
Expand Down Expand Up @@ -258,11 +264,13 @@ GEM
uglifier (4.2.0)
execjs (>= 0.3.0, < 3)
unicode-display_width (1.4.1)
virtus (1.0.5)
virtus (2.0.0)
axiom-types (~> 0.1)
coercible (~> 1.0)
descendants_tracker (~> 0.0, >= 0.0.3)
equalizer (~> 0.0, >= 0.0.9)
watir (6.19.1)
regexp_parser (>= 1.2, < 3)
selenium-webdriver (>= 3.142.7)
websocket-driver (0.7.3)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.5)
Expand All @@ -273,7 +281,7 @@ PLATFORMS
ruby

DEPENDENCIES
axe-matchers (~> 2.2)
axe-core-rspec (~> 4.2.1)
bundler (~> 1.16)
capybara
capybara-selenium
Expand Down
2 changes: 1 addition & 1 deletion cfa-styleguide.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Gem::Specification.new do |spec|
spec.add_runtime_dependency "bourbon"
spec.add_runtime_dependency "jquery-rails"
spec.add_runtime_dependency "sass"
spec.add_development_dependency "axe-matchers", "~> 2.2"
spec.add_development_dependency "axe-core-rspec", "~> 4.2.1"
spec.add_development_dependency "bundler", "~> 1.16"
spec.add_development_dependency "capybara"
spec.add_development_dependency "capybara-selenium"
Expand Down
2 changes: 1 addition & 1 deletion spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

require File.expand_path("test_app/config/environment.rb", __dir__)
require "rspec/rails"
require "axe/rspec"
require "axe-rspec"

Rails.backtrace_cleaner.remove_silencers!

Expand Down
21 changes: 8 additions & 13 deletions spec/system/accessibility_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,34 +11,29 @@
].freeze

## Examples with accessibility issues that must be fixed in the fullness of time
FIXABLE_ACCESSIBILITY_EXAMPLES = [
FAILING_ACCESSIBILITY_EXAMPLES = [
"form_builder/v1/cfa_checkbox_set",
"form_builder/v1/cfa_checkbox_set_with_none",
"form_builder/v1/cfa_date_select",
"form_builder/v1/cfa_input_field",
"form_builder/v1/cfa_radio_set",
"form_builder/v1/cfa_radio_set_with_follow_up",
"form_builder/v1/cfa_range_field",
"form_builder/v1/cfa_select",
"form_builder/v1/cfa_textarea",
"molecules/form_group",
"molecules/form_group_error_state",
"molecules/incrementer",
"molecules/inline_input_group",
"molecules/searchbar",
"molecules/text_input_group",
"molecules/two_up_input_group",
# New issues coming from axe-core-rspec upgrade
"molecules/progress_step_bar",
"molecules/show_more",
"organisms/pagination",
].freeze

RSpec.describe "Acessibility", js: true do
RSpec.describe "Accessibility", js: true do
each_example do |example, example_path|
describe example do
it "passes Axe matchers" do
pending("temporarily ignoring accessibility checks") if FIXABLE_ACCESSIBILITY_EXAMPLES.include?(example)
pending("temporarily ignoring accessibility checks: #{example}") if FAILING_ACCESSIBILITY_EXAMPLES.include?(example)

visit example_path

expect(page).to be_accessible.skipping(*GENERAL_ACCESSIBILITY_SKIPS)
expect(page).to be_axe_clean.skipping(*GENERAL_ACCESSIBILITY_SKIPS).according_to :wcag2a
end
end
end
Expand Down

0 comments on commit 8578a64

Please sign in to comment.