Allow browser console logs to be retrieved for unit tests #1144
Labels
effort-medium
This may take a couple of days
enhancement
A new or improved feature
priority-low
We'll get to this eventually
Intern should provide an easy way to retrieve logs from remote test sessions.
Requirements
How to retrieve logs
There are a couple ways to implement this. The webdriver API provides a
getLogsFor
method to retrieve logs. Intern could call that on a session suite when the session is completed to retrieve logs before closing the remote. That method isn't part of the WebDriver spec, though, so it may not be supported in all browsers.Another option would be for Intern to override the console methods to capture them and send them back to the host. This is probably the better solution because it provides Intern finer control over what is captured and allows logs to be sent back to the host immediately rather than at the end of a test or session.
If the second option is implemented, logs could be emitted as events on the Intern host as they are received.
Configuration
Log capture should be disabled by default, both to minimize the performance impact (there may be a lot of log data) and to prevent intern from breaking any pre-existing modifications to the browser logging system.
Intern should provide config options allowing logging to be enabled on a session-specific basis and allowing logs to be captured to files. The example below is one possible way to handle the config:
The text was updated successfully, but these errors were encountered: