fix(ci): add --ignore-certificate-errors, disable gpu, and diagnostics for E2E form check
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 6s
Build & Deploy / 🧪 QA (push) Failing after 1m54s
Build & Deploy / 🏗️ Build (push) Has been skipped
Build & Deploy / 🚀 Deploy (push) Has been skipped
Build & Deploy / 🧪 Post-Deploy Verification (push) Has been skipped
Build & Deploy / 🔔 Notify (push) Successful in 1s

This commit is contained in:
2026-03-02 16:51:12 +01:00
parent b7dac5d463
commit b015c62650

View File

@@ -17,21 +17,42 @@ async function main() {
"--no-sandbox",
"--disable-setuid-sandbox",
"--disable-dev-shm-usage",
"--disable-gpu",
"--ignore-certificate-errors",
],
});
const page = await browser.newPage();
// Enable console logging from the page for debugging
page.on("console", (msg) => console.log(` [PAGE] ${msg.text()}`));
page.on("pageerror", (err) => console.error(` [PAGE ERROR] ${err.message}`));
page.on("requestfailed", (req) =>
console.error(
` [REQUEST FAILED] ${req.url()} - ${req.failure()?.errorText}`,
),
);
try {
// Authenticate through Gatekeeper
console.log(`\n🛡 Authenticating through Gatekeeper...`);
await page.goto(targetUrl, { waitUntil: "networkidle2", timeout: 60000 });
console.log(` Navigating to: ${targetUrl}`);
const response = await page.goto(targetUrl, {
waitUntil: "domcontentloaded",
timeout: 60000,
});
console.log(` Response status: ${response?.status()}`);
console.log(` Response URL: ${response?.url()}`);
const isGatekeeperPage = await page.$('input[name="password"]');
if (isGatekeeperPage) {
await page.type('input[name="password"]', gatekeeperPassword);
await Promise.all([
page.waitForNavigation({ waitUntil: "networkidle2", timeout: 60000 }),
page.waitForNavigation({
waitUntil: "domcontentloaded",
timeout: 60000,
}),
page.click('button[type="submit"]'),
]);
console.log(`✅ Gatekeeper authentication successful!`);
@@ -51,6 +72,15 @@ async function main() {
}
} catch (err: any) {
console.error(`❌ Test Failed: ${err.message}`);
// Take a screenshot for debugging
try {
const screenshotPath = "/tmp/e2e-failure.png";
await page.screenshot({ path: screenshotPath, fullPage: true });
console.log(`📸 Screenshot saved to ${screenshotPath}`);
} catch {
/* ignore screenshot errors */
}
console.log(` Current URL: ${page.url()}`);
await browser.close();
process.exit(1);
}