Compare commits

...

3 Commits

Author SHA1 Message Date
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
2 changed files with 108 additions and 0 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,10 @@ export class BottomPanel {
this.toggleButton = page.getByRole('button', {
name: /Toggle Bottom Panel/i
})
this.closeButton = this.root.getByRole('button', { name: /Close/i })
this.resizeGutter = page.locator(
'.splitter-overlay-bottom > .p-splitter-gutter'
)
this.shortcuts = new ShortcutsTab(page)
}
}

View File

@@ -0,0 +1,102 @@
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).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).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).toBeVisible()
const initialHeight = await bottomPanel.root.evaluate(
(el) => el.getBoundingClientRect().height
)
const gutterBox = await bottomPanel.resizeGutter.boundingBox()
if (!gutterBox) {
test.skip()
return
}
const gutterCenterX = gutterBox.x + gutterBox.width / 2
const gutterCenterY = gutterBox.y + gutterBox.height / 2
// Drag gutter upward to enlarge the bottom panel
await comfyPage.page.mouse.move(gutterCenterX, gutterCenterY)
await comfyPage.page.mouse.down()
await comfyPage.page.mouse.move(gutterCenterX, gutterCenterY - 100, {
steps: 5
})
await comfyPage.page.mouse.up()
const newHeight = await bottomPanel.root.evaluate(
(el) => el.getBoundingClientRect().height
)
expect(newHeight).toBeGreaterThan(initialHeight)
})
test('should not block canvas interactions when panel is closed', async ({
comfyPage
}) => {
const { bottomPanel } = comfyPage
// Ensure panel is closed
await expect(bottomPanel.root).not.toBeVisible()
// Click the canvas without `force` -- Playwright's actionability checks
// will fail if an invisible overlay is intercepting pointer events.
await comfyPage.canvas.click({
position: { x: 100, y: 100 }
})
})
test('should close panel via close button from shortcuts view', async ({
comfyPage
}) => {
const { bottomPanel } = comfyPage
await bottomPanel.keyboardShortcutsButton.click()
await expect(bottomPanel.root).toBeVisible()
await bottomPanel.closeButton.click()
await expect(bottomPanel.root).not.toBeVisible()
})
})