Commit Graph

6599 Commits

Author SHA1 Message Date
Alexander Brown
5bd37bef99 fix: browser test fixes for flaky selectors and missing setup
- SidebarTab: Use placeholder selector instead of test ID for search input
- KeyboardHelper: Remove redundant canvas fallback (null is valid)
- groupNode: Use variable for category name instead of hardcoded string
- nodeLibrary: Ensure tab is open before filling search input
- subgraph: Reload workflow after page reload to restore state
- useSettingSearch: Use role selector and simplify selected class assertion

Amp-Thread-ID: https://ampcode.com/threads/T-019c18c2-667a-7179-bb2d-86f35cd1d7b0
Co-authored-by: Amp <amp@ampcode.com>
2026-02-01 02:39:59 -08:00
Alexander Brown
e1bc1c4721 chore: enable additional lint rules for browser_tests
- no-async-promise-executor

- no-control-regex

- no-useless-rename

- no-unused-private-class-members

- unicorn/no-empty-file

Amp-Thread-ID: https://ampcode.com/threads/T-019c187a-abb8-72f9-9fe0-c1044e096770
Co-authored-by: Amp <amp@ampcode.com>
2026-02-01 01:25:52 -08:00
Alexander Brown
16fec4d45c feat: enforce no-explicit-any in browser tests via oxlint
- Add typescript/no-explicit-any override for browser_tests/**/*.ts

- Fix 9 violations with proper types instead of any

- Add TestGraphAccess interface for typed node access

- Add function overloads to getExportedWorkflow for proper return types

- Fix floating promise in colorPalette.spec.ts

Amp-Thread-ID: https://ampcode.com/threads/T-019c1854-3c3c-723d-8ce6-183ce06fcf1b
Co-authored-by: Amp <amp@ampcode.com>
2026-02-01 01:12:44 -08:00
Alexander Brown
f96a700621 fix: restore ExtensionManager API contract
- Revert extensionManager type from WorkspaceStore to ExtensionManager

- Remove WorkspaceStore export from workspaceStore.ts

- Add WorkspaceStore type to browser_tests/types/globals.d.ts

- Update browser tests to use specific 'as WorkspaceStore' casts

- Consolidate Window augmentation into single globals.d.ts file

Amp-Thread-ID: https://ampcode.com/threads/T-019c1854-3c3c-723d-8ce6-183ce06fcf1b
Co-authored-by: Amp <amp@ampcode.com>
2026-02-01 00:54:53 -08:00
Alexander Brown
4b95f22737 fix: remove test settings from production schema
Remove 5 test setting IDs that were incorrectly added to the production
apiSchema.ts. Test settings now use `as TestSettingId` casts in test
files instead of polluting the production Settings type.

Changes:
- Remove TestSetting, TestHiddenSetting, TestDeprecatedSetting,
  TestVisibleSetting, Comfy.TestSetting from apiSchema.ts
- Add TestSettingId type helper to extensionAPI.spec.ts and
  useSettingSearch.spec.ts
- Use specific `as TestSettingId` casts with explanatory comments

This keeps production types clean while allowing tests to register
arbitrary setting IDs (which is valid extension behavior).

Amp-Thread-ID: https://ampcode.com/threads/T-019c1833-2352-728b-a523-a8f440fd3ba1
Co-authored-by: Amp <amp@ampcode.com>
2026-02-01 00:30:27 -08:00
Alexander Brown
c411bfca75 test: purge as any from browser_tests (WIP - needs remediation)
Remove 40 instances of `as any` from browser_tests directory.

Changes made:
- Changed extensionManager type from ExtensionManager to WorkspaceStore
- Added test setting IDs to production apiSchema.ts
- Added Window.__ws__ declaration in browser_tests/types.d.ts
- Used type narrowing for Subgraph objects
- Replaced `as any` with `as ComfyWorkflowJSON` in groupNode.spec.ts
- Added non-null assertions where values are guaranteed

Known issues requiring remediation:
- Test settings pollute production schema (should use test augmentation)
- WorkspaceStore export breaks ExtensionManager API contract
- ComfyWorkflowJSON cast hides ISerialisedGraph type gap
- z.any() usage violates project rules

