test(firefox): further unify Puppeteer-Firefox and Puppeteer tests (#3894)

This patch:
- changes Puppeteer-Firefox plumbing of defaultBrowserOptions to align
  with the way we do it for Puppeteer.
- plumbs puppeeteer-dependent Errors and DeviceDescriptors down to every
  test.
- unifies a few tests between Puppeteer-Firefox and Puppeteer.

**Note:** in future, we should expose errors as `puppeteer.errors` and
device descriptors as `puppeteer.devices` to make it easy to pass around
Puppeteer/Puppeteer-Firefox instance.

References #3889.
This commit is contained in:
Andrey Lushnikov
2019-02-02 18:49:12 -07:00
committed by GitHub
parent 47fbb117f5
commit 69c434af75
18 changed files with 185 additions and 85 deletions

View File

@@ -22,7 +22,7 @@ const {Matchers} = require('../utils/testrunner/');
const YELLOW_COLOR = '\x1b[33m';
const RESET_COLOR = '\x1b[0m';
module.exports.addTests = ({testRunner, product, puppeteer, defaultBrowserOptions}) => {
module.exports.addTests = ({testRunner, product, puppeteer, Errors, DeviceDescriptors, defaultBrowserOptions}) => {
const {describe, xdescribe, fdescribe} = testRunner;
const {it, fit, xit} = testRunner;
const {beforeAll, beforeEach, afterAll, afterEach} = testRunner;
@@ -52,6 +52,8 @@ module.exports.addTests = ({testRunner, product, puppeteer, defaultBrowserOption
FFOX,
CHROME,
puppeteer,
Errors,
DeviceDescriptors,
expect,
defaultBrowserOptions,
headless: !!defaultBrowserOptions.headless,