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
|
end
|
||||||
|
|
||||||
def blur
|
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
|
end
|
||||||
|
|
||||||
def pause
|
def pause
|
||||||
|
|
|
@ -128,13 +128,13 @@ describe 'The user' do
|
||||||
expect(page).to have_field('sub type de champ', with: 'super texte')
|
expect(page).to have_field('sub type de champ', with: 'super texte')
|
||||||
|
|
||||||
click_on 'Ajouter un élément pour'
|
click_on 'Ajouter un élément pour'
|
||||||
|
expect(page).to have_content('Supprimer', count: 2)
|
||||||
|
|
||||||
within '.repetition .row:first-child' do
|
within '.repetition .row:first-child' do
|
||||||
fill_in('sub type de champ', with: 'un autre texte')
|
fill_in('sub type de champ', with: 'un autre texte')
|
||||||
|
blur
|
||||||
end
|
end
|
||||||
|
|
||||||
expect(page).to have_content('Supprimer', count: 2)
|
|
||||||
|
|
||||||
expect do
|
expect do
|
||||||
within '.repetition .row:first-child' do
|
within '.repetition .row:first-child' do
|
||||||
click_on 'Supprimer l’élément'
|
click_on 'Supprimer l’élément'
|
||||||
|
|
Loading…
Reference in a new issue