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
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:
@@ -17,21 +17,42 @@ async function main() {
|
|||||||
"--no-sandbox",
|
"--no-sandbox",
|
||||||
"--disable-setuid-sandbox",
|
"--disable-setuid-sandbox",
|
||||||
"--disable-dev-shm-usage",
|
"--disable-dev-shm-usage",
|
||||||
|
"--disable-gpu",
|
||||||
|
"--ignore-certificate-errors",
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
|
|
||||||
const page = await browser.newPage();
|
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 {
|
try {
|
||||||
// Authenticate through Gatekeeper
|
// Authenticate through Gatekeeper
|
||||||
console.log(`\n🛡️ Authenticating 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"]');
|
const isGatekeeperPage = await page.$('input[name="password"]');
|
||||||
if (isGatekeeperPage) {
|
if (isGatekeeperPage) {
|
||||||
await page.type('input[name="password"]', gatekeeperPassword);
|
await page.type('input[name="password"]', gatekeeperPassword);
|
||||||
await Promise.all([
|
await Promise.all([
|
||||||
page.waitForNavigation({ waitUntil: "networkidle2", timeout: 60000 }),
|
page.waitForNavigation({
|
||||||
|
waitUntil: "domcontentloaded",
|
||||||
|
timeout: 60000,
|
||||||
|
}),
|
||||||
page.click('button[type="submit"]'),
|
page.click('button[type="submit"]'),
|
||||||
]);
|
]);
|
||||||
console.log(`✅ Gatekeeper authentication successful!`);
|
console.log(`✅ Gatekeeper authentication successful!`);
|
||||||
@@ -51,6 +72,15 @@ async function main() {
|
|||||||
}
|
}
|
||||||
} catch (err: any) {
|
} catch (err: any) {
|
||||||
console.error(`❌ Test Failed: ${err.message}`);
|
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();
|
await browser.close();
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user