mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-19 22:09:37 +00:00
## Summary Comprehensive Playwright E2E tests for the properties panel (right sidebar). Part of the **Test Coverage Q2 Overhaul** initiative (Phase 2: PNL-01). ## What's included - **PropertiesPanelHelper** page object in `browser_tests/helpers/` — locators + action methods for all panel elements - **35 test cases** covering: - Open/close via actionbar toggle - Workflow Overview (no selection): tabs, title, nodes list, global settings - Single node selection: title, parameters, info tab, widgets display - Multi-node selection: item count, node listing, hidden Info tab - Title editing: pencil icon, edit mode, rename, visibility rules - Search filtering: query, clear, empty state - Settings tab: Normal/Bypass/Mute state, color swatches, pinned toggle - Selection transitions: no-selection ↔ single ↔ multi - Nodes tab: list all, search filter - Tab label changes based on selection count - **Errors tab scaffold** (for @jaeone94 ADD-03) ## Testing - All tests use Vue nodes with new menu enabled - Zero flaky tests (proper waits, no sleeps) - Screenshots scoped to panel elements ## Unblocks - **ADD-03** (error systems by @jaeone94) — errors tab scaffold ready to extend ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-10548-test-comprehensive-properties-panel-E2E-tests-PNL-01-32f6d73d36508199a216fd8d953d8e18) by [Unito](https://www.unito.io) --------- Co-authored-by: GitHub Action <action@github.com>
123 lines
4.2 KiB
TypeScript
123 lines
4.2 KiB
TypeScript
import { expect } from '@playwright/test'
|
|
|
|
import { comfyPageFixture as test } from '../../fixtures/ComfyPage'
|
|
import { PropertiesPanelHelper } from './PropertiesPanelHelper'
|
|
|
|
test.describe('Properties panel - Node settings', () => {
|
|
let panel: PropertiesPanelHelper
|
|
|
|
test.beforeEach(async ({ comfyPage }) => {
|
|
panel = new PropertiesPanelHelper(comfyPage.page)
|
|
await comfyPage.settings.setSetting('Comfy.VueNodes.Enabled', true)
|
|
await comfyPage.vueNodes.waitForNodes()
|
|
await comfyPage.actionbar.propertiesButton.click()
|
|
await comfyPage.nodeOps.selectNodes(['KSampler'])
|
|
await panel.switchToTab('Settings')
|
|
})
|
|
|
|
test.describe('Node state', () => {
|
|
test('should show Normal, Bypass, and Mute state buttons', async () => {
|
|
await expect(panel.getNodeStateButton('Normal')).toBeVisible()
|
|
await expect(panel.getNodeStateButton('Bypass')).toBeVisible()
|
|
await expect(panel.getNodeStateButton('Mute')).toBeVisible()
|
|
})
|
|
|
|
test('should set node to Bypass mode', async ({ comfyPage }) => {
|
|
await panel.getNodeStateButton('Bypass').click()
|
|
|
|
const nodeLocator = comfyPage.vueNodes.getNodeByTitle('KSampler')
|
|
await expect(nodeLocator.getByText('Bypassed')).toBeVisible()
|
|
})
|
|
|
|
test('should set node to Mute mode', async ({ comfyPage }) => {
|
|
await panel.getNodeStateButton('Mute').click()
|
|
|
|
const nodeLocator = comfyPage.vueNodes.getNodeByTitle('KSampler')
|
|
await expect(nodeLocator.getByText('Muted')).toBeVisible()
|
|
})
|
|
|
|
test('should restore node to Normal mode', async ({ comfyPage }) => {
|
|
await panel.getNodeStateButton('Bypass').click()
|
|
const nodeLocator = comfyPage.vueNodes.getNodeByTitle('KSampler')
|
|
await expect(nodeLocator.getByText('Bypassed')).toBeVisible()
|
|
|
|
await panel.getNodeStateButton('Normal').click()
|
|
await expect(nodeLocator.getByText('Bypassed')).not.toBeVisible()
|
|
await expect(nodeLocator.getByText('Muted')).not.toBeVisible()
|
|
})
|
|
})
|
|
|
|
test.describe('Node color', () => {
|
|
test('should display color swatches', async () => {
|
|
await expect(panel.getColorSwatch('noColor')).toBeVisible()
|
|
await expect(panel.getColorSwatch('red')).toBeVisible()
|
|
await expect(panel.getColorSwatch('blue')).toBeVisible()
|
|
})
|
|
|
|
test('should apply color to node', async ({ comfyPage }) => {
|
|
await panel.getColorSwatch('red').click()
|
|
|
|
await expect
|
|
.poll(() =>
|
|
comfyPage.page.evaluate(() => {
|
|
const selected = window.app!.canvas.selected_nodes
|
|
const node = Object.values(selected)[0]
|
|
return node?.color != null
|
|
})
|
|
)
|
|
.toBe(true)
|
|
})
|
|
|
|
test('should remove color with noColor swatch', async ({ comfyPage }) => {
|
|
await panel.getColorSwatch('red').click()
|
|
|
|
await expect
|
|
.poll(() =>
|
|
comfyPage.page.evaluate(() => {
|
|
const selected = window.app!.canvas.selected_nodes
|
|
const node = Object.values(selected)[0]
|
|
return node?.color != null
|
|
})
|
|
)
|
|
.toBe(true)
|
|
|
|
await panel.getColorSwatch('noColor').click()
|
|
|
|
await expect
|
|
.poll(() =>
|
|
comfyPage.page.evaluate(() => {
|
|
const selected = window.app!.canvas.selected_nodes
|
|
const node = Object.values(selected)[0]
|
|
return node?.color
|
|
})
|
|
)
|
|
.toBeFalsy()
|
|
})
|
|
})
|
|
|
|
test.describe('Pinned state', () => {
|
|
test('should display pinned toggle', async () => {
|
|
await expect(panel.pinnedSwitch).toBeVisible()
|
|
})
|
|
|
|
test('should toggle pinned state', async ({ comfyPage }) => {
|
|
await panel.pinnedSwitch.click()
|
|
|
|
const nodeLocator = comfyPage.vueNodes.getNodeByTitle('KSampler')
|
|
await expect(nodeLocator.getByTestId('node-pin-indicator')).toBeVisible()
|
|
})
|
|
|
|
test('should unpin previously pinned node', async ({ comfyPage }) => {
|
|
const nodeLocator = comfyPage.vueNodes.getNodeByTitle('KSampler')
|
|
|
|
await panel.pinnedSwitch.click()
|
|
await expect(nodeLocator.getByTestId('node-pin-indicator')).toBeVisible()
|
|
|
|
await panel.pinnedSwitch.click()
|
|
await expect(
|
|
nodeLocator.getByTestId('node-pin-indicator')
|
|
).not.toBeVisible()
|
|
})
|
|
})
|
|
})
|