
The following code is saved in the file puppeteertest.js. Puppeteer uses several defaults that can be customized through configurationįor example, to change the default cache directory Puppeteer uses to installīrowsers, you can add a. Once Puppeteer is set up, write the test script using JavaScript. Include $HOME/.cache into the project's deployment.įor a version of Puppeteer without the browser installation, see

Your project folder (see an example below) because not all hosting providers Heroku, you might need to reconfigure the location of the cache to be within

If you deploy a project using Puppeteer to a hosting provider, such as Render or Step 1: Create an empty directory let’s name it puppeteer-demo. For instance, there is a package called jest-puppeteer, which helps us integrate. The browser is downloaded to the $HOME/.cache/puppeteer folderīy default (starting with Puppeteer v19.0.0). Setting up Puppeteer and Jest Automation Tool. Access the full title and Packt library for free now with a free trial. This is where youll be writing the test for the title of your homepage. When you install Puppeteer, it automatically downloads a recent version ofĬhrome for Testing (~170MB macOS, ~282MB Linux, ~280MB Windows) that is guaranteed to Create an file in the src folder of your project.
