From 71c4fd49096dea4dffcb4f58d9f25ef0ca0b1679 Mon Sep 17 00:00:00 2001 From: Paul Irish Date: Mon, 11 Jan 2021 15:31:50 -0800 Subject: [PATCH] docs(chromium-web-tests): add debugging tips (#11684) --- lighthouse-core/test/chromium-web-tests/README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lighthouse-core/test/chromium-web-tests/README.md b/lighthouse-core/test/chromium-web-tests/README.md index 494909f472..12a4e1eadf 100644 --- a/lighthouse-core/test/chromium-web-tests/README.md +++ b/lighthouse-core/test/chromium-web-tests/README.md @@ -14,6 +14,13 @@ yarn test-devtools yarn update:test-devtools ``` +### Debugging + +* Want logs from Lighthouse? Add `log.log('status', '**** hello test output ' + JSON.stringify({obj}));` which will be visible in the `lighthouse-successful-run.js` output thanks to `LighthouseTestRunner.addStatusListener`. +* Want logs from test files? Adding these flags to the invocation `yarn test-devtools --driver-logging --no-retry-failures` will print to terminal. +* Want logs from the inspected page? Add `testRunner.setDumpConsoleMessages(true);` to a test file. (also, [beware](https://source.chromium.org/chromium/chromium/src/+/master:content/web_test/renderer/web_view_test_proxy.cc;l=125-129;drc=437e5d9a05535b9e2cd7b983f78b23ebc3d92b3f) w/e this is about) + + ## How it works Normally, running these webtests requires a full Chromium checkout. However, that takes much too long, so it wouldn't be feasible for daily development or CI. Instead, we: