mirror of
https://github.com/discourse/discourse.git
synced 2025-05-21 18:12:32 +08:00
DEV: Switch from puppeteer to puppeteer-core for smoke test (#15262)
`puppeteer` includes a full chromium binary, which adds more than 300mb to our node_modules directory in development/test mode (and therefore the `discourse_dev` and `discourse_test` docker images). We already reach out to the system copy of Chrome for our qunit tests, and already have chrome installed in our `discourse_dev`/`discourse_test` docker images, so it's much more efficient to switch to `puppeteer-core` which doesn't include the chromium binary.
This commit is contained in:
@ -11,14 +11,16 @@ const url = args[0];
|
||||
|
||||
console.log(`Starting Discourse Smoke Test for ${url}`);
|
||||
|
||||
const puppeteer = require("puppeteer");
|
||||
const chromeLauncher = require("chrome-launcher");
|
||||
const puppeteer = require("puppeteer-core");
|
||||
const path = require("path");
|
||||
|
||||
(async () => {
|
||||
const browser = await puppeteer.launch({
|
||||
executablePath: chromeLauncher.Launcher.getInstallations()[0],
|
||||
// when debugging locally setting the SHOW_BROWSER env variable can be very helpful
|
||||
headless: process.env.SHOW_BROWSER === undefined,
|
||||
args: ["--disable-local-storage", "--no-sandbox"]
|
||||
args: ["--disable-local-storage", "--no-sandbox"],
|
||||
});
|
||||
const page = await browser.newPage();
|
||||
|
||||
|
Reference in New Issue
Block a user