Merge pull request #9703 from colinux/fix-flaky-repetition
Test: fix flaky brouillon on repetition
This commit is contained in:
commit
a3cba47d4b
2 changed files with 7 additions and 3 deletions
|
@ -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
|
||||
|
|
|
@ -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'
|
||||
|
|
Loading…
Reference in a new issue