From 040809812ae056fed27a5706324fc1fbe92a1dc2 Mon Sep 17 00:00:00 2001 From: Marc Mintel Date: Wed, 11 Mar 2026 14:54:21 +0100 Subject: [PATCH] test: Fix form E2E timeouts by using JS native click to bypass overlays --- scripts/check-forms.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/scripts/check-forms.ts b/scripts/check-forms.ts index 7449fb78..b26851bf 100644 --- a/scripts/check-forms.ts +++ b/scripts/check-forms.ts @@ -147,7 +147,9 @@ async function main() { // Explicitly click submit and wait for success state (using the success Card role="alert") await Promise.all([ page.waitForSelector('[role="alert"]', { timeout: 15000 }), - page.click('form#contact-form button[type="submit"]'), + page.$eval('form#contact-form button[type="submit"]', (el) => + (el as HTMLButtonElement).click(), + ), ]); const alertText = await page.$eval('[role="alert"]', (el) => el.textContent); @@ -161,6 +163,7 @@ async function main() { console.log(`✅ Contact Form submitted successfully! (Success state verified via alert text)`); } catch (err: any) { console.error(`❌ Contact Form Test Failed: ${err.message}`); + await page.screenshot({ path: 'contact-form-error.png', fullPage: true }); hasErrors = true; } @@ -204,7 +207,9 @@ async function main() { // Submit and wait for success state await Promise.all([ page.waitForSelector('[role="alert"]', { timeout: 15000 }), - page.click('form#quote-request-form button[type="submit"]'), + page.$eval('form#quote-request-form button[type="submit"]', (el) => + (el as HTMLButtonElement).click(), + ), ]); const alertText = await page.$eval('[role="alert"]', (el) => el.textContent);