From c66b55369255f64956234afb067e6d1da58e67e0 Mon Sep 17 00:00:00 2001 From: johba Date: Mon, 23 Mar 2026 11:18:53 +0000 Subject: [PATCH] fix: move Chromium-specific launch args out of root use block, fix CTA text match - launchOptions with --disable-dev-shm-usage and --no-sandbox are Chromium-specific; passing them to Firefox/WebKit causes errors. Move to chromium and android project use blocks only. - Fix landing page CTA assertion to match actual button text ("Get $KRK", "Get Your Edge") instead of generic patterns. Co-Authored-By: Claude Opus 4.6 (1M context) --- playwright.config.ts | 8 +++++--- tests/e2e/07-landing-pages.spec.ts | 4 ++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/playwright.config.ts b/playwright.config.ts index c283fb5..5d0da08 100644 --- a/playwright.config.ts +++ b/playwright.config.ts @@ -12,6 +12,9 @@ import { defineConfig, devices } from '@playwright/test'; // Read-only specs safe to run in every browser/viewport after chain state exists. const CROSS_BROWSER_SPECS = '0[367]-*.spec.ts'; +// Chromium-specific launch flags (not valid for Firefox/WebKit). +const CHROMIUM_ARGS = ['--disable-dev-shm-usage', '--no-sandbox']; + export default defineConfig({ testDir: './tests/e2e', testMatch: process.env.CI ? '[0-9]*.spec.ts' : '**/*.spec.ts', @@ -25,9 +28,6 @@ export default defineConfig({ use: { headless: true, actionTimeout: 0, - launchOptions: { - args: ['--disable-dev-shm-usage', '--no-sandbox'], - }, }, projects: [ /* ── Desktop browsers ─────────────────────────────────── */ @@ -37,6 +37,7 @@ export default defineConfig({ ...devices['Desktop Chrome'], viewport: { width: 1280, height: 720 }, screen: { width: 1280, height: 720 }, + launchOptions: { args: CHROMIUM_ARGS }, }, }, { @@ -73,6 +74,7 @@ export default defineConfig({ name: 'android', use: { ...devices['Pixel 7'], + launchOptions: { args: CHROMIUM_ARGS }, }, dependencies: ['chromium'], testMatch: CROSS_BROWSER_SPECS, diff --git a/tests/e2e/07-landing-pages.spec.ts b/tests/e2e/07-landing-pages.spec.ts index 4764526..2e3e5d8 100644 --- a/tests/e2e/07-landing-pages.spec.ts +++ b/tests/e2e/07-landing-pages.spec.ts @@ -21,8 +21,8 @@ test.describe('Landing Pages', () => { // Page should contain recognisable KRAIKEN branding const body = await page.textContent('body'); expect(body).toBeTruthy(); - // Landing page always has a call-to-action button - const cta = page.getByRole('link', { name: /app|stake|launch|get started/i }).first(); + // Landing page always has a call-to-action link ("Get $KRK", "Get Your Edge", etc.) + const cta = page.getByRole('link', { name: /get.*krk|get.*edge|stake|launch/i }).first(); await expect(cta).toBeVisible({ timeout: 15_000 }); await page.screenshot({ path: 'test-results/landing-homepage.png', fullPage: true });