[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
@@ -285,6 +285,33 @@ export class ComfyPage {
|
||||
} = {}) {
|
||||
await this.goto()
|
||||
|
||||
// Mock remote config endpoint for cloud builds
|
||||
// Cloud builds (rh-test) call /api/features on startup, which blocks initialization
|
||||
// if the endpoint doesn't exist or times out. Try real backend first, fallback to empty config.
|
||||
await this.page.route('**/api/features', async (route) => {
|
||||
try {
|
||||
// Try to get response from real backend
|
||||
const response = await route.fetch()
|
||||
if (response.ok()) {
|
||||
await route.fulfill({ response })
|
||||
} else {
|
||||
// Backend doesn't have endpoint, return empty config
|
||||
await route.fulfill({
|
||||
status: 200,
|
||||
contentType: 'application/json',
|
||||
body: JSON.stringify({})
|
||||
})
|
||||
}
|
||||
} catch {
|
||||
// Network error, return empty config
|
||||
await route.fulfill({
|
||||
status: 200,
|
||||
contentType: 'application/json',
|
||||
body: JSON.stringify({})
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
// Mock release endpoint to prevent changelog popups
|
||||
if (mockReleases) {
|
||||
await this.page.route('**/releases**', async (route) => {
|
||||
|
||||
|
Before Width: | Height: | Size: 88 KiB After Width: | Height: | Size: 82 KiB |
|
Before Width: | Height: | Size: 86 KiB After Width: | Height: | Size: 85 KiB |
|
Before Width: | Height: | Size: 100 KiB After Width: | Height: | Size: 99 KiB |
|
Before Width: | Height: | Size: 108 KiB After Width: | Height: | Size: 108 KiB |
|
Before Width: | Height: | Size: 105 KiB After Width: | Height: | Size: 105 KiB |
|
After Width: | Height: | Size: 100 KiB |
|
Before Width: | Height: | Size: 29 KiB After Width: | Height: | Size: 24 KiB |
|
Before Width: | Height: | Size: 102 KiB After Width: | Height: | Size: 102 KiB |
|
Before Width: | Height: | Size: 104 KiB After Width: | Height: | Size: 104 KiB |
|
Before Width: | Height: | Size: 99 KiB After Width: | Height: | Size: 99 KiB |
|
Before Width: | Height: | Size: 80 KiB After Width: | Height: | Size: 99 KiB |
|
Before Width: | Height: | Size: 47 KiB After Width: | Height: | Size: 56 KiB |
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 23 KiB |
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 27 KiB |
|
Before Width: | Height: | Size: 50 KiB After Width: | Height: | Size: 63 KiB |
|
Before Width: | Height: | Size: 48 KiB After Width: | Height: | Size: 60 KiB |
|
Before Width: | Height: | Size: 48 KiB After Width: | Height: | Size: 61 KiB |
|
Before Width: | Height: | Size: 50 KiB After Width: | Height: | Size: 62 KiB |
|
Before Width: | Height: | Size: 52 KiB After Width: | Height: | Size: 64 KiB |
|
Before Width: | Height: | Size: 49 KiB After Width: | Height: | Size: 62 KiB |
|
Before Width: | Height: | Size: 47 KiB After Width: | Height: | Size: 61 KiB |
|
Before Width: | Height: | Size: 46 KiB After Width: | Height: | Size: 60 KiB |
|
Before Width: | Height: | Size: 66 KiB After Width: | Height: | Size: 84 KiB |
|
Before Width: | Height: | Size: 9.3 KiB After Width: | Height: | Size: 22 KiB |
|
After Width: | Height: | Size: 96 KiB |
|
Before Width: | Height: | Size: 78 KiB After Width: | Height: | Size: 97 KiB |
|
Before Width: | Height: | Size: 77 KiB After Width: | Height: | Size: 97 KiB |
|
Before Width: | Height: | Size: 76 KiB After Width: | Height: | Size: 98 KiB |
|
Before Width: | Height: | Size: 94 KiB After Width: | Height: | Size: 95 KiB |
|
Before Width: | Height: | Size: 38 KiB After Width: | Height: | Size: 34 KiB |
|
Before Width: | Height: | Size: 94 KiB After Width: | Height: | Size: 95 KiB |
|
After Width: | Height: | Size: 97 KiB |
|
Before Width: | Height: | Size: 66 KiB After Width: | Height: | Size: 82 KiB |
@@ -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
|
||||
|
||||