mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-30 11:11:53 +00:00
Fix saved workflow cleanup in menu tests (#1142)
* Fix saved workflow cleanup in menu tests * Clear workflow dir before each test
This commit is contained in:
@@ -389,6 +389,8 @@ test.describe('Menu', () => {
|
|||||||
// Open the sidebar
|
// Open the sidebar
|
||||||
const tab = comfyPage.menu.workflowsTab
|
const tab = comfyPage.menu.workflowsTab
|
||||||
await tab.open()
|
await tab.open()
|
||||||
|
|
||||||
|
await comfyPage.setupWorkflowsDirectory({})
|
||||||
})
|
})
|
||||||
|
|
||||||
test('Can create new blank workflow', async ({ comfyPage }) => {
|
test('Can create new blank workflow', async ({ comfyPage }) => {
|
||||||
@@ -441,7 +443,9 @@ test.describe('Menu', () => {
|
|||||||
test('Can close saved-workflows from the open workflows section', async ({
|
test('Can close saved-workflows from the open workflows section', async ({
|
||||||
comfyPage
|
comfyPage
|
||||||
}) => {
|
}) => {
|
||||||
await comfyPage.menu.topbar.saveWorkflow('deault')
|
await comfyPage.menu.topbar.saveWorkflow(
|
||||||
|
`tempWorkflow-${test.info().title}`
|
||||||
|
)
|
||||||
const closeButton = comfyPage.page.locator(
|
const closeButton = comfyPage.page.locator(
|
||||||
'.comfyui-workflows-open .p-button-icon.pi-times'
|
'.comfyui-workflows-open .p-button-icon.pi-times'
|
||||||
)
|
)
|
||||||
@@ -458,13 +462,7 @@ test.describe('Menu', () => {
|
|||||||
'Comfy.Workflow.WorkflowTabsPosition',
|
'Comfy.Workflow.WorkflowTabsPosition',
|
||||||
'Topbar'
|
'Topbar'
|
||||||
)
|
)
|
||||||
})
|
await comfyPage.setupWorkflowsDirectory({})
|
||||||
|
|
||||||
test.afterEach(async ({ comfyPage }) => {
|
|
||||||
// Delete the saved workflow for cleanup.
|
|
||||||
await comfyPage.page.evaluate(async () => {
|
|
||||||
window['app'].workflowManager.activeWorkflow.delete()
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
|
|
||||||
test('Can show opened workflows', async ({ comfyPage }) => {
|
test('Can show opened workflows', async ({ comfyPage }) => {
|
||||||
@@ -474,12 +472,10 @@ test.describe('Menu', () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
test('Can close saved-workflow tabs', async ({ comfyPage }) => {
|
test('Can close saved-workflow tabs', async ({ comfyPage }) => {
|
||||||
const savedWorkflowName = 'default'
|
const workflowName = `tempWorkflow-${test.info().title}`
|
||||||
await comfyPage.menu.topbar.saveWorkflow(savedWorkflowName)
|
await comfyPage.menu.topbar.saveWorkflow(workflowName)
|
||||||
expect(await comfyPage.menu.topbar.getTabNames()).toEqual([
|
expect(await comfyPage.menu.topbar.getTabNames()).toEqual([workflowName])
|
||||||
savedWorkflowName
|
await comfyPage.menu.topbar.closeWorkflowTab(workflowName)
|
||||||
])
|
|
||||||
await comfyPage.menu.topbar.closeWorkflowTab('default')
|
|
||||||
expect(await comfyPage.menu.topbar.getTabNames()).toEqual([
|
expect(await comfyPage.menu.topbar.getTabNames()).toEqual([
|
||||||
'Unsaved Workflow (2)'
|
'Unsaved Workflow (2)'
|
||||||
])
|
])
|
||||||
|
|||||||
Reference in New Issue
Block a user