refactor(spec): add wait_for_autosave helper
This commit is contained in:
parent
4500a5aa04
commit
dd38fa4458
6 changed files with 60 additions and 47 deletions
|
@ -171,6 +171,12 @@ module SystemHelpers
|
|||
def form_id_for(libelle)
|
||||
find(:xpath, ".//label[contains(text()[normalize-space()], '#{libelle}')]")[:for]
|
||||
end
|
||||
|
||||
def wait_for_autosave(brouillon = true)
|
||||
blur
|
||||
expect(page).to have_css('span', text: "#{brouillon ? 'Brouillon' : 'Dossier'} enregistré", visible: true)
|
||||
page.execute_script("document.documentElement.dispatchEvent(new CustomEvent('autosave:reset'));")
|
||||
end
|
||||
end
|
||||
|
||||
RSpec.configure do |config|
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue