mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-03 14:54:37 +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)
50 lines
1.5 KiB
TypeScript
50 lines
1.5 KiB
TypeScript
/**
|
|
* @cloud
|
|
* Cloud E2E tests.
|
|
* Tests run against stagingcloud.comfy.org with authenticated user.
|
|
*/
|
|
|
|
import { expect } from '@playwright/test'
|
|
|
|
import { comfyPageCloudFixture as test } from '../fixtures/ComfyPageCloud'
|
|
|
|
test.describe('Cloud E2E @cloud', () => {
|
|
test('loads app with authentication', async ({ comfyPage }) => {
|
|
// App should be loaded from setup()
|
|
await expect(comfyPage.canvas).toBeVisible()
|
|
|
|
// Verify we're authenticated (cloud-specific check)
|
|
const isAuthenticated = await comfyPage.page.evaluate(() => {
|
|
// Check for Firebase auth in localStorage
|
|
const keys = Object.keys(localStorage)
|
|
return keys.some(
|
|
(key) => key.startsWith('firebase:') || key.includes('authUser')
|
|
)
|
|
})
|
|
expect(isAuthenticated).toBe(true)
|
|
})
|
|
|
|
test('can interact with canvas', async ({ comfyPage }) => {
|
|
// Basic canvas interaction
|
|
await comfyPage.doubleClickCanvas()
|
|
await expect(comfyPage.searchBox.input).toBeVisible()
|
|
|
|
// Close search box
|
|
await comfyPage.page.keyboard.press('Escape')
|
|
await expect(comfyPage.searchBox.input).not.toBeVisible()
|
|
})
|
|
|
|
test('can access settings dialog', async ({ comfyPage }) => {
|
|
// Open settings dialog
|
|
await comfyPage.page.click('button[data-testid="settings-button"]', {
|
|
timeout: 10000
|
|
})
|
|
|
|
// Settings dialog should be visible
|
|
await expect(comfyPage.page.locator('.p-dialog')).toBeVisible()
|
|
|
|
// Close settings
|
|
await comfyPage.closeDialog()
|
|
})
|
|
})
|