Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| acf642d7e6 | |||
| d5da2a91c8 | |||
| ebe664f984 |
@@ -14,4 +14,4 @@ jobs:
|
|||||||
secrets:
|
secrets:
|
||||||
GOTIFY_URL: ${{ secrets.GOTIFY_URL }}
|
GOTIFY_URL: ${{ secrets.GOTIFY_URL }}
|
||||||
GOTIFY_TOKEN: ${{ secrets.GOTIFY_TOKEN }}
|
GOTIFY_TOKEN: ${{ secrets.GOTIFY_TOKEN }}
|
||||||
GATEKEEPER_PASSWORD: ${{ secrets.GATEKEEPER_PASSWORD || 'klz2026' }}
|
GATEKEEPER_PASSWORD: ${{ secrets.GATEKEEPER_PASSWORD || 'lassmichrein' }}
|
||||||
|
|||||||
@@ -17,6 +17,10 @@
|
|||||||
"valid-id": "off",
|
"valid-id": "off",
|
||||||
"element-required-attributes": "off",
|
"element-required-attributes": "off",
|
||||||
"attribute-empty-style": "off",
|
"attribute-empty-style": "off",
|
||||||
"element-permitted-content": "off"
|
"element-permitted-content": "off",
|
||||||
|
"element-required-content": "off",
|
||||||
|
"element-permitted-parent": "off",
|
||||||
|
"no-implicit-close": "off",
|
||||||
|
"close-order": "off"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -116,7 +116,7 @@ export async function getPostBySlug(slug: string, locale: string): Promise<PostD
|
|||||||
category: doc.category || '',
|
category: doc.category || '',
|
||||||
featuredImage:
|
featuredImage:
|
||||||
typeof doc.featuredImage === 'object' && doc.featuredImage !== null
|
typeof doc.featuredImage === 'object' && doc.featuredImage !== null
|
||||||
? doc.featuredImage.sizes?.card?.url || doc.featuredImage.url
|
? doc.featuredImage.url || doc.featuredImage.sizes?.card?.url
|
||||||
: null,
|
: null,
|
||||||
focalX:
|
focalX:
|
||||||
typeof doc.featuredImage === 'object' && doc.featuredImage !== null
|
typeof doc.featuredImage === 'object' && doc.featuredImage !== null
|
||||||
@@ -162,7 +162,7 @@ export async function getAllPosts(locale: string): Promise<PostData[]> {
|
|||||||
category: doc.category || '',
|
category: doc.category || '',
|
||||||
featuredImage:
|
featuredImage:
|
||||||
typeof doc.featuredImage === 'object' && doc.featuredImage !== null
|
typeof doc.featuredImage === 'object' && doc.featuredImage !== null
|
||||||
? doc.featuredImage.sizes?.card?.url || doc.featuredImage.url
|
? doc.featuredImage.url || doc.featuredImage.sizes?.card?.url
|
||||||
: null,
|
: null,
|
||||||
focalX:
|
focalX:
|
||||||
typeof doc.featuredImage === 'object' && doc.featuredImage !== null
|
typeof doc.featuredImage === 'object' && doc.featuredImage !== null
|
||||||
|
|||||||
@@ -139,7 +139,7 @@
|
|||||||
"prepare": "husky",
|
"prepare": "husky",
|
||||||
"preinstall": "npx only-allow pnpm"
|
"preinstall": "npx only-allow pnpm"
|
||||||
},
|
},
|
||||||
"version": "2.2.8",
|
"version": "2.2.9",
|
||||||
"pnpm": {
|
"pnpm": {
|
||||||
"onlyBuiltDependencies": [
|
"onlyBuiltDependencies": [
|
||||||
"@parcel/watcher",
|
"@parcel/watcher",
|
||||||
|
|||||||
@@ -66,6 +66,12 @@ async function main() {
|
|||||||
|
|
||||||
const page = await browser.newPage();
|
const page = await browser.newPage();
|
||||||
|
|
||||||
|
page.on('console', (msg) => console.log('💻 BROWSER CONSOLE:', msg.text()));
|
||||||
|
page.on('pageerror', (error) => console.error('💻 BROWSER ERROR:', error.message));
|
||||||
|
page.on('requestfailed', (request) => {
|
||||||
|
console.error('💻 BROWSER REQUEST FAILED:', request.url(), request.failure()?.errorText);
|
||||||
|
});
|
||||||
|
|
||||||
// 3. Authenticate through Gatekeeper login form
|
// 3. Authenticate through Gatekeeper login form
|
||||||
console.log(`\n🛡️ Authenticating through Gatekeeper...`);
|
console.log(`\n🛡️ Authenticating through Gatekeeper...`);
|
||||||
try {
|
try {
|
||||||
@@ -98,7 +104,7 @@ async function main() {
|
|||||||
await page.goto(contactUrl, { waitUntil: 'networkidle0', timeout: 30000 });
|
await page.goto(contactUrl, { waitUntil: 'networkidle0', timeout: 30000 });
|
||||||
|
|
||||||
// Ensure React has hydrated completely
|
// Ensure React has hydrated completely
|
||||||
await page.waitForNetworkIdle({ idleTime: 1000, timeout: 15000 }).catch(() => { });
|
await page.waitForNetworkIdle({ idleTime: 1000, timeout: 15000 }).catch(() => {});
|
||||||
|
|
||||||
// Ensure form is visible and interactive
|
// Ensure form is visible and interactive
|
||||||
try {
|
try {
|
||||||
@@ -127,10 +133,17 @@ async function main() {
|
|||||||
|
|
||||||
// Explicitly click submit and wait for navigation/state-change
|
// Explicitly click submit and wait for navigation/state-change
|
||||||
await Promise.all([
|
await Promise.all([
|
||||||
page.waitForSelector('[role="alert"][aria-live="polite"]', { timeout: 15000 }),
|
page.waitForSelector('[role="alert"]', { timeout: 15000 }),
|
||||||
page.click('button[type="submit"]'),
|
page.click('button[type="submit"]'),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
const alertText = await page.$eval('[role="alert"]', (el) => el.textContent);
|
||||||
|
console.log(` Alert text: ${alertText}`);
|
||||||
|
|
||||||
|
if (alertText?.includes('Failed') || alertText?.includes('went wrong')) {
|
||||||
|
throw new Error(`Form submitted but showed error: ${alertText}`);
|
||||||
|
}
|
||||||
|
|
||||||
console.log(`✅ Contact Form submitted successfully! (Success state verified)`);
|
console.log(`✅ Contact Form submitted successfully! (Success state verified)`);
|
||||||
} catch (err: any) {
|
} catch (err: any) {
|
||||||
console.error(`❌ Contact Form Test Failed: ${err.message}`);
|
console.error(`❌ Contact Form Test Failed: ${err.message}`);
|
||||||
@@ -143,7 +156,7 @@ async function main() {
|
|||||||
await page.goto(productUrl, { waitUntil: 'networkidle0', timeout: 30000 });
|
await page.goto(productUrl, { waitUntil: 'networkidle0', timeout: 30000 });
|
||||||
|
|
||||||
// Ensure React has hydrated completely
|
// Ensure React has hydrated completely
|
||||||
await page.waitForNetworkIdle({ idleTime: 1000, timeout: 15000 }).catch(() => { });
|
await page.waitForNetworkIdle({ idleTime: 1000, timeout: 15000 }).catch(() => {});
|
||||||
|
|
||||||
// The product form uses dynamic IDs, so we select by input type in the specific form context
|
// The product form uses dynamic IDs, so we select by input type in the specific form context
|
||||||
try {
|
try {
|
||||||
@@ -170,10 +183,17 @@ async function main() {
|
|||||||
|
|
||||||
// Submit and wait for success state
|
// Submit and wait for success state
|
||||||
await Promise.all([
|
await Promise.all([
|
||||||
page.waitForSelector('[role="alert"][aria-live="polite"]', { timeout: 15000 }),
|
page.waitForSelector('[role="alert"]', { timeout: 15000 }),
|
||||||
page.click('form button[type="submit"]'),
|
page.click('form button[type="submit"]'),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
const alertText = await page.$eval('[role="alert"]', (el) => el.textContent);
|
||||||
|
console.log(` Alert text: ${alertText}`);
|
||||||
|
|
||||||
|
if (alertText?.includes('Failed') || alertText?.includes('went wrong')) {
|
||||||
|
throw new Error(`Form submitted but showed error: ${alertText}`);
|
||||||
|
}
|
||||||
|
|
||||||
console.log(`✅ Product Quote Form submitted successfully! (Success state verified)`);
|
console.log(`✅ Product Quote Form submitted successfully! (Success state verified)`);
|
||||||
} catch (err: any) {
|
} catch (err: any) {
|
||||||
console.error(`❌ Product Quote Form Test Failed: ${err.message}`);
|
console.error(`❌ Product Quote Form Test Failed: ${err.message}`);
|
||||||
@@ -202,12 +222,16 @@ async function main() {
|
|||||||
console.log(` ✅ Deleted submission: ${doc.id}`);
|
console.log(` ✅ Deleted submission: ${doc.id}`);
|
||||||
} catch (delErr: any) {
|
} catch (delErr: any) {
|
||||||
// Log but don't fail, 403s on Directus / Payload APIs for guest Gatekeeper sessions are normal
|
// Log but don't fail, 403s on Directus / Payload APIs for guest Gatekeeper sessions are normal
|
||||||
console.warn(` ⚠️ Cleanup attempt on ${doc.id} returned an error, typically due to API Auth separation: ${delErr.message}`);
|
console.warn(
|
||||||
|
` ⚠️ Cleanup attempt on ${doc.id} returned an error, typically due to API Auth separation: ${delErr.message}`,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (err: any) {
|
} catch (err: any) {
|
||||||
if (err.response?.status === 403) {
|
if (err.response?.status === 403) {
|
||||||
console.warn(` ⚠️ Cleanup fetch failed with 403 Forbidden. This is expected if the runner lacks admin API credentials. Test submissions remain in the database.`);
|
console.warn(
|
||||||
|
` ⚠️ Cleanup fetch failed with 403 Forbidden. This is expected if the runner lacks admin API credentials. Test submissions remain in the database.`,
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
console.error(` ❌ Cleanup fetch failed: ${err.message}`);
|
console.error(` ❌ Cleanup fetch failed: ${err.message}`);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user