This article is a work in progress.
Helper class primarily intended for automating browser tests from Node.js shell scripts. A RenderTestDriver
starts a Chrome browser instance and a server and opens a page with a URL that loads a script from the server. The script that runs in the browser is expected to be using the RenderTest
class.
For details on how the automation works, see the probe.gl BrowserDriver
class.
In your node.js start script:
// This is the script that runs in Node.js and starts the browser
const {BrowserTestDriver} = require('probe.gl/test-utils');
new BrowserTestDriver().run({
process: 'webpack-dev-server',
parameters: ['--env.render']
});
Create a BrowserTestDriver
instance.
new BrowserTestDriver()
renderTestDriver.run()
Runs the tests:
- starts a Chrome browser instance,
- starts a server (typically a webpack-dev-server) that bundles a test script.
- the test script renders a set of tests (described below), compares the output against golden images
- closes down all processes and browser tabs.
- the test script returns a pass/fail value to the
BrowserTestDriver
which ultimately passes back a0
(success) or1
failure to the invoking shell.