-
Notifications
You must be signed in to change notification settings - Fork 112
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add toggle link visibility button on canvas menu (#1070)
* Basic link visibility toggle * Icon change * nit * Update litegraph * nit * Add playwright test * Update test expectations [skip ci] --------- Co-authored-by: github-actions <github-actions@github.com>
- Loading branch information
Showing
11 changed files
with
104 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import { expect } from '@playwright/test' | ||
import { comfyPageFixture as test } from './ComfyPage' | ||
|
||
test.describe('Graph Canvas Menu', () => { | ||
test.beforeEach(async ({ comfyPage }) => { | ||
// Set link render mode to spline to make sure it's not affected by other tests' | ||
// side effects. | ||
await comfyPage.setSetting('Comfy.LinkRenderMode', 2) | ||
}) | ||
|
||
test('Can toggle link visibility', async ({ comfyPage }) => { | ||
// Note: `Comfy.Graph.CanvasMenu` is disabled in comfyPage setup. | ||
// so no cleanup is needed. | ||
await comfyPage.setSetting('Comfy.Graph.CanvasMenu', true) | ||
|
||
const button = comfyPage.page.getByTestId('toggle-link-visibility-button') | ||
await button.click() | ||
await comfyPage.nextFrame() | ||
await expect(comfyPage.canvas).toHaveScreenshot( | ||
'canvas-with-hidden-links.png' | ||
) | ||
const hiddenLinkRenderMode = await comfyPage.page.evaluate(() => { | ||
return window['LiteGraph'].HIDDEN_LINK | ||
}) | ||
expect(await comfyPage.getSetting('Comfy.LinkRenderMode')).toBe( | ||
hiddenLinkRenderMode | ||
) | ||
|
||
await button.click() | ||
await comfyPage.nextFrame() | ||
await expect(comfyPage.canvas).toHaveScreenshot( | ||
'canvas-with-visible-links.png' | ||
) | ||
expect(await comfyPage.getSetting('Comfy.LinkRenderMode')).not.toBe( | ||
hiddenLinkRenderMode | ||
) | ||
}) | ||
}) |
Binary file added
BIN
+87.4 KB
...raphCanvasMenu.spec.ts-snapshots/canvas-with-hidden-links-chromium-2x-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+84.1 KB
...s/graphCanvasMenu.spec.ts-snapshots/canvas-with-hidden-links-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+102 KB
...aphCanvasMenu.spec.ts-snapshots/canvas-with-visible-links-chromium-2x-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+98.4 KB
.../graphCanvasMenu.spec.ts-snapshots/canvas-with-visible-links-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters