Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
experimental playwright test
  • Loading branch information
mcmonkey4eva committed Oct 2, 2024
commit 65596216aaf7da1262abffc462b4bd77cfa4860e
37 changes: 37 additions & 0 deletions browser_tests/menu.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,43 @@ test.describe('Menu', () => {
])
})

test('Can save, load, and delete workflows', async ({ comfyPage }) => {
const tab = comfyPage.menu.workflowsTab
expect(await tab.getOpenedWorkflowNames()).toEqual([
'*Unsaved Workflow.json'
])
await tab.newBlankWorkflowButton.click()
expect(await tab.getOpenedWorkflowNames()).toEqual([
'*Unsaved Workflow.json',
'*Unsaved Workflow (2).json'
])
await comfyPage.menu.saveWorkflow('test-save-workflow')
expect(await tab.getOpenedWorkflowNames()).toEqual([
'*Unsaved Workflow.json',
'test-save-workflow.json'
])
const labels = comfyPage.page.locator(
'.comfyui-workflows-open .node-label'
)
await labels.first().click()
await comfyPage.nextFrame()
await labels.last().click()
await comfyPage.nextFrame()
// Verify no '*' prefix on the saved one after reopening it
expect(await tab.getOpenedWorkflowNames()).toEqual([
'*Unsaved Workflow.json',
'test-save-workflow.json'
])
await labels.last().click({ button: 'right' })
await comfyPage.page
.locator('.p-contextmenu-item-label:has-text("Delete")')
.click()
await comfyPage.nextFrame()
expect(await tab.getOpenedWorkflowNames()).toEqual([
'*Unsaved Workflow.json'
])
})

test('Does not report warning when switching between opened workflows', async ({
comfyPage
}) => {
Expand Down