Amp-Thread-ID: https://ampcode.com/threads/T-019c1833-2352-728b-a523-a8f440fd3ba1
Co-authored-by: Amp <amp@ampcode.com>
2026-02-01 00:17:48 -08:00
Alexander Brown
d605b5da67 fix: browser_tests Phase 3 - type annotations and final fixes
- Add 'this: ExpectMatcherState' to ComfyPage.ts makeMatcher function
- Add type annotations to parameters (slot, comfyPage, w, inputs)
- Add 'as any' for ExtensionManager dynamic properties (workflow, focusMode, colorPalette, queueSettings)
- Fix keybindings import paths to use '/types' suffix
- Cast Subgraph types and CanvasPointerEvent in SubgraphHelper
- Fix test setting IDs with 'as any' in useSettingSearch, extensionAPI specs
- Fix AppReadiness, colorPalette, featureFlags type issues
- Replace removed ComfyPage properties with DefaultGraphPositions
- Remove unused _canvas parameter from ClipboardHelper
- Add non-null assertions for app, vaeInput, convertedInput

Reduces browser_tests typecheck errors from 72 to 0.

Amp-Thread-ID: https://ampcode.com/threads/T-019c17a3-2482-7115-8e42-ba0bbb0c9cda
Co-authored-by: Amp <amp@ampcode.com>
2026-01-31 21:58:03 -08:00
Alexander Brown
302e9d5be7 fix: browser_tests Phase 2 - null assertions
Amp-Thread-ID: https://ampcode.com/threads/T-019c1797-ff0a-7418-840b-8c76fb81eeec
Co-authored-by: Amp <amp@ampcode.com>
2026-01-31 21:58:00 -08:00
Alexander Brown
b56045c462 fix: browser_tests Phase 1 - mechanical fixes
- Rename dragAndDrop to dragDrop (7 occurrences)

- Add override modifiers in SidebarTab.ts (4 fixes)

- Remove .ts import extensions in actionbar.spec.ts

- Prefix unused variables with underscore (9 files)

- Fix ESLint import() type annotation in globals.d.ts

Reduces typecheck:browser errors from 229 to 215

Amp-Thread-ID: https://ampcode.com/threads/T-019c1787-c781-761d-b95a-4844e909e64c
Co-authored-by: Amp <amp@ampcode.com>
2026-01-31 21:57:58 -08:00
Alexander Brown
6cd105fdf0 test: add Window type augmentation and standardize window access
- Add browser_tests/types/globals.d.ts with Window interface augmentation

- Add types for app, graph, LiteGraph, LGraphBadge and test globals

- Standardize window['prop'] to window.prop across 37 test files

- Update browser_tests/tsconfig.json to include new type definitions

Amp-Thread-ID: https://ampcode.com/threads/T-019c16b3-cc31-70ea-9727-a933cb0ee942
Co-authored-by: Amp <amp@ampcode.com>
2026-01-31 21:57:55 -08:00
Alexander Brown
fdbbddaf62 fix: include type augmentation files in browser_tests tsconfig
- Add src/types/**/*.d.ts and global.d.ts to include array

- Use vue-tsc for typecheck:browser to match main typecheck

- Fixes ~160 src/ type errors in browser test compilation

Amp-Thread-ID: https://ampcode.com/threads/T-019c16af-3867-74d9-9242-e3fa8e17947e
Co-authored-by: Amp <amp@ampcode.com>
2026-01-31 21:57:52 -08:00
Alexander Brown
9cbba233aa fix: replace unsupported _vue selector with getByLabel in VueNodeHelpers
Amp-Thread-ID: https://ampcode.com/threads/T-019c169e-9615-7608-9421-0c009920efe4
Co-authored-by: Amp <amp@ampcode.com>
2026-01-31 21:57:50 -08:00
github-actions
03d54833d4 [automated] Update test expectations 2026-02-01 01:13:52 +00:00
Alexander Brown
818d0ef5f6 fix: update nodeLibrary customize dialog selectors
Replace getByRole('radio') with button group selectors.

The Customize Folder dialog now uses PrimeVue SelectButton components instead of radio buttons.

