From 7779aa648f1f25ca311dc0a7c72201f9a9770c03 Mon Sep 17 00:00:00 2001 From: Martin Date: Tue, 29 Aug 2023 15:47:28 +0200 Subject: [PATCH] tech(test.flacky): utilise click_on en lieu et place de wait_for_autosave sur dossier_shared_examples.rb supprime un parametre inutile de la methode wait_for_autosave --- spec/support/system_helpers.rb | 2 +- spec/system/routing/rules_full_scenario_spec.rb | 4 ++-- spec/system/users/brouillon_spec.rb | 2 +- spec/system/users/dossier_shared_examples.rb | 1 - 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/spec/support/system_helpers.rb b/spec/support/system_helpers.rb index eb0e006d8..b3cd3f13d 100644 --- a/spec/support/system_helpers.rb +++ b/spec/support/system_helpers.rb @@ -172,7 +172,7 @@ module SystemHelpers find(:xpath, ".//label[contains(text()[normalize-space()], '#{libelle}')]")[:for] end - def wait_for_autosave(brouillon = true) + def wait_for_autosave blur expect(page).to have_css('.debounced-empty') # no more debounce expect(page).to have_css('.autosave-state-idle') # no more in flight promise diff --git a/spec/system/routing/rules_full_scenario_spec.rb b/spec/system/routing/rules_full_scenario_spec.rb index 50280fef7..a860d8839 100644 --- a/spec/system/routing/rules_full_scenario_spec.rb +++ b/spec/system/routing/rules_full_scenario_spec.rb @@ -187,7 +187,7 @@ describe 'The routing with rules', js: true do click_on 'Modifier mon dossier' fill_in litteraire_user.dossiers.first.champs_public.first.libelle, with: 'some value' - wait_for_autosave(false) + wait_for_autosave click_on 'Déposer les modifications' @@ -286,7 +286,7 @@ describe 'The routing with rules', js: true do click_on "Modifier mon dossier" choose(new_group) - wait_for_autosave(false) + wait_for_autosave expect(page).to have_text(new_group) diff --git a/spec/system/users/brouillon_spec.rb b/spec/system/users/brouillon_spec.rb index 2a3699083..cd5caf281 100644 --- a/spec/system/users/brouillon_spec.rb +++ b/spec/system/users/brouillon_spec.rb @@ -466,7 +466,7 @@ describe 'The user' do expect(page).to have_no_css('label', text: 'tonnage', visible: true) fill_in('age du candidat (facultatif)', with: '18') - wait_for_autosave(false) + wait_for_autosave # the champ keeps their previous value so they are all displayed expect(page).to have_css('label', text: 'permis de conduire', visible: true) diff --git a/spec/system/users/dossier_shared_examples.rb b/spec/system/users/dossier_shared_examples.rb index 638a9ae96..b4a3e0ee8 100644 --- a/spec/system/users/dossier_shared_examples.rb +++ b/spec/system/users/dossier_shared_examples.rb @@ -10,7 +10,6 @@ RSpec.shared_examples 'the user can edit the submitted demande' do expect(page).to have_current_path(modifier_dossier_path(dossier)) fill_in('Texte obligatoire', with: 'Nouveau texte') - wait_for_autosave(false) click_on 'Déposer les modifications' click_on 'Demande'