test: add E2E tests for settings dialog

Add Playwright tests covering:
- About panel displays version badges
- Boolean setting toggle through UI persists value
- Dialog can be closed via close button
This commit is contained in:
dante01yoon
2026-04-01 15:11:28 +09:00
parent df42b7a2a8
commit a2a2e0fd87

View File

@@ -0,0 +1,45 @@
import { expect } from '@playwright/test'
import { comfyPageFixture as test } from '../../fixtures/ComfyPage'
test.describe('Settings dialog', { tag: '@ui' }, () => {
test('About panel shows version badges', async ({ comfyPage }) => {
const dialog = comfyPage.settingDialog
await dialog.open()
await dialog.goToAboutPanel()
const aboutPanel = comfyPage.page.getByTestId('about-panel')
await expect(aboutPanel).toBeVisible()
await expect(aboutPanel.locator('.about-badge').first()).toBeVisible()
await expect(aboutPanel).toContainText('ComfyUI_frontend')
})
test('Toggling a boolean setting through UI persists the value', async ({
comfyPage
}) => {
const settingId = 'Comfy.Validation.Workflows'
const initialValue = await comfyPage.settings.getSetting<boolean>(settingId)
const dialog = comfyPage.settingDialog
await dialog.open()
await dialog.searchBox.fill('Validate workflows')
const settingRow = dialog.root.locator(`[data-setting-id="${settingId}"]`)
await expect(settingRow).toBeVisible()
await settingRow.locator('.p-toggleswitch').click()
await expect
.poll(() => comfyPage.settings.getSetting<boolean>(settingId))
.toBe(!initialValue)
})
test('Can be closed via close button', async ({ comfyPage }) => {
const dialog = comfyPage.settingDialog
await dialog.open()
await expect(dialog.root).toBeVisible()
await dialog.close()
await expect(dialog.root).not.toBeVisible()
})
})