Measuring code coverage is also considered a powerful capability within software test automation. Like Playwright, Puppeteer JavaScript and CSS code coverage with Istanbul is only supported on Chromium-based browsers.

Puppeteer namespaces

Within the Puppeteer framework, we can utilize the device’s methods, network conditions, and error-handling capabilities.

To perform web application testing on specific devices, including mobile viewports, we can utilize the puppeteer.devices['DEVICE NAME'], page.emulateNetworkConditions(), and page.emulate() methods.

Note: We can find all of the supported page.emulate() APIs with code samples in the documentation.

Now, let’s try navigating to the Packt website using the following code:

Get hands-on with 1200+ tech skills courses.