mirror of https://github.com/keeweb/keeweb.git
fix: modify puppeteer arguments to fix test builds for ci keeweb/keeweb#2142
ref: keeweb/keeweb#2142
This commit is contained in:
parent
f8af64e45b
commit
2aa6e05b53
|
@ -3,21 +3,22 @@ module.exports = function (grunt) {
|
||||||
const done = this.async();
|
const done = this.async();
|
||||||
const opt = this.options();
|
const opt = this.options();
|
||||||
const file = this.files[0].src[0];
|
const file = this.files[0].src[0];
|
||||||
|
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
const puppeteer = require('puppeteer');
|
const puppeteer = require('puppeteer');
|
||||||
|
|
||||||
(async function () {
|
(async function () {
|
||||||
grunt.log.writeln('Running tests...');
|
grunt.log.writeln('Running tests...');
|
||||||
|
|
||||||
const fullPath = 'file://' + path.resolve(file);
|
const fullPath = 'file://' + path.resolve(file);
|
||||||
|
|
||||||
const browser = await puppeteer.launch({
|
const browser = await puppeteer.launch({
|
||||||
headless: opt.headless
|
headless: opt.headless,
|
||||||
|
executablePath: process.env.CHROME_BIN || null,
|
||||||
|
args: ['--disable-dev-shm-usage']
|
||||||
});
|
});
|
||||||
|
grunt.log.writeln('puppeteer launched...');
|
||||||
const page = await browser.newPage();
|
const page = await browser.newPage();
|
||||||
await page.goto(fullPath);
|
await page.goto(fullPath);
|
||||||
|
|
||||||
async function check() {
|
async function check() {
|
||||||
const result = await page.evaluate(() => {
|
const result = await page.evaluate(() => {
|
||||||
const { output, done } = window;
|
const { output, done } = window;
|
||||||
|
|
Loading…
Reference in New Issue