Skip to content

Commit

Permalink
Upgrade puppeteer and chromium (#465)
Browse files Browse the repository at this point in the history
Signed-off-by: Joshua Li <joshuali925@gmail.com>
  • Loading branch information
joshuali925 authored Sep 13, 2022
1 parent a60c08c commit 08f1a27
Show file tree
Hide file tree
Showing 3 changed files with 185 additions and 68 deletions.
4 changes: 2 additions & 2 deletions dashboards-reports/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"jquery": "^3.5.0",
"jsdom": "13.1.0",
"json-2-csv": "^3.7.6",
"puppeteer-core": "^1.19.0",
"puppeteer-core": "^13.7.0",
"react-addons-test-utils": "^15.6.2",
"react-id-generator": "^3.0.1",
"react-markdown": "^4.3.1",
Expand All @@ -44,7 +44,7 @@
"@types/dompurify": "^2.3.3",
"@types/enzyme-adapter-react-16": "^1.0.6",
"@types/jsdom": "^16.2.3",
"@types/puppeteer-core": "^2.0.0",
"@types/puppeteer-core": "^5.4.0",
"@types/react": "^16.9.36",
"@types/react-addons-test-utils": "^0.14.25",
"@types/react-dom": "^16.9.8",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ export const createVisualReport = async (
'--disable-setuid-sandbox',
'--disable-gpu',
'--no-zygote',
'--single-process',
'--font-render-hinting=none',
'--js-flags="--jitless --no-opt"',
'--disable-features=V8OptimizeJavascript',
Expand All @@ -86,6 +85,7 @@ export const createVisualReport = async (
env: {
TZ: timezone || 'UTC',
},
pipe: true,
});
const page = await browser.newPage();

Expand Down Expand Up @@ -177,7 +177,7 @@ export const createVisualReport = async (
);

// force wait for any resize to load after the above DOM modification
await page.waitFor(1000);
await new Promise(resolve => setTimeout(resolve, 1000));
// crop content
switch (reportSource) {
case REPORT_TYPE.dashboard:
Expand Down Expand Up @@ -327,6 +327,6 @@ const waitForDynamicContent = async (
}

previousLength = currentLength;
await page.waitFor(interval);
await new Promise(resolve => setTimeout(resolve, interval));
}
};
Loading

0 comments on commit 08f1a27

Please sign in to comment.