Files
ComfyUI_frontend/browser_tests/tests/mobileBaseline.spec.ts
Christian Byrne 3f777fb54f test: add basic mobile baseline tests (#7415)
## Summary

Allows authors to visualize how their changes affect mobile view. Often
we add some fundamental change to the UI and forget to make it
responsive, this test helps keep track of that.

┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-7415-test-add-basic-mobile-baseline-tests-2c76d73d3650810bb4bad5a1f6c7c53c)
by [Unito](https://www.unito.io)

---------

Co-authored-by: github-actions <github-actions@github.com>
2025-12-12 23:39:17 -07:00

30 lines
1.0 KiB
TypeScript

import { comfyPageFixture as test } from '../fixtures/ComfyPage'
import { expect } from '@playwright/test'
test.describe('Mobile Baseline Snapshots', () => {
test('@mobile empty canvas', async ({ comfyPage }) => {
await comfyPage.setSetting('Comfy.ConfirmClear', false)
await comfyPage.executeCommand('Comfy.ClearWorkflow')
await expect(async () => {
expect(await comfyPage.getGraphNodesCount()).toBe(0)
}).toPass({ timeout: 256 })
await comfyPage.nextFrame()
await expect(comfyPage.canvas).toHaveScreenshot('mobile-empty-canvas.png')
})
test('@mobile default workflow', async ({ comfyPage }) => {
await comfyPage.loadWorkflow('default')
await expect(comfyPage.canvas).toHaveScreenshot(
'mobile-default-workflow.png'
)
})
test('@mobile settings dialog', async ({ comfyPage }) => {
await comfyPage.settingDialog.open()
await comfyPage.nextFrame()
await expect(comfyPage.settingDialog.root).toHaveScreenshot(
'mobile-settings-dialog.png'
)
})
})