Amp-Thread-ID: https://ampcode.com/threads/T-019c1698-7c35-747e-8b78-b9d47f49c950
Co-authored-by: Amp <amp@ampcode.com>
2026-01-31 16:33:12 -08:00
Alexander Brown
8ccc8b9d8f fix: browser test fixes and typecheck script
- Fix widgetTextBox locator in ComfyPage
- Add exact match for 'Add' button in search filter panel
- Fix ClipboardHelper to properly handle undefined vs null locators
- Use canvasOps.dragAndDrop in NodeOperationsHelper
- Use nodeOps.waitForGraphNodes in link interaction tests
- Add typecheck:browser script for browser tests

Amp-Thread-ID: https://ampcode.com/threads/T-019c1696-c595-7724-8dca-64f73f19f478
Co-authored-by: Amp <amp@ampcode.com>
2026-01-31 16:25:40 -08:00
Alexander Brown
959e91bf4d test: add BottomPanel page object for E2E tests
Extract repeated locators into BottomPanel and ShortcutsTab page objects.

Refactor bottomPanelShortcuts.spec.ts and menu.spec.ts to use the new page object.

Amp-Thread-ID: https://ampcode.com/threads/T-019c167b-dacb-706c-9626-4a31a1f6ab6e
Co-authored-by: Amp <amp@ampcode.com>
2026-01-31 16:05:37 -08:00
Alexander Brown
864fdfe717 chore: enforce LF line endings for all text files
Amp-Thread-ID: https://ampcode.com/threads/T-019c1674-603d-7052-bec9-255b429953cc
Co-authored-by: Amp <amp@ampcode.com>
2026-01-31 15:48:19 -08:00
Alexander Brown
20fdf46c5c Update agent docs to use local version for playwright tests. 2026-01-31 15:45:00 -08:00
Alexander Brown
4e00e8428f refactor: wire helpers into ComfyPage and update test usages
Phase 2 of ComfyPage refactor:

- Add ToastHelper, DragDropHelper, CommandHelper instances to ComfyPage

- Remove migrated methods from ComfyPage (command, toast, dragDrop, workflow, canvasOps, nodeOps methods)

- Update all test files to use new helper paths

- Keep visibleToasts as passthrough getter for backward compatibility

Amp-Thread-ID: https://ampcode.com/threads/T-019c1666-ed27-773c-976a-07cc805d7a6c
Co-authored-by: Amp <amp@ampcode.com>
2026-01-31 15:44:57 -08:00
Alexander Brown
be7f5b30b7 refactor: create and extend browser test helpers for ComfyPage extraction
Phase 1 of ComfyPage refactor - extract method groups into helpers:

- New ToastHelper: toast error/visibility/close methods

- New DragDropHelper: file and URL drag-and-drop methods

- New CommandHelper: command execution and registration

- Extended WorkflowHelper: undo/redo queue, modified state, export

- Extended CanvasHelper: group position/drag, edge connect/disconnect

- Extended NodeOperationsHelper: prompt dialog, node drag, widget adjust

Amp-Thread-ID: https://ampcode.com/threads/T-019c165a-5aba-7582-9f2b-e5b2bba2783b
Co-authored-by: Amp <amp@ampcode.com>
2026-01-31 15:44:56 -08:00
GitHub Action
218fe314ee [automated] Apply ESLint and Oxfmt fixes 2026-01-31 23:17:30 +00:00
Alexander Brown
7c0326ec33 fix: forward data-testid attrs through TreeExplorer to fix E2E tests
- Add inheritAttrs: false and v-bind="$attrs" to TreeExplorer.vue
- Add #folder slot with NodeTreeFolder in NodeLibrarySidebarTab.vue
- Fixes 92 failing tests that couldn't find node-library-tree or folder elements

Amp-Thread-ID: https://ampcode.com/threads/T-019c1636-dca2-77ad-85ad-bcc53aa73e94
Co-authored-by: Amp <amp@ampcode.com>
2026-01-31 15:14:18 -08:00
Alexander Brown
be427c325b refactor(tests): use DefaultGraphPositions constants for raw coordinates
- Replace hardcoded coordinates with DefaultGraphPositions references

- Fix y-coordinate inconsistency (625 vs 645) in emptyLatentWidgetClick usage

