mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-19 22:09:37 +00:00
Backport of #10168 to `cloud/1.42` Automatically created by backport workflow. ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-10275-backport-cloud-1-42-fix-make-graph-canvas-toolbar-visible-on-mobile-3276d73d365081c891e4ea0bd2bd1886) by [Unito](https://www.unito.io) Co-authored-by: Christian Byrne <cbyrne@comfy.org>
58 lines
1.8 KiB
TypeScript
58 lines
1.8 KiB
TypeScript
import { expect } from '@playwright/test'
|
|
|
|
import { comfyPageFixture as test } from '../fixtures/ComfyPage'
|
|
import { TestIds } from '../fixtures/selectors'
|
|
|
|
test.describe(
|
|
'Mobile Baseline Snapshots',
|
|
{ tag: ['@mobile', '@screenshot'] },
|
|
() => {
|
|
test('@mobile empty canvas', async ({ comfyPage }) => {
|
|
await comfyPage.settings.setSetting('Comfy.ConfirmClear', false)
|
|
await comfyPage.command.executeCommand('Comfy.ClearWorkflow')
|
|
await expect(async () => {
|
|
expect(await comfyPage.nodeOps.getGraphNodesCount()).toBe(0)
|
|
}).toPass({ timeout: 5000 })
|
|
await comfyPage.nextFrame()
|
|
await expect(comfyPage.canvas).toHaveScreenshot('mobile-empty-canvas.png')
|
|
})
|
|
|
|
test('@mobile default workflow', async ({ comfyPage }) => {
|
|
await comfyPage.workflow.loadWorkflow('default')
|
|
await expect(comfyPage.canvas).toHaveScreenshot(
|
|
'mobile-default-workflow.png'
|
|
)
|
|
})
|
|
|
|
test('@mobile graph canvas toolbar visible', async ({ comfyPage }) => {
|
|
await comfyPage.settings.setSetting('Comfy.Graph.CanvasMenu', true)
|
|
await comfyPage.nextFrame()
|
|
|
|
const minimapButton = comfyPage.page.getByTestId(
|
|
TestIds.canvas.toggleMinimapButton
|
|
)
|
|
await expect(minimapButton).toBeVisible()
|
|
|
|
await expect(comfyPage.canvas).toHaveScreenshot(
|
|
'mobile-graph-canvas-toolbar.png'
|
|
)
|
|
})
|
|
|
|
test('@mobile settings dialog', async ({ comfyPage }) => {
|
|
await comfyPage.settingDialog.open()
|
|
await comfyPage.nextFrame()
|
|
|
|
await expect(comfyPage.settingDialog.root).toHaveScreenshot(
|
|
'mobile-settings-dialog.png',
|
|
{
|
|
mask: [
|
|
comfyPage.settingDialog.root.getByTestId(
|
|
TestIds.user.currentUserIndicator
|
|
)
|
|
]
|
|
}
|
|
)
|
|
})
|
|
}
|
|
)
|