Files
mintel.me/apps/web/scripts/check-forms.ts
Marc Mintel 905ce98bc4
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 6s
Build & Deploy / 🧪 QA (push) Failing after 54s
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
chore: align deployment pipeline with klz-2026 standards
- Add branch deployment support

- Switch build platform to linux/amd64

- Extract checks to turbo pipeline

- Add pre/post-deploy scripts & cms-sync
2026-03-01 00:41:38 +01:00

50 lines
1.6 KiB
TypeScript
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import puppeteer from "puppeteer";
const targetUrl = process.env.NEXT_PUBLIC_BASE_URL || "http://localhost:3000";
const gatekeeperPassword = process.env.GATEKEEPER_PASSWORD || "secret"; // Use ENV or default
async function main() {
console.log(`\n🚀 Starting E2E Form Submission Check for: ${targetUrl}`);
const browser = await puppeteer.launch({
headless: true,
args: ["--no-sandbox", "--disable-setuid-sandbox"],
});
const page = await browser.newPage();
try {
console.log(`\n🛡 Authenticating through Gatekeeper...`);
await page.goto(targetUrl, { waitUntil: "networkidle0" });
const isGatekeeperPage = await page.$('input[name="password"]');
if (isGatekeeperPage) {
await page.type('input[name="password"]', gatekeeperPassword);
await Promise.all([
page.waitForNavigation({ waitUntil: "networkidle2" }),
page.click('button[type="submit"]'),
]);
console.log(`✅ Gatekeeper authentication successful!`);
}
console.log(`\n🧪 Testing Contact Form submission...`);
// Note: This needs to be adapted to the actual selectors on mintel.me
// For now, we perform a simple smoke test of the home page
const title = await page.title();
console.log(`✅ Page Title: ${title}`);
if (title.toLowerCase().includes("mintel")) {
console.log(`✅ Basic smoke test passed!`);
} else {
throw new Error("Page title mismatch");
}
} catch (err: any) {
console.error(`❌ Test Failed: ${err.message}`);
process.exit(1);
} finally {
await browser.close();
}
}
main();