fix headless chrome

This commit is contained in:
Marco Zeisler 2021-05-11 21:48:28 +02:00
parent a5f1cc5eff
commit b1692e4e45
3 changed files with 315 additions and 232 deletions

View File

@ -1,10 +1,9 @@
// Karma configuration file, see link for more information // Karma configuration file, see link for more information
// https://karma-runner.github.io/1.0/config/configuration-file.html // https://karma-runner.github.io/1.0/config/configuration-file.html
process.env.CHROME_BIN = require('puppeteer').executablePath();
module.exports = function (config) { module.exports = function (config) {
const puppeteer = require('puppeteer');
// noinspection JSUnresolvedFunction
process.env.CHROME_BIN = puppeteer.executablePath();
config.set({ config.set({
basePath: '', basePath: '',
frameworks: ['jasmine', '@angular-devkit/build-angular'], frameworks: ['jasmine', '@angular-devkit/build-angular'],
@ -43,16 +42,14 @@ module.exports = function(config) {
logLevel: config.LOG_INFO, logLevel: config.LOG_INFO,
autoWatch: true, autoWatch: true,
// browsers: ['Chrome', 'ChromeHeadless'], // browsers: ['Chrome', 'ChromeHeadless'],
browsers: ['ChromeHeadless'], browsers: ['MyChromeHeadless'],
customLaunchers: { customLaunchers: {
ChromeHeadless: { MyChromeHeadless: {
base: 'Chrome', base: 'ChromeHeadless',
flags: [ flags: [
'--headless',
'--no-sandbox', '--no-sandbox',
'--disable-setuid-sandbox', '--disable-setuid-sandbox',
'--disable-gpu', '--disable-gpu',
'--disable-dev-shm-usage',
'--remote-debugging-port=9222', '--remote-debugging-port=9222',
], ],
}, },

File diff suppressed because it is too large Load Diff

View File

@ -29,6 +29,7 @@
"angular2-jwt": "^0.2.3", "angular2-jwt": "^0.2.3",
"bootstrap": "~4.3.1", "bootstrap": "~4.3.1",
"jquery": "3.5.1", "jquery": "3.5.1",
"karma-phantomjs-launcher": "1.0.4",
"ngx-logger": "4.1.9", "ngx-logger": "4.1.9",
"popper.js": "1.16.0", "popper.js": "1.16.0",
"rxjs": "^6.5.5", "rxjs": "^6.5.5",