Run tests in Puppeteer.
Use this driver with the Mochify CLI to run Mocha tests in Puppeteer. See Mochify if you are looking for Mochify drivers for other browser testing environments.
Install the package from npm:
npm i @mochify/driver-puppeteer -D
and pass it to the CLI:
mochify --driver puppeteer ...
The driver allows the following options to be set:
-
stderr
: Defines the stream the test output will be written to. Defaults toprocess.stderr
-
ignoreHTTPSErrors
: Whether to ignore HTTPS errors during navigation. Defaults tofalse
. -
executablePath
: The optional path of the Chromium binary to be used. Defaults toprocess.env.PUPPETEER_EXECUTABLE_PATH
to work around puppeteer/puppeteer#6957. In case neither the env var nor a value is given, Puppeteer uses the bundled Chromium version. -
args
: An optional array of command line flags to pass to Chromium.--allow-insecure-localhost
and--disable-dev-shm-usage
will always be used in addition to the given values. -
url
: Run tests in the context of the given URL. Defaults to an empty document served using thefile:
scheme.
In addition to the driver options documented above, driver-puppeteer
allows you to pass through all of Puppeteer's other launchOptions
using the defaults as described here.