2
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2025-10-03 17:21:20 +08:00

DEV: Enable local-storage for smoke test (#34060)

The localStorage API has been a web standard for a very long time. It's
safe to assume it'll be available in all users browsers, so it makes
sense for the smoke test to match.

Also adds console logs to the smoke-test output, to make debugging
failures easier.
This commit is contained in:
David Taylor 2025-08-04 11:01:09 +01:00 committed by GitHub
parent 466b9b547a
commit 2fc4b34c5a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -20,9 +20,15 @@ import puppeteer from "puppeteer-core";
executablePath: 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: ["--no-sandbox"],
});
const page = await browser.newPage();
page.on("console", (msg) => {
if (["error", "warning"].includes(msg.type())) {
console.log(`PAGE ${msg.type().toUpperCase()}: ${msg.text()}`);
}
});
page.on("pageerror", (err) => console.log(`PAGE ERROR: ${err.message}`));

await page.setViewport({
width: 1366,