I'm using Rspec/Capybara with Poltergeist as a driver to write tests for some large web applications.
My issue is that I would like to record the messages that appear on the console, but so far I've been unable to do so.
I am aware of the options js_errors and phantomjs_logger, but I have had some issues with them:
- if I set
js_errors: false, the file I specify inphantomjs_loggerstays empty; - if I set
js_errors: true,console.logmessages are logged in the file specified inphantomjs_logger, but then almost all my specs fail because of javascript errors that may not even be relevant to the navigation example I'm testing.
Any idea on how I can save the console messages while not breaking specs on every js error?
CLARIFICATION: I have no control over the development, my task is to check the stability of the whole stack of the applications in the various environments, accessing from the front-end, so clearing out all the javascript errors is out of the question. The specs I'm writing are also supposed to ignore javascript errors if they don't impair the usage of the interface.
phantomjs_loggeroption to get all messages send toconsole.logvia js? - slowjack2k