fix(config): ensure analytics URL has protocol to prevent build crash
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 38s
Build & Deploy / 🧪 QA (push) Successful in 1m22s
Build & Deploy / 🏗️ Build (push) Successful in 4m27s
Build & Deploy / 🚀 Deploy (push) Failing after 39s
Build & Deploy / 🧪 Post-Deploy Verification (push) Has been skipped
Build & Deploy / 🔔 Notify (push) Successful in 2s

This commit is contained in:
2026-05-12 13:01:18 +02:00
parent 5d3be82d8f
commit 26d325df44
32998 changed files with 7245 additions and 3832721 deletions

View File

@@ -1,7 +1,7 @@
import puppeteer from 'puppeteer';
const targetUrl = process.argv[2] || process.env.NEXT_PUBLIC_BASE_URL || 'http://localhost:3000';
const gatekeeperPassword = process.env.GATEKEEPER_PASSWORD || 'etib2026';
const gatekeeperPassword = process.env.GATEKEEPER_PASSWORD || 'klz2026';
async function run() {
console.log(`🚀 Smoke Test: ${targetUrl}`);
@@ -27,14 +27,14 @@ async function run() {
]);
}
// 2. Check Key Pages
// 2. Check Key Pages & Assets
const pages = ['/', '/de/kontakt', '/en/contact', '/de/blog'];
for (const p of pages) {
console.log(`📄 Checking ${p}...`);
const res = await page.goto(`${targetUrl}${p}`, { waitUntil: 'domcontentloaded' });
if (res?.status() !== 200) throw new Error(`Page ${p} returned ${res?.status()}`);
// Check for broken images
// Check for broken images (using in-page fetch to preserve session and avoid heavy navigation)
const images = await page.$$eval('img', (imgs) => imgs.map((img) => img.src).filter(Boolean));
console.log(` Checking ${images.length} images...`);
@@ -46,7 +46,17 @@ async function run() {
try {
const res = await fetch(url, { method: 'HEAD' });
if (res.status >= 400) {
broken.push(`${url} (Status: ${res.status})`);
// Diagnostic: check if the raw source is available
const rawUrlMatch = url.match(/[?&]url=([^&]+)/);
if (rawUrlMatch) {
const rawPath = decodeURIComponent(rawUrlMatch[1]);
const baseUrl = new URL(url).origin;
const rawUrl = `${baseUrl}${rawPath}`;
const rawRes = await fetch(rawUrl, { method: 'HEAD' });
broken.push(`${url} (Status: ${res.status}, Raw Status: ${rawRes.status})`);
} else {
broken.push(`${url} (Status: ${res.status})`);
}
}
} catch (e) {
broken.push(`${url} (Fetch failed)`);
@@ -57,10 +67,32 @@ async function run() {
}, images);
if (brokenImages.length > 0) {
console.warn(`⚠️ Found ${brokenImages.length} broken images on ${p}`);
throw new Error(
`Found ${brokenImages.length} broken images on ${p}:\n${brokenImages.join('\n')}`,
);
}
}
// 3. Test Contact Form
console.log('📝 Testing Contact Form...');
await page.goto(`${targetUrl}/de/kontakt`, { waitUntil: 'networkidle2' });
await page.type('input[name="name"]', 'Smoke Test');
await page.type('input[name="email"]', 'smoke@mintel.me');
await page.type('textarea[name="message"]', 'Automated smoke test submission.');
await Promise.all([
page.waitForSelector('[role="alert"]', { timeout: 10000 }),
page.click('button[type="submit"]'),
]);
const alertText = await page.$eval('[role="alert"]', (el) => el.textContent);
console.log(`🔔 Alert: ${alertText}`);
if (alertText?.toLowerCase().includes('error') || alertText?.toLowerCase().includes('fehler')) {
throw new Error(`Form submission failed: ${alertText}`);
}
console.log('✅ Smoke test passed!');
process.exit(0);
} catch (err: any) {