Fix rename open/bookmark workflow (#1507)

* Fix rename open/bookmark workflow

* nit

* Fix save as

* Add browser test
This commit is contained in:
Chenlei Hu
2024-11-11 11:06:41 -05:00
committed by GitHub
parent a55833b3a6
commit 73bdbddf90
6 changed files with 121 additions and 59 deletions

View File

@@ -401,7 +401,6 @@ test.describe('Menu', () => {
'workflow1.json': 'default.json',
'workflow2.json': 'default.json'
})
// Avoid reset view as the button is not visible in BetaMenu UI.
await comfyPage.setup()
const tab = comfyPage.menu.workflowsTab
@@ -411,6 +410,33 @@ test.describe('Menu', () => {
)
})
test('Can rename nested workflow from opened workflow item', async ({
comfyPage
}) => {
await comfyPage.setupWorkflowsDirectory({
foo: {
'bar.json': 'default.json'
}
})
await comfyPage.setup()
const tab = comfyPage.menu.workflowsTab
await tab.open()
// Switch to the parent folder
await tab.getPersistedItem('foo').click()
await comfyPage.page.waitForTimeout(300)
// Switch to the nested workflow
await tab.getPersistedItem('bar').click()
await comfyPage.page.waitForTimeout(300)
const openedWorkflow = tab.getOpenedItem('foo/bar')
await tab.renameWorkflow(openedWorkflow, 'foo/baz')
expect(await tab.getOpenedWorkflowNames()).toEqual([
'*Unsaved Workflow.json',
'foo/baz.json'
])
})
test('Can save workflow as', async ({ comfyPage }) => {
await comfyPage.menu.workflowsTab.newBlankWorkflowButton.click()
await comfyPage.menu.topbar.saveWorkflowAs('workflow3.json')