Skip to content

Commit 01e533e

Browse files
christian-byrnegithub-actions
andcommitted
[ci] Update browser tests for new Templates modal (#5802)
## Summary - Regenerate 3 Playwright screenshot baselines to reflect UI changes from #5142 - Also fixed [this case](https://f01efc75.comfyui-playwright-chromium.pages.dev/#?testId=35f0453d615a452757ca-379124415c5b7e9060d2) (test case for responsive sizing) as it was using outdated logic. New logic: ensures that the nav is collapsed on mobile but visible on tablet and desktop screen sizes. It also ensures that, at all the main breakpoints, at least 1 card is visible (covers bug that the case was originally written for wherein the nav was fully covering the cards at narrow screen widths). ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-5802-ci-Regenerate-Playwright-screenshot-baselines-27a6d73d365081768211da0d24bad2c3) by [Unito](https://www.unito.io) --------- Co-authored-by: github-actions <[email protected]>
1 parent 178893e commit 01e533e

File tree

4 files changed

+15
-28
lines changed

4 files changed

+15
-28
lines changed

browser_tests/tests/templates.spec.ts

Lines changed: 15 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -181,45 +181,32 @@ test.describe('Templates', () => {
181181
}) => {
182182
// Open templates dialog
183183
await comfyPage.executeCommand('Comfy.BrowseTemplates')
184-
await expect(comfyPage.templates.content).toBeVisible()
185-
186-
const firstCard = comfyPage.page
187-
.locator('[data-testid^="template-workflow-"]')
188-
.first()
189-
await expect(firstCard).toBeVisible({ timeout: 5000 })
190184

191-
// Get the template grid
192185
const templateGrid = comfyPage.page.locator(
193186
'[data-testid="template-workflows-content"]'
194187
)
195-
await expect(templateGrid).toBeVisible()
188+
const nav = comfyPage.page
189+
.locator('header')
190+
.filter({ hasText: 'Templates' })
196191

197-
// Check grid layout at desktop size (default)
198-
const desktopGridClass = await templateGrid.getAttribute('class')
199-
expect(desktopGridClass).toContain('grid')
200-
expect(desktopGridClass).toContain(
201-
'grid-cols-[repeat(auto-fill,minmax(16rem,1fr))]'
202-
)
203-
204-
// Count visible cards at desktop size
205-
const desktopCardCount = await comfyPage.page
192+
const cardCount = await comfyPage.page
206193
.locator('[data-testid^="template-workflow-"]')
207194
.count()
208-
expect(desktopCardCount).toBeGreaterThan(0)
195+
expect(cardCount).toBeGreaterThan(0)
196+
await expect(templateGrid).toBeVisible()
197+
await expect(nav).toBeVisible() // Nav should be visible at desktop size
209198

210-
// Check cards at mobile viewport size
211-
await comfyPage.page.setViewportSize({ width: 640, height: 800 })
199+
const mobileSize = { width: 640, height: 800 }
200+
await comfyPage.page.setViewportSize(mobileSize)
201+
expect(cardCount).toBeGreaterThan(0)
212202
await expect(templateGrid).toBeVisible()
213-
// Grid should still be responsive at mobile size
214-
const mobileGridClass = await templateGrid.getAttribute('class')
215-
expect(mobileGridClass).toContain('grid')
203+
await expect(nav).not.toBeVisible() // Nav should collapse at mobile size
216204

217-
// Check cards at tablet size
218-
await comfyPage.page.setViewportSize({ width: 1024, height: 800 })
205+
const tabletSize = { width: 1024, height: 800 }
206+
await comfyPage.page.setViewportSize(tabletSize)
207+
expect(cardCount).toBeGreaterThan(0)
219208
await expect(templateGrid).toBeVisible()
220-
// Grid should still be responsive at tablet size
221-
const tabletGridClass = await templateGrid.getAttribute('class')
222-
expect(tabletGridClass).toContain('grid')
209+
await expect(nav).toBeVisible() // Nav should be visible at tablet size
223210
})
224211

225212
test('hover effects work on template cards', async ({ comfyPage }) => {
1.04 KB
Loading
-2.33 KB
Loading
-47.9 KB
Loading

0 commit comments

Comments
 (0)