Automate UI testing with Mocha and Puppeteer (Updated)


Reading Time: 2 minutes Github: 1) yarn add puppeteer mocha chai yarn add puppeteer mocha chai 2) Create bootstrap.js file to share global variables among tests. Expose chai.expect, chai.assert and an instance of browser ‘use strict’; const puppeteer = require(‘puppeteer’); const chai = require(‘chai’); const expect = chai.expect; const globalVariables = { browser: global.browser, expect: global.expect }; // … Read more