Compare commits

..

6 Commits

Author SHA1 Message Date
GitHub Action
550f5bb4ab [automated] Apply ESLint and Oxfmt fixes 2026-04-08 05:01:02 +00:00
dante
3d175d66bb test: address bottom panel review feedback 2026-04-08 13:57:54 +09:00
dante01yoon
38cab734dc fix(test): replace test.skip with explicit assert on boundingBox
Per CodeRabbit review: after toBeVisible(), boundingBox() returning
null is a real failure, not an environment variance.
2026-04-02 21:54:00 +09:00
dante01yoon
cde01f67ed fix(test): remove tests that overlap with existing bottomPanelLogs
Remove tab persistence, shortcuts↔terminal switching, and terminal
tabs tests — already covered in bottomPanelLogs.spec.ts and
bottomPanelShortcuts.spec.ts. Keep only unique tests: close button,
resize gutter, drag resize, canvas not blocked.
2026-04-02 17:31:58 +09:00
dante01yoon
b442956b27 test: fix flaky bottom panel canvas interaction E2E test
Replace unreliable double-click-to-open-search-box assertion with a
simple canvas click. Playwright's actionability checks already verify
the element is not obscured by an invisible overlay, which is what
the test intends to guard against.
2026-04-02 17:24:53 +09:00
dante01yoon
7e855e7cc3 test: add E2E tests for bottom panel toggle, resize, and tab switching
Add bottomPanel.spec.ts covering behaviors not tested in existing
bottomPanelLogs and bottomPanelShortcuts specs: close button (X),
tab persistence on re-open, resize gutter visibility and drag,
canvas interaction when panel is closed, and cross-panel switching.

Extend BottomPanel fixture with closeButton and resizeGutter locators.
2026-04-02 10:31:44 +09:00
3 changed files with 129 additions and 141 deletions

View File

