mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-21 23:34:31 +00:00
- Add browser_tests/types/globals.d.ts with Window interface augmentation - Add types for app, graph, LiteGraph, LGraphBadge and test globals - Standardize window['prop'] to window.prop across 37 test files - Update browser_tests/tsconfig.json to include new type definitions Amp-Thread-ID: https://ampcode.com/threads/T-019c16b3-cc31-70ea-9727-a933cb0ee942 Co-authored-by: Amp <amp@ampcode.com>
27 lines
982 B
TypeScript
27 lines
982 B
TypeScript
import { expect } from '@playwright/test'
|
|
|
|
import { comfyPageFixture as test } from '../fixtures/ComfyPage'
|
|
|
|
test.beforeEach(async ({ comfyPage }) => {
|
|
await comfyPage.settings.setSetting('Comfy.UseNewMenu', 'Disabled')
|
|
})
|
|
|
|
test.describe('Graph', { tag: ['@smoke', '@canvas'] }, () => {
|
|
// Should be able to fix link input slot index after swap the input order
|
|
// Ref: https://github.com/Comfy-Org/ComfyUI_frontend/issues/3348
|
|
test('Fix link input slots', async ({ comfyPage }) => {
|
|
await comfyPage.workflow.loadWorkflow('inputs/input_order_swap')
|
|
expect(
|
|
await comfyPage.page.evaluate(() => {
|
|
return window.app.graph.links.get(1)?.target_slot
|
|
})
|
|
).toBe(1)
|
|
})
|
|
|
|
test('Validate workflow links', async ({ comfyPage }) => {
|
|
await comfyPage.settings.setSetting('Comfy.Validation.Workflows', true)
|
|
await comfyPage.workflow.loadWorkflow('links/bad_link')
|
|
await expect(comfyPage.toast.getVisibleToastCount()).resolves.toBe(2)
|
|
})
|
|
})
|