May 2018
Intermediate to advanced
492 pages
12h 3m
English
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 ...
Read now
Unlock full access