test: JS_LOG allows multiple events
This commit is contained in:
parent
af5ba81e97
commit
55cc48b785
2 changed files with 3 additions and 3 deletions
|
@ -144,7 +144,7 @@ Pour exécuter les tests de l'application, plusieurs possibilités :
|
|||
|
||||
- Afficher les logs js en error issus de la console du navigateur `console.error('coucou')`
|
||||
|
||||
JS_LOG=error bin/rspec spec/system
|
||||
JS_LOG=debug,log,error bin/rspec spec/system
|
||||
|
||||
- Augmenter la latence lors de tests end2end pour déceler des bugs récalcitrants
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ def setup_driver(app, download_path, options)
|
|||
|
||||
if ENV['JS_LOG'].present?
|
||||
driver.browser.on_log_event(:console) do |event|
|
||||
puts event.args if event.type == ENV['JS_LOG'].downcase.to_sym
|
||||
puts event.args.join(" ") if event.type.in? ENV['JS_LOG'].downcase.split(',').map(&:to_sym)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue