[don't port to main] fix: Enable Playwright tests on rh-test by skipping cloud auth guard (#6283)

## Problem

All Playwright tests on rh-test were failing due to cloud-specific
initialization blocking test execution:

1. Firebase auth guard waits 16 seconds for auth initialization,
exceeding test timeout (15s)
2. Remote config fetch blocks on /api/features endpoint
3. Snapshot images outdated - rh-test has old snapshots while main UI
evolved

## Solution

**Skip cloud auth guard** (src/router.ts)
- Add `if (!isCloud) return next()` at start of router.beforeEach
- Playwright builds with DISTRIBUTION='localhost', bypassing the guard
- Safe since guard is cloud-only (Firebase, login pages, onboarding)

**Mock /api/features endpoint** (browser_tests/fixtures/ComfyPage.ts)
- Try real backend first, fallback to empty config
- Prevents initialization hang when endpoint unavailable
- Preserves explicit featureFlags.spec.ts test functionality

**Update snapshots from main**
- Pulled 33 snapshot files from main branch
- Fixes snapshot mismatches caused by UI evolution on main
- Includes 3 new snapshots (recordAudio, bypass/mute states)

## Impact

- Playwright tests can now initialize and run on rh-test
- Cloud functionality unchanged (fixes only affect
DISTRIBUTION='localhost')
- No production behavior changes
This commit is contained in:
Christian Byrne
2025-10-25 21:50:27 -07:00
committed by GitHub
parent 088a57a43c
commit 76bd9ab43e
35 changed files with 31 additions and 0 deletions

View File

@@ -5,6 +5,7 @@ import {
} from 'vue-router'
import type { RouteLocationNormalized } from 'vue-router'
import { isCloud } from '@/platform/distribution/types'
import { useDialogService } from '@/services/dialogService'
import { useFirebaseAuthStore } from '@/stores/firebaseAuthStore'
import { useUserStore } from '@/stores/userStore'
@@ -104,6 +105,9 @@ const router = createRouter({
// Global authentication guard
router.beforeEach(async (to, _from, next) => {
// Skip cloud-specific auth guard for non-cloud builds (e.g., Playwright tests)
if (!isCloud) return next()
const authStore = useFirebaseAuthStore()
// Wait for Firebase auth to initialize with timeout