Merge pull request #9703 from colinux/fix-flaky-repetition

Test: fix flaky brouillon on repetition
This commit is contained in:
Colin Darie 2023-11-14 09:33:04 +00:00 committed by GitHub
commit a3cba47d4b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 3 deletions

View file

@ -81,7 +81,11 @@ module SystemHelpers
end
def blur
page.find('body').click
if page.has_css?('body', wait: 0)
page.find('body').click
else # page after/inside a `within` block does not match body
page.first('div').click
end
end
def pause

View file

@ -128,13 +128,13 @@ describe 'The user' do
expect(page).to have_field('sub type de champ', with: 'super texte')
click_on 'Ajouter un élément pour'
expect(page).to have_content('Supprimer', count: 2)
within '.repetition .row:first-child' do
fill_in('sub type de champ', with: 'un autre texte')
blur
end
expect(page).to have_content('Supprimer', count: 2)
expect do
within '.repetition .row:first-child' do
click_on 'Supprimer lélément'