Amp-Thread-ID: https://ampcode.com/threads/T-019c161a-ed63-7545-bbd0-655efec143c4
Co-authored-by: Amp <amp@ampcode.com>
2026-01-31 14:39:22 -08:00
Alexander Brown
2e58c77d9e Maybe newer comfy core? 2026-01-31 14:01:40 -08:00
Alexander Brown
ccf459684e refactor: remove ComfyPage wrapper methods, use helpers directly
- Remove 27 deprecated/wrapper methods from ComfyPage
- Migrate callers to use helper classes directly:
  - keyboard.selectAll/bypass/undo/redo/moveUp/moveDown
  - clipboard.copy/paste
  - settings.setSetting/getSetting
  - workflow.loadWorkflow/deleteWorkflow/setupWorkflowsDirectory
  - contextMenu.clickMenuItem/clickLitegraphMenuItem
  - nodeOps.resizeNode with DefaultGraphPositions
  - canvasOps.clickEmptySpace with DefaultGraphPositions
- Replace deprecated node click methods with direct canvas clicks
- Replace position getter properties with DefaultGraphPositions imports

Amp-Thread-ID: https://ampcode.com/threads/T-019c15e7-2319-76ec-855e-098ec75ef18a
Co-authored-by: Amp <amp@ampcode.com>
2026-01-31 13:48:43 -08:00
Alexander Brown
c87b863a3b Use named imports. 2026-01-31 13:22:15 -08:00
Alexander Brown
5b6d1f5bdb refactor: inject KeyboardHelper into ClipboardHelper
Remove duplicated nextFrame and ctrlSend methods from ClipboardHelper
by delegating to KeyboardHelper instead.

Amp-Thread-ID: https://ampcode.com/threads/T-019c15b9-efed-72eb-b092-1e92a11f44e3
Co-authored-by: Amp <amp@ampcode.com>
2026-01-31 12:33:38 -08:00
Alexander Brown
98c90d16a0 test: remove unused select2Nodes and fix flaky timeout
- Remove select2Nodes helper method from NodeOperationsHelper
- Replace usages with selectNodes(['CLIP Text Encode (Prompt)'])
- Increase flaky timeout in mobileBaseline test from 256ms to 5000ms

Amp-Thread-ID: https://ampcode.com/threads/T-019c15b9-efed-72eb-b092-1e92a11f44e3
Co-authored-by: Amp <amp@ampcode.com>
2026-01-31 12:24:32 -08:00
Alexander Brown
dd2c25c635 Bump container to 0.0.11 (Updated playwright) 2026-01-31 12:23:46 -08:00
Alexander Brown
7f2454efec fix(browser_tests): replace .nth() with semantic selectors
- Remove unused saveButton selector from ComfyMenu
- Replace widgetTextBox .nth(1) with node-scoped selector
- Replace .nth(3) toast selector with .p-toast-message filter
- Replace .nth(1) category selector with getByTestId
- Replace .nth(1) node selector with getNodeInFolder() helper
- Add nodeSelector(), folderSelector(), getNodeInFolder() methods
- Add saveButton and nodeLibrary TestIds to selectors.ts

Amp-Thread-ID: https://ampcode.com/threads/T-019c155c-92e1-76f3-b6ce-7fc3ffa11582
Co-authored-by: Amp <amp@ampcode.com>
2026-01-31 10:52:41 -08:00
Alexander Brown
22ff808d59 fix(browser_tests): use getByRole for interactive elements
Replace fragile CSS selectors with Playwright getByRole() for better

accessibility-based testing:

- bottomPanelShortcuts.spec.ts: button[aria-label] -> getByRole

- execution.spec.ts: .p-dialog-close-button -> getByRole

- backgroundImageUpload.spec.ts: button:has(.pi-*) -> getByRole

- nodeHelp.spec.ts: button:has(.pi-question) -> getByRole

- BaseDialog.ts: closeButton uses getByRole

- ComfyNodeSearchBox.ts: Add button uses getByRole

- Topbar.ts: close-button uses getByRole

