diff --git a/Gemfile b/Gemfile index 2e10ff81d..8a7d7b6f5 100644 --- a/Gemfile +++ b/Gemfile @@ -84,6 +84,7 @@ gem 'zipline' gem 'zxcvbn-ruby', require: 'zxcvbn' group :test do + gem 'axe-core-rspec' # accessibility rspec matchers gem 'capybara' # Integration testing gem 'capybara-email' # Access emails during integration tests gem 'capybara-screenshot' # Save a dump of the page when an integration test fails @@ -114,7 +115,6 @@ group :development do end group :development, :test do - gem 'axe-matchers' # accessibility rspec matchers gem 'graphql-schema_comparator' gem 'mina', git: 'https://github.com/mina-deploy/mina.git', require: false # Deploy gem 'pry-byebug' # Call 'byebug' anywhere in the code to stop execution and get a debugger console diff --git a/Gemfile.lock b/Gemfile.lock index 5958fdbd4..d5b56654c 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -108,9 +108,16 @@ GEM attr_encrypted (3.1.0) encryptor (~> 3.0.0) attr_required (1.0.1) - axe-matchers (2.6.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) @@ -230,11 +237,10 @@ GEM dotenv (= 2.7.6) railties (>= 3.2) dry-inflector (0.2.0) - dumb_delegator (0.8.1) + dumb_delegator (1.0.0) ecma-re-validator (0.3.0) regexp_parser (~> 2.0) encryptor (3.0.0) - equalizer (0.0.11) erubi (1.10.0) erubis (2.7.0) et-orbi (1.2.4) @@ -731,13 +737,15 @@ GEM activemodel (>= 3.0.0) public_suffix vcr (6.0.0) - 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) warden (1.2.9) rack (>= 2.0.9) + watir (6.19.1) + regexp_parser (>= 1.2, < 3) + selenium-webdriver (>= 3.142.7) web-console (4.1.0) actionview (>= 6.0.0) activemodel (>= 6.0.0) @@ -785,7 +793,7 @@ DEPENDENCIES after_party anchored annotate - axe-matchers + axe-core-rspec bcrypt bootsnap (>= 1.4.4) brakeman diff --git a/spec/features/accessibilite/wcag_usager_spec.rb b/spec/features/accessibilite/wcag_usager_spec.rb index d21fc6758..a6a716129 100644 --- a/spec/features/accessibilite/wcag_usager_spec.rb +++ b/spec/features/accessibilite/wcag_usager_spec.rb @@ -10,12 +10,12 @@ feature 'wcag rules for usager', js: true do context 'pages without the need to be logged in' do scenario 'homepage' do visit root_path - expect(page).to be_accessible + expect(page).to be_axe_clean end scenario 'sign_up page' do visit new_user_registration_path - expect(page).to be_accessible + expect(page).to be_axe_clean end scenario 'account confirmation page' do @@ -26,23 +26,23 @@ feature 'wcag rules for usager', js: true do perform_enqueued_jobs do click_button 'Créer un compte' - expect(page).to be_accessible + expect(page).to be_axe_clean end end scenario 'sign_in page' do visit new_user_session_path - expect(page).to be_accessible.excluding '#user_email' + expect(page).to be_axe_clean.excluding '#user_email' end scenario 'contact page' do visit contact_path - expect(page).to be_accessible + expect(page).to be_axe_clean end scenario 'commencer page' do visit commencer_path(path: procedure.reload.path) - expect(page).to be_accessible + expect(page).to be_axe_clean end end @@ -54,7 +54,7 @@ feature 'wcag rules for usager', js: true do scenario 'écran identité usager' do click_on 'Commencer la démarche' - expect(page).to be_accessible + expect(page).to be_axe_clean end # with no surprise, there's a lot of work on this one @@ -66,7 +66,7 @@ feature 'wcag rules for usager', js: true do fill_in('individual_nom', with: 'nom') click_on 'Continuer' - expect(page).to be_accessible.skipping :'aria-input-field-name' + expect(page).to be_axe_clean.skipping :'aria-input-field-name' end end @@ -80,7 +80,7 @@ feature 'wcag rules for usager', js: true do scenario "écran identification de l'entreprise" do click_on 'Commencer la démarche' - expect(page).to be_accessible.skipping :label + expect(page).to be_axe_clean.skipping :label end end @@ -92,37 +92,37 @@ feature 'wcag rules for usager', js: true do scenario 'liste des dossiers' do visit dossiers_path - expect(page).to be_accessible + expect(page).to be_axe_clean end scenario 'dossier' do visit dossier_path(dossier) - expect(page).to be_accessible.skipping :'aria-input-field-name' + expect(page).to be_axe_clean.skipping :'aria-input-field-name' end scenario 'merci' do visit merci_dossier_path(dossier) - expect(page).to be_accessible + expect(page).to be_axe_clean end scenario 'demande' do visit demande_dossier_path(dossier) - expect(page).to be_accessible + expect(page).to be_axe_clean end scenario 'messagerie' do visit messagerie_dossier_path(dossier) - expect(page).to be_accessible + expect(page).to be_axe_clean end scenario 'modifier' do visit modifier_dossier_path(dossier) - expect(page).to be_accessible.skipping :'aria-input-field-name' + expect(page).to be_axe_clean.skipping :'aria-input-field-name' end scenario 'brouillon' do visit brouillon_dossier_path(dossier) - expect(page).to be_accessible.skipping :'aria-input-field-name' + expect(page).to be_axe_clean.skipping :'aria-input-field-name' end end end diff --git a/spec/rails_helper.rb b/spec/rails_helper.rb index e04495eb9..5141112b9 100644 --- a/spec/rails_helper.rb +++ b/spec/rails_helper.rb @@ -10,7 +10,7 @@ abort("The Rails environment is running in production mode!") if Rails.env.produ require 'rspec/rails' # Add additional requires below this line. Rails is not loaded until this point! -require 'axe/rspec' +require 'axe-rspec' require 'devise' require 'shoulda-matchers'