One of Puppeteer's core features is to take screenshots, either as PNG or PDF files. In our test scripts, we can take screenshots to track what was on the screen at any given time during the test. For example, if the Login scenario spuriously fails to log in, we can see that in the screenshots:
await page.screenshot({
type: 'png',
path: `./screen/login-01-start.png`
});
Simply add code snippets like this throughout your test script. The filename shown here follows a convention where the first segment names the test scenario, the number is a sequence number within the test scenario, and the last describes the step within the test scenario.
Taking screenshots also provides another stage of validation. You may want to do visual validation of your application as well. The pixelmatch module can compare two PNG files, and therefore a set of so-called Golden Images can be maintained for comparison during test runs.
For an example of using Puppeteer this way, see: https://meowni.ca/posts/2017-puppeteer-tests/.