Amp-Thread-ID: https://ampcode.com/threads/T-019c155c-92e1-76f3-b6ce-7fc3ffa11582
Co-authored-by: Amp <amp@ampcode.com>
2026-01-31 10:46:11 -08:00
Alexander Brown
2622b16571 test(browser): add ContextMenu page object (Phase 5.1)
Amp-Thread-ID: https://ampcode.com/threads/T-019c137b-34ba-736a-afb6-0a41baf9358f
Co-authored-by: Amp <amp@ampcode.com>
2026-01-31 01:58:23 -08:00
Alexander Brown
ea1d284b22 test(browser): add BaseDialog class (Phase 5.2)
Amp-Thread-ID: https://ampcode.com/threads/T-019c137b-34ba-736a-afb6-0a41baf9358f
Co-authored-by: Amp <amp@ampcode.com>
2026-01-31 01:57:43 -08:00
Alexander Brown
4ffbcc7165 test: add deprecation notices to legacy node click methods (Phase 4.5)
Amp-Thread-ID: https://ampcode.com/threads/T-019c1373-f6d0-7426-a3ee-5673891f9dcc
Co-authored-by: Amp <amp@ampcode.com>
2026-01-31 01:53:40 -08:00
Alexander Brown
aea5afa8f3 test: extract SettingsHelper from ComfyPage (Phase 4.1)
Amp-Thread-ID: https://ampcode.com/threads/T-019c1373-f6d0-7426-a3ee-5673891f9dcc
Co-authored-by: Amp <amp@ampcode.com>
2026-01-31 01:50:20 -08:00
Alexander Brown
10eddeb153 test: replace hardcoded positions with computed NodeReference positions
- nodeSearchBox.spec.ts: Use NodeReference.getOutput() for CLIP output slot position

- rightClickMenu.spec.ts: Use NodeReference.getTitlePosition() for node dragging

- Add getTitlePosition() helper to NodeReference for drag operations

Amp-Thread-ID: https://ampcode.com/threads/T-019c1367-6a59-7752-9329-17cbf152fc62
Co-authored-by: Amp <amp@ampcode.com>
2026-01-31 01:41:11 -08:00
Alexander Brown
062c4d3964 refactor: replace fragile CSS selectors in SidebarTab.ts and SettingDialog.ts
Amp-Thread-ID: https://ampcode.com/threads/T-019c1359-48cc-7676-abc8-2de8c57b52cf
Co-authored-by: Amp <amp@ampcode.com>
2026-01-31 01:26:28 -08:00
Alexander Brown
e193924a36 refactor: replace fragile CSS selectors with data-testid in ComfyPage.ts
Amp-Thread-ID: https://ampcode.com/threads/T-019c1359-48cc-7676-abc8-2de8c57b52cf
Co-authored-by: Amp <amp@ampcode.com>
2026-01-31 01:24:24 -08:00
Alexander Brown
31c643d29e feat: add data-testid to dialog components for stable test selectors
- Add data-testid='settings-dialog' to settings container

- Add data-testid='about-panel' to AboutPanel

- Add data-testid='settings-tab-{key}' to all sidebar navigation items

Amp-Thread-ID: https://ampcode.com/threads/T-019c1359-48cc-7676-abc8-2de8c57b52cf
Co-authored-by: Amp <amp@ampcode.com>
2026-01-31 01:22:12 -08:00
Alexander Brown
bbe9267f4a feat: add data-testid to sidebar components for stable test selectors
Amp-Thread-ID: https://ampcode.com/threads/T-019c1359-48cc-7676-abc8-2de8c57b52cf
Co-authored-by: Amp <amp@ampcode.com>
2026-01-31 01:21:36 -08:00
Alexander Brown
4a155dd796 feat: add centralized test selectors constants file
Amp-Thread-ID: https://ampcode.com/threads/T-019c1359-48cc-7676-abc8-2de8c57b52cf
Co-authored-by: Amp <amp@ampcode.com>
2026-01-31 01:21:06 -08:00
Alexander Brown
b7986ae5f6 fix: remove setTimeout anti-patterns in test fixtures
Remove redundant setTimeout calls inside page.evaluate() in SubgraphHelper.ts.

The waits were unnecessary since proper Playwright waitForSelector calls already exist after the evaluate returns.

Amp-Thread-ID: https://ampcode.com/threads/T-019c134d-cf30-7028-aca7-cfc6227c90ef
Co-authored-by: Amp <amp@ampcode.com>
2026-01-31 01:17:40 -08:00
Alexander Brown
b01426be5d fix: remove setTimeout anti-pattern in toggleTheme
Amp-Thread-ID: https://ampcode.com/threads/T-019c134d-cf30-7028-aca7-cfc6227c90ef
Co-authored-by: Amp <amp@ampcode.com>
2026-01-31 01:17:00 -08:00
Alexander Brown
681709f8e7 refactor(browser_tests): remove deprecated proxy methods from ComfyPage
Migrate all test callers to use helper classes directly:

