mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-19 22:09:37 +00:00
fix: test(browser): add Playwright test for app startup when initServerCapabilities() fails or times out (#9825)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
31
browser_tests/tests/serverCapabilities.spec.ts
Normal file
31
browser_tests/tests/serverCapabilities.spec.ts
Normal file
@@ -0,0 +1,31 @@
|
||||
import { expect } from '@playwright/test'
|
||||
|
||||
import { comfyPageFixture as test } from '../fixtures/ComfyPage'
|
||||
|
||||
test.describe('Server Capabilities Resilience', { tag: '@slow' }, () => {
|
||||
test('App starts successfully when /api/features returns 500', async ({
|
||||
comfyPage
|
||||
}) => {
|
||||
await comfyPage.page.route('**/api/features**', async (route) => {
|
||||
await route.fulfill({
|
||||
status: 500,
|
||||
contentType: 'application/json',
|
||||
body: JSON.stringify({ error: 'Internal Server Error' })
|
||||
})
|
||||
})
|
||||
await comfyPage.setup()
|
||||
|
||||
await expect(comfyPage.canvas).toBeVisible()
|
||||
})
|
||||
|
||||
test('App starts successfully when /api/features network request fails', async ({
|
||||
comfyPage
|
||||
}) => {
|
||||
await comfyPage.page.route('**/api/features**', async (route) => {
|
||||
await route.abort('connectionrefused')
|
||||
})
|
||||
await comfyPage.setup()
|
||||
|
||||
await expect(comfyPage.canvas).toBeVisible()
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user