mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-20 14:30:41 +00:00
## Summary Simplifies test setup for common settings ## Changes - **What**: - add vue-nodes tag to auto enable nodes 2.0 - remove UseNewMenu Top as this is default ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-11184-test-Simplify-vue-node-menu-test-setup-3416d73d3650815487e0c357d28761fe) by [Unito](https://www.unito.io)
47 lines
1.6 KiB
TypeScript
47 lines
1.6 KiB
TypeScript
import {
|
|
comfyExpect as expect,
|
|
comfyPageFixture as test
|
|
} from '@e2e/fixtures/ComfyPage'
|
|
|
|
const MUTE_HOTKEY = 'Control+m'
|
|
const MUTE_OPACITY = '0.5'
|
|
|
|
test.describe('Vue Node Mute', { tag: '@vue-nodes' }, () => {
|
|
test(
|
|
'should allow toggling mute on a selected node with hotkey',
|
|
{ tag: '@screenshot' },
|
|
async ({ comfyPage }) => {
|
|
await comfyPage.page.getByText('Load Checkpoint').click()
|
|
await comfyPage.page.keyboard.press(MUTE_HOTKEY)
|
|
|
|
const checkpointNode =
|
|
comfyPage.vueNodes.getNodeByTitle('Load Checkpoint')
|
|
await expect(checkpointNode).toHaveCSS('opacity', MUTE_OPACITY)
|
|
await expect(comfyPage.canvas).toHaveScreenshot(
|
|
'vue-node-muted-state.png'
|
|
)
|
|
|
|
await comfyPage.page.keyboard.press(MUTE_HOTKEY)
|
|
await expect(checkpointNode).not.toHaveCSS('opacity', MUTE_OPACITY)
|
|
}
|
|
)
|
|
|
|
test('should allow toggling mute on multiple selected nodes with hotkey', async ({
|
|
comfyPage
|
|
}) => {
|
|
await comfyPage.page.getByText('Load Checkpoint').click()
|
|
await comfyPage.page.getByText('KSampler').click({ modifiers: ['Control'] })
|
|
|
|
const checkpointNode = comfyPage.vueNodes.getNodeByTitle('Load Checkpoint')
|
|
const ksamplerNode = comfyPage.vueNodes.getNodeByTitle('KSampler')
|
|
|
|
await comfyPage.page.keyboard.press(MUTE_HOTKEY)
|
|
await expect(checkpointNode).toHaveCSS('opacity', MUTE_OPACITY)
|
|
await expect(ksamplerNode).toHaveCSS('opacity', MUTE_OPACITY)
|
|
|
|
await comfyPage.page.keyboard.press(MUTE_HOTKEY)
|
|
await expect(checkpointNode).not.toHaveCSS('opacity', MUTE_OPACITY)
|
|
await expect(ksamplerNode).not.toHaveCSS('opacity', MUTE_OPACITY)
|
|
})
|
|
})
|