fix: open terminal panel before checking for Logs tab

The Logs tab is only visible when the panel is open. The previous
test was waiting for toBeAttached() but the tab wasn't rendered
until the panel was opened.

Amp-Thread-ID: https://ampcode.com/threads/T-019c21eb-bc34-763e-a553-17ff79018dcf
This commit is contained in:
bymyself
2026-02-02 21:15:49 -08:00
parent a95f7f88c2
commit 048750599d

View File

@@ -148,11 +148,21 @@ test.describe('Bottom Panel Shortcuts', { tag: '@ui' }, () => {
comfyPage
}) => {
// Terminal tabs load asynchronously via dynamic import - wait for registration
// Use expect().toPass() for auto-retry polling pattern
// Open terminal panel first to make tabs visible, then poll for Logs tab
await expect(async () => {
const logsTab = comfyPage.page.getByRole('tab', { name: /Logs/i })
await expect(logsTab).toBeAttached()
}).toPass({ timeout: 10_000 })
await comfyPage.page
.locator('button[aria-label*="Toggle Bottom Panel"]')
.click()
await expect(
comfyPage.page.getByRole('tab', { name: /Logs/i })
).toBeVisible({ timeout: 1000 })
}).toPass({ timeout: 15_000 })
// Close the terminal panel
await comfyPage.page
.locator('button[aria-label*="Toggle Bottom Panel"]')
.click()
await expect(comfyPage.page.locator('.bottom-panel')).not.toBeVisible()
// Open shortcuts panel
await comfyPage.page