[IMP] core: reporting of browser logs / errors during setup
Sink handling of JS logging, exceptions and websocket timeouts so calls other than _wait_code_ok handle them somewhat properly: the issue fixed by odoo/odoo#41231 passed because it occurred during module loading, which happens during initial page loading (browser_js > navigate_to > _websocket_wait_event), which ignored logs (and exceptions though here it's a console.error log), and as a result reported no failure (and would simply miss that specific test as well as every test following it). Also since ChromeBrowser treats console.error as an exception, important messages should be logged atomically. Merge two consecutive console.error into a single one at the loading of modules so we don't just get an exception "error while loading foo.bar" without any of the useful details. That ChromeBrowser treats console.error as exception is also why the new method gets a flag (to suppress this behaviour): in the case of two console.error, upon encountering the first it's treated as an error so we try to take a screenshot, which goes through the messages in order to get the screenshot response, which encounters the second console.error, which gets treated as an exception, which hides the first error. Instead, screenshotting (and more generally _websocket_wait_id) should treat console.error as a regular logging call, probably. Also run JS tests in debug=assets for easier debugging (ha!) and improve formatting of exception object when receiving an exception: * if we can get a description on an `exception` remote object just print that, it's formatted to show the exception type, message & traceback * otherwise format the garbage that is an "ExceptionDetails" object
Loading
Please register or sign in to comment