mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-24 00:34:09 +00:00
Adds Playwright tests for cloud environment with Firebase auth. Changes: - Refactor ComfyPage to abstract base class - Add LocalhostComfyPage (existing devtools implementation) - Add CloudComfyPage (cloud settings API, Firebase auth) - Add cloud fixture with auth state persistence - Add globalSetupCloud for Firebase login - Add playwright.cloud.config with 5x timeout - Add basic cloud tests (load app, canvas interaction, settings) - Update .gitignore for auth state files - Update tsconfig to include playwright.cloud.config Architecture: - ComfyPage abstract with 3 backend-specific methods - LocalhostComfyPage uses /api/devtools + multi-user - CloudComfyPage uses /api/settings + Firebase localStorage - No code duplication (95% shared) Setup: - Requires CLOUD_TEST_EMAIL and CLOUD_TEST_PASSWORD env vars - globalSetup logs in once, saves auth to browser_tests/.auth/ - Tests reuse saved auth state (no login per test)
49 lines
1.6 KiB
TypeScript
49 lines
1.6 KiB
TypeScript
import { test as base } from '@playwright/test'
|
|
|
|
import { CloudComfyPage } from './CloudComfyPage'
|
|
import { ComfyMouse } from './ComfyMouse'
|
|
import type { ComfyPage } from './ComfyPage'
|
|
|
|
/**
|
|
* Cloud-specific fixture for ComfyPage.
|
|
* Uses Firebase auth persisted from globalSetupCloud.ts.
|
|
*/
|
|
export const comfyPageCloudFixture = base.extend<{
|
|
comfyPage: ComfyPage
|
|
comfyMouse: ComfyMouse
|
|
}>({
|
|
// Use the storageState saved by globalSetupCloud
|
|
storageState: 'browser_tests/.auth/cloudUser.json',
|
|
|
|
comfyPage: async ({ page, request }, use) => {
|
|
const comfyPage = new CloudComfyPage(page, request)
|
|
|
|
// Note: No setupUser needed - Firebase auth persisted via storageState
|
|
// Setup cloud-specific settings (optional - can customize per test)
|
|
try {
|
|
await comfyPage.setupSettings({
|
|
'Comfy.UseNewMenu': 'Top',
|
|
// Hide canvas menu/info/selection toolbox by default.
|
|
'Comfy.Graph.CanvasInfo': false,
|
|
'Comfy.Graph.CanvasMenu': false,
|
|
'Comfy.Canvas.SelectionToolbox': false,
|
|
// Disable tooltips by default to avoid flakiness.
|
|
'Comfy.EnableTooltips': false,
|
|
// Set tutorial completed to true to avoid loading the tutorial workflow.
|
|
'Comfy.TutorialCompleted': true
|
|
})
|
|
} catch (e) {
|
|
console.error('Failed to setup cloud settings:', e)
|
|
}
|
|
|
|
// Don't mock releases for cloud - cloud handles its own releases
|
|
await comfyPage.setup({ mockReleases: false })
|
|
await use(comfyPage)
|
|
},
|
|
|
|
comfyMouse: async ({ comfyPage }, use) => {
|
|
const comfyMouse = new ComfyMouse(comfyPage)
|
|
await use(comfyMouse)
|
|
}
|
|
})
|