- nodeOps: getGraphNodesCount, getNodeRefById, selectNodes, etc.

- canvasOps: dragAndDrop, zoom, pan, resetView, etc.

- subgraph: rightClickInputSlot, connectToOutput, etc.

Reduces ComfyPage.ts from 1335 to 1085 lines (-250 lines).

Amp-Thread-ID: https://ampcode.com/threads/T-019c1318-58b7-757f-801c-5b676f0d3421
Co-authored-by: Amp <amp@ampcode.com>
2026-01-31 00:52:33 -08:00
Alexander Brown
2c7dad3088 refactor: extract NodeOperationsHelper from ComfyPage.ts
Phase 5 of ComfyPage refactoring: extracts node query, selection, resize, and group conversion operations into NodeOperationsHelper.

Methods extracted: getGraphNodesCount, getSelectedGraphNodesCount, getNodes, waitForGraphNodes, getFirstNodeRef, getNodeRefById, getNodeRefsByType, getNodeRefsByTitle, selectNodes, select2Nodes, resizeNode, convertAllNodesToGroupNode

ComfyPage.ts: 1383 -> 1329 lines (-54)

Amp-Thread-ID: https://ampcode.com/threads/T-019c1313-7d0e-718d-911b-f6954a15eb9b
Co-authored-by: Amp <amp@ampcode.com>
2026-01-31 00:05:51 -08:00
Alexander Brown
efbb3b07f3 style: remove semicolons from litegraphUtils.ts
Amp-Thread-ID: https://ampcode.com/threads/T-019c1300-e933-769c-b05f-ea00c2d32dd1
Co-authored-by: Amp <amp@ampcode.com>
2026-01-31 00:01:17 -08:00
Alexander Brown
5ddce4025c refactor: extract CanvasHelper from ComfyPage.ts
- Create CanvasHelper class for canvas viewport operations

- Extract pan, zoom, dragAndDrop, rightClick, doubleClick methods

- Extract moveMouseToEmptyArea, convertOffsetToCanvas methods

- Add deprecation proxies for backward compatibility

- Add canvasOps property to ComfyPage

Amp-Thread-ID: https://ampcode.com/threads/T-019c1300-e933-769c-b05f-ea00c2d32dd1
Co-authored-by: Amp <amp@ampcode.com>
2026-01-30 23:45:43 -08:00
Alexander Brown
e4b520c602 refactor: extract SubgraphHelper from ComfyPage.ts
- Create browser_tests/fixtures/helpers/SubgraphHelper.ts with 10 methods

- Add subgraph: SubgraphHelper property to ComfyPage

- Replace original methods with deprecation proxy stubs

- Reduces ComfyPage.ts from 1633 to 1409 lines (~224 lines removed)

Amp-Thread-ID: https://ampcode.com/threads/T-019c12cc-5256-7359-b830-28d1c3639daa
Co-authored-by: Amp <amp@ampcode.com>
2026-01-30 22:49:43 -08:00
Alexander Brown
ca7ed8c8e9 refactor: extract DebugHelper from ComfyPage.ts
- Create browser_tests/fixtures/helpers/DebugHelper.ts with 7 methods

- Add debug: DebugHelper property to ComfyPage

- Replace debug methods with deprecation proxies delegating to this.debug

- Reduces ComfyPage.ts by ~140 lines

Amp-Thread-ID: https://ampcode.com/threads/T-019c1206-3625-71ef-b976-1796574b9642
Co-authored-by: Amp <amp@ampcode.com>
2026-01-30 19:11:17 -08:00
Alexander Brown
99871796e0 refactor: extract DefaultGraphPositions constants from ComfyPage.ts
- Create browser_tests/fixtures/constants/defaultGraphPositions.ts with all hardcoded default graph positions

- Create browser_tests/fixtures/constants/types.ts with Position and Size interfaces

- Update ComfyPage.ts to import and use DefaultGraphPositions

- Reduces duplication and prepares for further modular extraction

Amp-Thread-ID: https://ampcode.com/threads/T-019c1201-adec-7363-96d5-446d0a98e4cf
Co-authored-by: Amp <amp@ampcode.com>
2026-01-30 19:07:34 -08:00