mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-27 09:45:13 +00:00
feat: Add cloud E2E testing infrastructure
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)
This commit is contained in:
34
playwright.cloud.config.ts
Normal file
34
playwright.cloud.config.ts
Normal file
@@ -0,0 +1,34 @@
|
||||
import { defineConfig, devices } from '@playwright/test'
|
||||
|
||||
/**
|
||||
* Playwright configuration for cloud E2E tests.
|
||||
* Tests run against stagingcloud.comfy.org with authenticated user.
|
||||
*/
|
||||
export default defineConfig({
|
||||
testDir: './browser_tests/tests',
|
||||
fullyParallel: true,
|
||||
forbidOnly: !!process.env.CI,
|
||||
reporter: 'html',
|
||||
|
||||
// Cloud tests need more time due to network latency
|
||||
timeout: 75000, // 5x the default 15000ms
|
||||
retries: process.env.CI ? 2 : 0,
|
||||
|
||||
use: {
|
||||
trace: 'on-first-retry',
|
||||
// Cloud URL - can override with PLAYWRIGHT_TEST_URL env var
|
||||
baseURL: process.env.PLAYWRIGHT_TEST_URL || 'https://stagingcloud.comfy.org'
|
||||
},
|
||||
|
||||
// Authenticate once before all tests
|
||||
globalSetup: './browser_tests/globalSetupCloud.ts',
|
||||
|
||||
projects: [
|
||||
{
|
||||
name: 'chromium',
|
||||
use: { ...devices['Desktop Chrome'] },
|
||||
timeout: 75000,
|
||||
grep: /@cloud/ // Only run tests tagged with @cloud
|
||||
}
|
||||
]
|
||||
})
|
||||
Reference in New Issue
Block a user