Skip to content

Commit

Permalink
fix(test): add some wait
Browse files Browse the repository at this point in the history
  • Loading branch information
E-L-T committed Jul 12, 2024
1 parent 1f10423 commit ad6c67d
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions spec/system/users/brouillon_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,19 +43,22 @@

scroll_to(find_field('communes'), align: :center)
fill_in('communes', with: '60400')
find('.fr-menu__item', text: 'Brétigny (60400)').click
wait_until { page.all('.fr-menu__item').size >= 1 }
find('.fr-menu__item', text: 'Brétigny (60400)', wait: 5).click
wait_until { champ_value_for('communes') == "Brétigny" }

scroll_to(find_field('address'), align: :center)
fill_in('address', with: '78 Rue du Grés 30310 Vergè')
find('.fr-menu__item', text: '78 Rue du Grés 30310 Vergèze').click
wait_until { page.all('.fr-menu__item').size >= 1 }
find('.fr-menu__item', text: '78 Rue du Grés 30310 Vergèze', wait: 5).click
wait_until { champ_value_for('address') == '78 Rue du Grés 30310 Vergèze' }
wait_until { champ_for('address').full_address? }
expect(champ_for('address').departement_code_and_name).to eq('30 – Gard')

scroll_to(find_field('annuaire_education'), align: :center)
fill_in('annuaire_education', with: 'Moulin')
find('.fr-menu__item', text: 'Ecole primaire Jean Moulin, Moulins (0030323K)').click
wait_until { page.all('.fr-menu__item').size >= 1 }
find('.fr-menu__item', text: 'Ecole primaire Jean Moulin, Moulins (0030323K)', wait: 5).click
wait_until { champ_for('annuaire_education').external_id == "0030323K" }

fill_in('dossier_link', with: '123')
Expand Down

0 comments on commit ad6c67d

Please sign in to comment.