2021-10-26 11:44:53 +02:00
|
|
|
describe 'wcag rules for usager', js: true do
|
2020-06-26 15:55:26 +02:00
|
|
|
let(:procedure) { create(:procedure, :with_type_de_champ, :with_all_champs, :with_service, :for_individual, :published) }
|
|
|
|
let(:password) { 'a very complicated password' }
|
|
|
|
let(:litteraire_user) { create(:user, password: password) }
|
|
|
|
|
2021-04-28 15:32:40 +02:00
|
|
|
before do
|
|
|
|
procedure.types_de_champ.find { |tdc| tdc.type_champ == TypeDeChamp.type_champs.fetch(:carte) }.destroy
|
|
|
|
end
|
|
|
|
|
2020-06-26 15:55:26 +02:00
|
|
|
context 'pages without the need to be logged in' do
|
|
|
|
scenario 'homepage' do
|
|
|
|
visit root_path
|
2021-08-13 15:39:03 +02:00
|
|
|
expect(page).to be_axe_clean
|
2020-06-26 15:55:26 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
scenario 'sign_up page' do
|
|
|
|
visit new_user_registration_path
|
2021-08-13 15:39:03 +02:00
|
|
|
expect(page).to be_axe_clean
|
2020-06-26 15:55:26 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
scenario 'account confirmation page' do
|
|
|
|
visit new_user_registration_path
|
|
|
|
|
|
|
|
fill_in :user_email, with: "some@email.com"
|
|
|
|
fill_in :user_password, with: "epeciusetuir"
|
|
|
|
|
|
|
|
perform_enqueued_jobs do
|
|
|
|
click_button 'Créer un compte'
|
2021-08-13 15:39:03 +02:00
|
|
|
expect(page).to be_axe_clean
|
2020-06-26 15:55:26 +02:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
scenario 'sign_in page' do
|
|
|
|
visit new_user_session_path
|
2021-08-13 15:39:03 +02:00
|
|
|
expect(page).to be_axe_clean.excluding '#user_email'
|
2020-06-26 15:55:26 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
scenario 'contact page' do
|
|
|
|
visit contact_path
|
2021-08-13 15:39:03 +02:00
|
|
|
expect(page).to be_axe_clean
|
2020-06-26 15:55:26 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
scenario 'commencer page' do
|
|
|
|
visit commencer_path(path: procedure.reload.path)
|
2021-08-13 15:39:03 +02:00
|
|
|
expect(page).to be_axe_clean
|
2020-06-26 15:55:26 +02:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
context "logged in, depot d'un dossier as individual" do
|
|
|
|
before do
|
|
|
|
login_as litteraire_user, scope: :user
|
|
|
|
visit commencer_path(path: procedure.reload.path)
|
|
|
|
end
|
|
|
|
|
|
|
|
scenario 'écran identité usager' do
|
|
|
|
click_on 'Commencer la démarche'
|
2021-08-13 15:39:03 +02:00
|
|
|
expect(page).to be_axe_clean
|
2020-06-26 15:55:26 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
# with no surprise, there's a lot of work on this one
|
|
|
|
scenario "dépot d'un dossier" do
|
|
|
|
click_on 'Commencer la démarche'
|
|
|
|
|
2020-12-08 17:43:50 +01:00
|
|
|
choose 'Monsieur'
|
2020-06-26 15:55:26 +02:00
|
|
|
fill_in('individual_prenom', with: 'prenom')
|
|
|
|
fill_in('individual_nom', with: 'nom')
|
|
|
|
click_on 'Continuer'
|
|
|
|
|
2021-08-13 15:39:03 +02:00
|
|
|
expect(page).to be_axe_clean.skipping :'aria-input-field-name'
|
2020-06-26 15:55:26 +02:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
context "logged in, depot d'un dossier entreprise" do
|
|
|
|
let(:procedure) { create(:procedure, :with_type_de_champ, :with_all_champs, :with_service, :published) }
|
|
|
|
|
|
|
|
before do
|
|
|
|
login_as litteraire_user, scope: :user
|
|
|
|
visit commencer_path(path: procedure.reload.path)
|
|
|
|
end
|
|
|
|
|
|
|
|
scenario "écran identification de l'entreprise" do
|
|
|
|
click_on 'Commencer la démarche'
|
2021-08-13 15:39:03 +02:00
|
|
|
expect(page).to be_axe_clean.skipping :label
|
2020-06-26 15:55:26 +02:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
context "logged in, avec des dossiers dossiers déposés" do
|
|
|
|
let(:dossier) { create(:dossier, procedure: procedure, user: litteraire_user) }
|
|
|
|
before do
|
|
|
|
login_as litteraire_user, scope: :user
|
|
|
|
end
|
|
|
|
|
|
|
|
scenario 'liste des dossiers' do
|
|
|
|
visit dossiers_path
|
2021-08-13 15:39:03 +02:00
|
|
|
expect(page).to be_axe_clean
|
2020-06-26 15:55:26 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
scenario 'dossier' do
|
|
|
|
visit dossier_path(dossier)
|
2021-08-13 15:39:03 +02:00
|
|
|
expect(page).to be_axe_clean.skipping :'aria-input-field-name'
|
2020-06-26 15:55:26 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
scenario 'merci' do
|
|
|
|
visit merci_dossier_path(dossier)
|
2021-08-13 15:39:03 +02:00
|
|
|
expect(page).to be_axe_clean
|
2020-06-26 15:55:26 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
scenario 'demande' do
|
|
|
|
visit demande_dossier_path(dossier)
|
2021-08-13 15:39:03 +02:00
|
|
|
expect(page).to be_axe_clean
|
2020-06-26 15:55:26 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
scenario 'messagerie' do
|
|
|
|
visit messagerie_dossier_path(dossier)
|
2021-08-13 15:39:03 +02:00
|
|
|
expect(page).to be_axe_clean
|
2020-06-26 15:55:26 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
scenario 'modifier' do
|
|
|
|
visit modifier_dossier_path(dossier)
|
2021-08-13 15:39:03 +02:00
|
|
|
expect(page).to be_axe_clean.skipping :'aria-input-field-name'
|
2020-06-26 15:55:26 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
scenario 'brouillon' do
|
|
|
|
visit brouillon_dossier_path(dossier)
|
2021-08-13 15:39:03 +02:00
|
|
|
expect(page).to be_axe_clean.skipping :'aria-input-field-name'
|
2020-06-26 15:55:26 +02:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|