From 5f1a9659e96741b197b2ccad6c3a3ed98d9deba1 Mon Sep 17 00:00:00 2001 From: Chenlei Hu Date: Sun, 10 Nov 2024 11:53:55 -0500 Subject: [PATCH] Revert "Re-enable multiple-undo test (#1483)" (#1498) This reverts commit 6c6c356c78f2c110774000da0ba6ed4b0bf51d7c. --- browser_tests/changeTracker.spec.ts | 44 ++++------------------------- 1 file changed, 6 insertions(+), 38 deletions(-) diff --git a/browser_tests/changeTracker.spec.ts b/browser_tests/changeTracker.spec.ts index 869935472c..c2bf290bb9 100644 --- a/browser_tests/changeTracker.spec.ts +++ b/browser_tests/changeTracker.spec.ts @@ -21,7 +21,9 @@ test.describe('Change Tracker', () => { await comfyPage.setSetting('Comfy.UseNewMenu', 'Top') }) - test('Can undo multiple operations', async ({ comfyPage }) => { + // Flaky https://github.com/Comfy-Org/ComfyUI_frontend/pull/1481 + // The collapse can be recognized as several changes. + test.skip('Can undo multiple operations', async ({ comfyPage }) => { function isModified() { return comfyPage.page.evaluate(async () => { return window['app'].extensionManager.workflow.activeWorkflow @@ -29,59 +31,25 @@ test.describe('Change Tracker', () => { }) } - function getUndoQueueSize() { - return comfyPage.page.evaluate(() => { - const workflow = - window['app'].extensionManager.workflow.activeWorkflow - return workflow.changeTracker.undoQueue.length - }) - } - - function getRedoQueueSize() { - return comfyPage.page.evaluate(() => { - const workflow = - window['app'].extensionManager.workflow.activeWorkflow - return workflow.changeTracker.redoQueue.length - }) - } - expect(await getUndoQueueSize()).toBe(0) - expect(await getRedoQueueSize()).toBe(0) - await comfyPage.menu.topbar.saveWorkflow('undo-redo-test') - // Wait for the workflow to be saved. - await comfyPage.page.waitForTimeout(10) expect(await isModified()).toBe(false) - // TODO(huchenlei): Investigate why saving the workflow is causing the - // undo queue to be triggered. - expect(await getUndoQueueSize()).toBe(1) - expect(await getRedoQueueSize()).toBe(0) const node = (await comfyPage.getFirstNodeRef())! await node.click('collapse') await expect(node).toBeCollapsed() expect(await isModified()).toBe(true) - expect(await getUndoQueueSize()).toBe(2) - expect(await getRedoQueueSize()).toBe(0) await comfyPage.ctrlB() await expect(node).toBeBypassed() expect(await isModified()).toBe(true) - expect(await getUndoQueueSize()).toBe(3) - expect(await getRedoQueueSize()).toBe(0) await comfyPage.ctrlZ() await expect(node).not.toBeBypassed() expect(await isModified()).toBe(true) - expect(await getUndoQueueSize()).toBe(2) - expect(await getRedoQueueSize()).toBe(1) - // TODO(huchenlei): Following assertion is flaky. - // Seems like ctrlZ() is not triggered correctly. - // await comfyPage.ctrlZ() - // await expect(node).not.toBeCollapsed() - // expect(await isModified()).toBe(false) - // expect(await getUndoQueueSize()).toBe(1) - // expect(await getRedoQueueSize()).toBe(2) + await comfyPage.ctrlZ() + await expect(node).not.toBeCollapsed() + expect(await isModified()).toBe(false) }) })