Setting up Puppeteer

Let's first set up the directory and install the packages:

$ mkdir test-compose/notesui$ cd test-compose/notesui$ npm init... answer the questions$ npm install puppeteer@1.1.x mocha@5.x chai@4.1.x --save

During installation, you'll see that Puppeteer causes the download of Chromium like so:

Downloading Chromium r497674 - 92.5 Mb [====================] 100% 0.0s 

The puppeteer module will launch that Chromium instance as needed, managing it as a background process, and communicating with it using the DevTools protocol.

In the script we're about to write, we need a user account that we can use to log in and perform some actions. Fortunately, we already have a script to set up a test account. In users/package.json, add this ...

Get Node.js Web Development - Fourth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.