@@ -20,6 +20,8 @@ export class BottomPanel {
readonly root: Locator
readonly keyboardShortcutsButton: Locator
readonly toggleButton: Locator
readonly closeButton: Locator
readonly resizeGutter: Locator
readonly shortcuts: ShortcutsTab
constructor(readonly page: Page) {
@@ -30,6 +32,28 @@ export class BottomPanel {
this.toggleButton = page.getByRole('button', {
name: /Toggle Bottom Panel/i
})
this.closeButton = this.root.getByRole('button', { name: /^Close$/i })
// PrimeVue renders the splitter gutter outside the panel body.
this.resizeGutter = page.locator(
'.splitter-overlay-bottom > .p-splitter-gutter'
)
this.shortcuts = new ShortcutsTab(page)
}
async resizeByDragging(deltaY: number): Promise<void> {
const gutterBox = await this.resizeGutter.boundingBox()
if (!gutterBox) {
throw new Error('Bottom panel resize gutter should have layout')
}
const gutterCenterX = gutterBox.x + gutterBox.width / 2
const gutterCenterY = gutterBox.y + gutterBox.height / 2
await this.page.mouse.move(gutterCenterX, gutterCenterY)
await this.page.mouse.down()
await this.page.mouse.move(gutterCenterX, gutterCenterY + deltaY, {
steps: 5
})
await this.page.mouse.up()
}
}

View File

@@ -0,0 +1,105 @@
import {
comfyPageFixture as test,
comfyExpect as expect
} from '../fixtures/ComfyPage'
test.describe('Bottom Panel', { tag: '@ui' }, () => {
test.beforeEach(async ({ comfyPage }) => {
await comfyPage.settings.setSetting('Comfy.UseNewMenu', 'Top')
})
test('should close panel via close button inside the panel', async ({
comfyPage
}) => {
const { bottomPanel } = comfyPage
await bottomPanel.toggleButton.click()
await expect(
bottomPanel.root,
'Panel should be open before testing close button'
).toBeVisible()
await bottomPanel.closeButton.click()
await expect(bottomPanel.root).not.toBeVisible()
})
test('should display resize gutter when panel is open', async ({
comfyPage
}) => {
const { bottomPanel } = comfyPage
await bottomPanel.toggleButton.click()
await expect(
bottomPanel.root,
'Panel should be open before checking the resize gutter'
).toBeVisible()
await expect(bottomPanel.resizeGutter).toBeVisible()
})
test('should hide resize gutter when panel is closed', async ({
comfyPage
}) => {
const { bottomPanel } = comfyPage
await expect(bottomPanel.root).not.toBeVisible()
await expect(bottomPanel.resizeGutter).toBeHidden()
})
test('should resize panel by dragging the gutter', async ({ comfyPage }) => {
const { bottomPanel } = comfyPage
await bottomPanel.toggleButton.click()
await expect(
bottomPanel.root,
'Panel should be open before resizing'
).toBeVisible()
const initialHeight = await bottomPanel.root.evaluate(
(el) => el.getBoundingClientRect().height
)
await bottomPanel.resizeByDragging(-100)
await expect
.poll(
() =>
bottomPanel.root.evaluate((el) => el.getBoundingClientRect().height),
{
message:
'Panel height should increase after dragging the resize gutter'
}
)
.toBeGreaterThan(initialHeight)
})
test('should not block canvas interactions when panel is closed', async ({
comfyPage
}) => {
const { bottomPanel } = comfyPage
if (await bottomPanel.root.isVisible()) {
await bottomPanel.closeButton.click()
}
await expect(bottomPanel.root).not.toBeVisible()
await comfyPage.canvas.click({
position: { x: 100, y: 100 }
})
await expect(comfyPage.canvas).toHaveFocus()
})
test('should close panel via close button from shortcuts view', async ({
comfyPage
}) => {
const { bottomPanel } = comfyPage
await bottomPanel.keyboardShortcutsButton.click()
await expect(
bottomPanel.root,
'Panel should be open before closing it from the shortcuts view'
).toBeVisible()
await bottomPanel.closeButton.click()
await expect(bottomPanel.root).not.toBeVisible()
})
})

View File

@@ -1,141 +0,0 @@
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()
})
test('Escape key closes dialog', async ({ comfyPage }) => {
const dialog = comfyPage.settingDialog
await dialog.open()
await expect(dialog.root).toBeVisible()
await comfyPage.page.keyboard.press('Escape')
await expect(dialog.root).not.toBeVisible()
})
test('Search filters settings list', async ({ comfyPage }) => {
const dialog = comfyPage.settingDialog
await dialog.open()
const settingItems = dialog.root.locator('[data-setting-id]')
const countBeforeSearch = await settingItems.count()
await dialog.searchBox.fill('Validate workflows')
await expect
.poll(() => settingItems.count())
.toBeLessThan(countBeforeSearch)
})
test('Search can be cleared to restore all settings', async ({
comfyPage
}) => {
const dialog = comfyPage.settingDialog
await dialog.open()
const settingItems = dialog.root.locator('[data-setting-id]')
const countBeforeSearch = await settingItems.count()
await dialog.searchBox.fill('Validate workflows')
await expect
.poll(() => settingItems.count())
.toBeLessThan(countBeforeSearch)
await dialog.searchBox.clear()
await expect.poll(() => settingItems.count()).toBe(countBeforeSearch)
})
test('Category navigation changes content area', async ({ comfyPage }) => {
const dialog = comfyPage.settingDialog
await dialog.open()
const firstCategory = dialog.categories.first()
const firstCategoryName = await firstCategory.textContent()
await firstCategory.click()
const firstContent = await dialog.contentArea.textContent()
// Find a different category to click
const categoryCount = await dialog.categories.count()
for (let i = 1; i < categoryCount; i++) {
const cat = dialog.categories.nth(i)
const catName = await cat.textContent()
if (catName !== firstCategoryName) {
await cat.click()
await expect
.poll(() => dialog.contentArea.textContent())
.not.toBe(firstContent)
return
}
}
})
test('Dropdown setting can be changed and persists', async ({
comfyPage
}) => {
const settingId = 'Comfy.UseNewMenu'
const initialValue = await comfyPage.settings.getSetting<string>(settingId)
const dialog = comfyPage.settingDialog
await dialog.open()
await dialog.searchBox.fill('Use new menu')
const settingRow = dialog.root.locator(`[data-setting-id="${settingId}"]`)
await expect(settingRow).toBeVisible()
// Click the PrimeVue Select to open the dropdown
await settingRow.locator('.p-select').click()
const overlay = comfyPage.page.locator('.p-select-overlay')
await expect(overlay).toBeVisible()
// Pick the option that is not the current value
const targetValue = initialValue === 'Top' ? 'Disabled' : 'Top'
await overlay
.locator(`.p-select-option-label:text-is("${targetValue}")`)
.click()
await expect
.poll(() => comfyPage.settings.getSetting<string>(settingId))
.toBe(targetValue)
// Restore original value
await comfyPage.settings.setSetting(settingId, initialValue)
})
})