test: split out headful tests into headful.spec.js (#2657)

This commit is contained in:
Andrey Lushnikov
2018-06-01 13:48:34 -07:00
committed by GitHub
parent e03802688d
commit 07b91f61a9
4 changed files with 82 additions and 48 deletions

View File

@@ -35,7 +35,6 @@ const RESET_COLOR = '\x1b[0m';
const headless = (process.env.HEADLESS || 'true').trim().toLowerCase() === 'true';
const executablePath = process.env.CHROME;
const extensionPath = path.resolve(__dirname, '../test/assets/simple-extension');
if (executablePath)
console.warn(`${YELLOW_COLOR}WARN: running tests with ${executablePath}${RESET_COLOR}`);
@@ -50,15 +49,6 @@ const defaultBrowserOptions = {
dumpio: (process.env.DUMPIO || 'false').trim().toLowerCase() === 'true',
args: ['--no-sandbox']
};
const browserWithExtensionOptions = {
headless: false,
executablePath,
args: [
'--no-sandbox',
`--disable-extensions-except=${extensionPath}`,
`--load-extension=${extensionPath}`,
],
};
let parallel = 1;
if (process.env.PPTR_PARALLEL_TESTS)
@@ -153,12 +143,13 @@ describe('Page', function() {
require('./jshandle.spec.js').addTests({testRunner, expect});
require('./network.spec.js').addTests({testRunner, expect});
require('./page.spec.js').addTests({testRunner, expect, puppeteer, DeviceDescriptors, headless});
require('./target.spec.js').addTests({testRunner, expect, puppeteer, browserWithExtensionOptions});
require('./target.spec.js').addTests({testRunner, expect, puppeteer});
require('./tracing.spec.js').addTests({testRunner, expect});
});
// Top-level tests that launch Browser themselves.
require('./puppeteer.spec.js').addTests({testRunner, expect, PROJECT_ROOT, defaultBrowserOptions});
require('./headful.spec.js').addTests({testRunner, expect, PROJECT_ROOT, defaultBrowserOptions});
if (process.env.COVERAGE) {
describe('COVERAGE', function() {