Compare commits

..

31 Commits

Author SHA1 Message Date
Terry Jia
e5bee1b72a test 2025-09-07 21:28:01 -04:00
github-actions
4ef46f8bc3 Update test expectations [skip ci] 2025-09-08 01:26:39 +00:00
Terry Jia
8b8aaffe02 fix cases on Logi M705 2025-09-07 20:41:01 -04:00
Terry Jia
3c7d4202e4 console.log 2025-09-05 15:32:27 -04:00
github-actions
48fe4a648b Update test expectations [skip ci] 2025-09-05 19:31:16 +00:00
Terry Jia
f22383eb57 remove console log 2025-09-05 14:51:33 -04:00
Terry Jia
233c306431 bug fix 2025-09-04 23:09:44 -04:00
Terry Jia
780f1936ed test fix 2025-09-04 22:50:26 -04:00
Terry Jia
bbb9d47724 bug fix 2025-09-04 22:16:55 -04:00
github-actions
705d0565dd Update test expectations [skip ci] 2025-09-05 01:56:33 +00:00
Terry Jia
935587571c fix playwright test 2025-09-04 21:15:10 -04:00
Terry Jia
63d97a6303 improve standard canvas navigation 2025-09-04 20:39:22 -04:00
Alexander Brown
58313ea05b devex: re-add caching of playwright browser installs (#5350) 2025-09-04 12:18:11 -07:00
filtered
ae690bbfa4 DevX: Update CSS directives for Tailwind v4 (#5347)
- Provides proper IDE hints and removes warnings from .vue SFC files.
- Replaces all the v2 info with v4.
2025-09-04 10:32:22 -07:00
filtered
9920f310be [CI] Fix action throws after pnpm change (#5342) 2025-09-04 00:27:05 -07:00
Comfy Org PR Bot
ec7de6f4c5 [release] Increment version to 1.27.0 (#5343)
Co-authored-by: benceruleanlu <162923238+benceruleanlu@users.noreply.github.com>
2025-09-03 23:58:58 -07:00
Alexander Brown
a82fcd8ec6 Knip: Enable more rules (#5309)
* knip: Simplify config

* knip: enable unlisted, fix issues

* knip: Add ignore for build dependencies (Vite plugin indirect reference)

* knip: Prune dependencies

* knip: One more Unused dep

* git: Standard line end for yaml

* [auto-fix] Apply ESLint and Prettier fixes

* knip: Add exceptions for tailwindcss post-rebase.
Not sure why we need to except it.

* Update test expectations [skip ci]

---------

Co-authored-by: GitHub Action <action@github.com>
Co-authored-by: github-actions <github-actions@github.com>
2025-09-03 22:57:53 -07:00
filtered
9a9f8c72f2 Fix electron types update command in CI (#5337)
Use --workspace-root flag to install at workspace level
2025-09-03 22:45:51 -07:00
filtered
065d9e82b9 [chore] Update electron-types to 0.4.69 (#5339) 2025-09-03 22:35:01 -07:00
Alexander Piskun
4748378387 add prices for ByteDance Video API nodes (#5336) 2025-09-03 22:28:19 -07:00
Arjan Singh
ad64dbb81a [feat] register UNETLoader, UpscaleModelLoader, StylemModelLoader... (#5324)
* [feat] register UNETLoader, UpscaleModelLoader, StylemModelLoader, GLIGENLoader

Also added tests for modelToNodeStore

* [fix] code review feedback on tests

* [fix] typescript bikeshedding

* [fix] remove unnecessary interface mocks
2025-09-04 01:24:24 +00:00
Johnpaul Chiwetelu
3c247e57f3 Remove caching of Playwright browsers from CI workflow (#5325)
* [refactor] Remove caching of Playwright browsers from CI workflow

* restore upload artifact path

* [fix] Adjust timeout for playwright tests to allow up to 15 minutes

* [fix] Update artifact name for Playwright report to match standard naming convention
2025-09-03 23:22:36 +01:00
Christian Byrne
589c362bc6 Trigger CI (#5326)
* Trigger CI

* Update test expectations [skip ci]

---------

Co-authored-by: github-actions <github-actions@github.com>
2025-09-03 14:34:54 -07:00
AustinMroz
c4bb8a1435 Improve click regions for widget interaction (#5253) 2025-09-03 12:44:13 -07:00
Simula_r
c74c1c014f Feat/adaptive lod threshold (#5249)
* feat: use a physical min font size as the LOD threshold instead of an abritrary zoom level that is different on different screens

* feat: min 1px font size, max 24ox font size

* refactor: settings text

* refactor: settings text

* refactor: version

* fix: default font size from 10 to 8

* feat: cache the threshold and move it's calculation out of the render loop

* refactor: comments

* refactor: removed package-lock

* refactor: improve how we manage deprecated settings, and removed any types

* refactor: how the migration settings formula works so we get prev settings closer to the new font size setting

* test: add in zoom and settings test for LOD

* refactor: tests to use best practices

* Update test expectations [skip ci]

---------

Co-authored-by: github-actions <github-actions@github.com>
2025-09-03 12:38:44 -07:00
Alexander Brown
85017dbba0 Upgrade: Tailwind v4 (#5246)
* temp: move tailwind calls out of the layer

* temp: ts tailwind config

* upgrade: Tailwind v4
This got a little out of hand.
Had to add a relative reference to the stylesheet in any component that uses @apply instead of the utility classes directly.

* upgrade: bg-opacity is now a modifier

* fix: Classic menu buttons assume a border

* Update test expectations [skip ci]

* fix: New preflight removal pattern

* fix: Skeletons don't have skin

* Update test expectations [skip ci]

* fix: Missing @reference

* [auto-fix] Apply ESLint and Prettier fixes

---------

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: GitHub Action <action@github.com>
2025-09-03 12:37:43 -07:00
Johnpaul Chiwetelu
caee3832a5 Playwright Test Sharding (#5311)
* [feat] Enhance Playwright testing workflow with sharding and report merging

* feat: shard playwright tests into 8 processes
2025-09-03 12:16:37 -07:00
Christian Byrne
e1f29465a9 [fix] Enable mouse gestures over video previews (#5279)
* [fix] Enable mouse gestures over video previews - fixes ctrl+scroll zoom and space+drag panning

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* [improve] Enhance code clarity in media gesture handling with descriptive constants

* [clean] Remove dangling comment in handlePointer method

* [improve] Use satisfies and partial mocking for better type safety in tests

- Replace 'as any' with vi.mocked({partial: true}) for store mocks
- Use 'satisfies Partial<Event>' for better event type checking
- Remove 'not.toThrow' test as it tests default behavior
- Improve test readability and type safety per review feedback

* [improve] Test actual canvas existence check instead of side effects

- Replace vague 'graceful handling' test with specific 'early return' test
- Verify that getCanvas() is actually called to check canvas existence
- Test early return behavior when canvas is null rather than just preventDefault side effect
- More robust test that validates the intended logic flow

* [refactor] Use localized mocking instead of global mock functions

- Replace global mockGetCanvas and mockGet with in-situ vi.mocked() calls
- Extract store functions directly in test cases for better locality
- Follow DrJKL's suggestion for cleaner test structure
- Maintains same test coverage with improved readability

---------

Co-authored-by: Claude <noreply@anthropic.com>
2025-09-03 12:01:45 -07:00
Comfy Org PR Bot
0afbf94eb7 [release] Increment version to 1.26.9 (#5322)
Co-authored-by: benceruleanlu <162923238+benceruleanlu@users.noreply.github.com>
2025-09-03 13:53:47 -04:00
snomiao
f7889b514e [test] Fix flaky TTL expiration test in remoteWidgets.spec.ts (#5306)
* [test] Fix flaky TTL expiration test in remoteWidgets.spec.ts

The test 'refreshes options when TTL expires' was flaky due to timing issues.
Fixed by:
- Increasing initial widget update wait from 256ms to 300ms for stability
- Extending TTL expiration wait from 512ms to 600ms to ensure TTL has fully expired
- Adding explicit click location and wait after refresh trigger
- Adding clear comments explaining the timing requirements

This should make the test more reliable by providing sufficient buffer time for the TTL to expire and the widget to refresh properly.

🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>

* [chore] Fix formatting in remoteWidgets.spec.ts

Remove trailing whitespace as per prettier rules

🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>

---------

Co-authored-by: Claude <noreply@anthropic.com>
2025-09-04 02:22:11 +09:00
Christian Byrne
a704d6e56f Fix snapshot tests and update PR title (#5314)
Updates outdated snapshots to match current LiteGraph behavior.
2025-09-03 10:13:06 -07:00
303 changed files with 3120 additions and 1994 deletions

1
.gitattributes vendored
View File

@@ -9,6 +9,7 @@
*.mts text eol=lf
*.ts text eol=lf
*.vue text eol=lf
*.yaml text eol=lf
# Generated files
src/types/comfyRegistryTypes.ts linguist-generated=true

View File

@@ -56,39 +56,14 @@ jobs:
fi
echo "branch=${{ fromJSON(steps.pr-info.outputs.result).sanitized_branch }}" >> $GITHUB_OUTPUT
- name: Install pnpm
if: fromJSON(steps.pr-info.outputs.result).number != null
uses: pnpm/action-setup@v4
with:
version: 10
- uses: actions/setup-node@v4
if: fromJSON(steps.pr-info.outputs.result).number != null
with:
node-version: lts/*
- name: Download playwright report shards
- name: Download playwright report
if: fromJSON(steps.pr-info.outputs.result).number != null
uses: actions/download-artifact@v4
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
run-id: ${{ github.event.workflow_run.id }}
pattern: playwright-report-${{ matrix.browser }}-shard-*
path: playwright-shards
- name: Install Playwright
if: fromJSON(steps.pr-info.outputs.result).number != null
run: npm install @playwright/test
- name: Merge reports
if: fromJSON(steps.pr-info.outputs.result).number != null
run: |
npx playwright merge-reports --reporter html ./playwright-shards
mv playwright-report merged-report
- name: Rename merged report
if: fromJSON(steps.pr-info.outputs.result).number != null
run: mv merged-report playwright-report
name: playwright-report-${{ matrix.browser }}
path: playwright-report
- name: Install Wrangler
if: fromJSON(steps.pr-info.outputs.result).number != null
@@ -103,20 +78,14 @@ jobs:
RETRY_COUNT=0
MAX_RETRIES=3
SUCCESS=false
DEPLOYMENT_URL=""
while [ $RETRY_COUNT -lt $MAX_RETRIES ] && [ $SUCCESS = false ]; do
RETRY_COUNT=$((RETRY_COUNT + 1))
echo "Deployment attempt $RETRY_COUNT of $MAX_RETRIES..."
OUTPUT=$(npx wrangler pages deploy playwright-report --project-name=${{ steps.project-name.outputs.name }} --branch=${{ steps.project-name.outputs.branch }} 2>&1)
EXIT_CODE=$?
if [ $EXIT_CODE -eq 0 ]; then
if npx wrangler pages deploy playwright-report --project-name=${{ steps.project-name.outputs.name }} --branch=${{ steps.project-name.outputs.branch }}; then
SUCCESS=true
DEPLOYMENT_URL=$(echo "$OUTPUT" | grep -oE 'https://[^ ]+\.pages\.dev' | head -1)
echo "Deployment successful on attempt $RETRY_COUNT"
echo "URL: $DEPLOYMENT_URL"
else
echo "Deployment failed on attempt $RETRY_COUNT"
if [ $RETRY_COUNT -lt $MAX_RETRIES ]; then
@@ -130,25 +99,10 @@ jobs:
echo "All deployment attempts failed"
exit 1
fi
echo "deployment_url=$DEPLOYMENT_URL" >> $GITHUB_OUTPUT
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
- name: Save deployment info
if: fromJSON(steps.pr-info.outputs.result).number != null
run: |
echo "${{ matrix.browser }}|${{ steps.cloudflare-deploy.outcome == 'success' && '0' || '1' }}|${{ steps.cloudflare-deploy.outputs.deployment_url || '#' }}" > deployment-info-${{ matrix.browser }}.txt
- name: Upload deployment info
if: fromJSON(steps.pr-info.outputs.result).number != null
uses: actions/upload-artifact@v4
with:
name: deployment-info-${{ matrix.browser }}
path: deployment-info-${{ matrix.browser }}.txt
retention-days: 1
comment-tests-starting:
runs-on: ubuntu-latest
if: github.repository == 'Comfy-Org/ComfyUI_frontend' && github.event.workflow_run.event == 'pull_request' && github.event.action == 'requested'
@@ -190,14 +144,14 @@ jobs:
echo "" >> comment.md
echo "⏰ Started at: ${{ steps.completion-time.outputs.time }} UTC" >> comment.md
echo "" >> comment.md
echo "### 🚀 Running Tests (5 parallel shards per browser)" >> comment.md
echo "- 🧪 **chromium**: Running tests in 5 shards..." >> comment.md
echo "- 🧪 **chromium-0.5x**: Running tests in 5 shards..." >> comment.md
echo "- 🧪 **chromium-2x**: Running tests in 5 shards..." >> comment.md
echo "- 🧪 **mobile-chrome**: Running tests in 5 shards..." >> comment.md
echo "### 🚀 Running Tests" >> comment.md
echo "- 🧪 **chromium**: Running tests..." >> comment.md
echo "- 🧪 **chromium-0.5x**: Running tests..." >> comment.md
echo "- 🧪 **chromium-2x**: Running tests..." >> comment.md
echo "- 🧪 **mobile-chrome**: Running tests..." >> comment.md
echo "" >> comment.md
echo "---" >> comment.md
echo "⏱️ Tests are running in parallel across 20 jobs (4 browsers × 5 shards)..." >> comment.md
echo "⏱️ Please wait while tests are running across all browsers..." >> comment.md
- name: Comment PR - Tests Started
if: steps.pr.outputs.result != 'null'

View File

@@ -12,6 +12,7 @@ jobs:
runs-on: ubuntu-latest
outputs:
cache-key: ${{ steps.cache-key.outputs.key }}
playwright-version: ${{ steps.playwright-version.outputs.PLAYWRIGHT_VERSION }}
steps:
- name: Checkout ComfyUI
uses: actions/checkout@v4
@@ -44,7 +45,6 @@ jobs:
cache: 'pnpm'
cache-dependency-path: 'ComfyUI_frontend/pnpm-lock.yaml'
- name: Cache tool outputs
uses: actions/cache@v4
with:
@@ -67,6 +67,13 @@ jobs:
id: cache-key
run: echo "key=$(date +%s)" >> $GITHUB_OUTPUT
- name: Playwright Version
id: playwright-version
run: |
PLAYWRIGHT_VERSION=$(pnpm ls @playwright/test --json | jq --raw-output '.[0].devDependencies["@playwright/test"].version')
echo "PLAYWRIGHT_VERSION=$PLAYWRIGHT_VERSION" >> $GITHUB_OUTPUT
working-directory: ComfyUI_frontend
- name: Save cache
uses: actions/cache/save@5a3ec84eff668545956fd18022155c47e93e2684
with:
@@ -75,7 +82,8 @@ jobs:
ComfyUI_frontend
key: comfyui-setup-${{ steps.cache-key.outputs.key }}
playwright-tests:
# Sharded chromium tests
playwright-tests-chromium-sharded:
needs: setup
runs-on: ubuntu-latest
permissions:
@@ -83,33 +91,8 @@ jobs:
strategy:
fail-fast: false
matrix:
include:
# Chromium tests with 5 shards (optimized distribution)
- browser: chromium
shard: 1
shard-total: 5
- browser: chromium
shard: 2
shard-total: 5
- browser: chromium
shard: 3
shard-total: 5
- browser: chromium
shard: 4
shard-total: 5
- browser: chromium
shard: 5
shard-total: 5
# Other browser variants without sharding (faster tests)
- browser: chromium-2x
shard: 1
shard-total: 1
- browser: chromium-0.5x
shard: 1
shard-total: 1
- browser: mobile-chrome
shard: 1
shard-total: 1
shardIndex: [1, 2, 3, 4, 5, 6, 7, 8]
shardTotal: [8]
steps:
- name: Wait for cache propagation
run: sleep 10
@@ -133,6 +116,85 @@ jobs:
python-version: '3.10'
cache: 'pip'
- name: Install requirements
run: |
python -m pip install --upgrade pip
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu
pip install -r requirements.txt
pip install wait-for-it
working-directory: ComfyUI
- name: Cache Playwright Browsers
uses: actions/cache@v4
id: cache-playwright-browsers
with:
path: '~/.cache/ms-playwright'
key: '${{ runner.os }}-playwright-browsers-${{ needs.setup.outputs.playwright-version }}'
- name: Install Playwright Browsers
if: steps.cache-playwright-browsers.outputs.cache-hit != 'true'
run: pnpm exec playwright install chromium --with-deps
working-directory: ComfyUI_frontend
- name: Install Playwright Browsers (operating system dependencies)
if: steps.cache-playwright-browsers.outputs.cache-hit == 'true'
run: pnpm exec playwright install-deps
working-directory: ComfyUI_frontend
- name: Start ComfyUI server
run: |
python main.py --cpu --multi-user --front-end-root ../ComfyUI_frontend/dist &
wait-for-it --service 127.0.0.1:8188 -t 600
working-directory: ComfyUI
- name: Run Playwright tests (Shard ${{ matrix.shardIndex }}/${{ matrix.shardTotal }})
id: playwright
run: npx playwright test --project=chromium --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }} --reporter=blob
working-directory: ComfyUI_frontend
env:
PLAYWRIGHT_BLOB_OUTPUT_DIR: ../blob-report
- uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: blob-report-chromium-${{ matrix.shardIndex }}
path: blob-report/
retention-days: 1
playwright-tests:
# Ideally, each shard runs test in 6 minutes, but allow up to 15 minutes
timeout-minutes: 15
needs: setup
runs-on: ubuntu-latest
permissions:
contents: read
strategy:
fail-fast: false
matrix:
browser: [chromium-2x, chromium-0.5x, mobile-chrome]
steps:
- name: Wait for cache propagation
run: sleep 10
- name: Restore cached setup
uses: actions/cache/restore@5a3ec84eff668545956fd18022155c47e93e2684
with:
fail-on-cache-miss: true
path: |
ComfyUI
ComfyUI_frontend
key: comfyui-setup-${{ needs.setup.outputs.cache-key }}
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 10
- uses: actions/setup-python@v4
with:
python-version: '3.10'
cache: 'pip'
- name: Install requirements
run: |
@@ -142,57 +204,83 @@ jobs:
pip install wait-for-it
working-directory: ComfyUI
- name: Cache Playwright Browsers
uses: actions/cache@v4
id: cache-playwright-browsers
with:
path: '~/.cache/ms-playwright'
key: '${{ runner.os }}-playwright-browsers-${{ needs.setup.outputs.playwright-version }}'
- name: Install Playwright Browsers
if: steps.cache-playwright-browsers.outputs.cache-hit != 'true'
run: pnpm exec playwright install chromium --with-deps
working-directory: ComfyUI_frontend
- name: Install Playwright Browsers (operating system dependencies)
if: steps.cache-playwright-browsers.outputs.cache-hit == 'true'
run: pnpm exec playwright install-deps
working-directory: ComfyUI_frontend
- name: Start ComfyUI server
run: |
python main.py --cpu --multi-user --front-end-root ../ComfyUI_frontend/dist &
wait-for-it --service 127.0.0.1:8188 -t 600
working-directory: ComfyUI
- name: Cache Playwright browsers
uses: actions/cache@v4
with:
path: ~/.cache/ms-playwright
key: playwright-browsers-${{ runner.os }}-${{ hashFiles('ComfyUI_frontend/pnpm-lock.yaml') }}-${{ matrix.browser }}
restore-keys: |
playwright-browsers-${{ runner.os }}-${{ hashFiles('ComfyUI_frontend/pnpm-lock.yaml') }}-
playwright-browsers-${{ runner.os }}-
- name: Install Playwright Browsers
run: npx playwright install chromium --with-deps
working-directory: ComfyUI_frontend
- name: Run Playwright tests (${{ matrix.browser }}${{ matrix.shard-total > 1 && format(', shard {0}/{1}', matrix.shard, matrix.shard-total) || '' }})
- name: Run Playwright tests (${{ matrix.browser }})
id: playwright
run: |
if [ "${{ matrix.shard-total }}" -gt 1 ]; then
npx playwright test --project=${{ matrix.browser }} --shard=${{ matrix.shard }}/${{ matrix.shard-total }}
else
npx playwright test --project=${{ matrix.browser }}
fi
run: npx playwright test --project=${{ matrix.browser }} --reporter=html
working-directory: ComfyUI_frontend
- uses: actions/upload-artifact@v4
if: always() # note: use always() to allow results to be upload/report even tests failed.
if: always()
with:
name: playwright-report-${{ matrix.browser }}-shard-${{ matrix.shard }}
name: playwright-report-${{ matrix.browser }}
path: ComfyUI_frontend/playwright-report/
retention-days: 30
# Merge sharded test reports
merge-reports:
needs: playwright-tests
if: always()
needs: [playwright-tests-chromium-sharded]
runs-on: ubuntu-latest
if: ${{ !cancelled() }}
steps:
- name: Download all workflow artifacts
- name: Checkout ComfyUI_frontend
uses: actions/checkout@v4
with:
repository: 'Comfy-Org/ComfyUI_frontend'
path: 'ComfyUI_frontend'
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 10
- uses: actions/setup-node@v4
with:
node-version: lts/*
cache: 'pnpm'
cache-dependency-path: 'ComfyUI_frontend/pnpm-lock.yaml'
- name: Install dependencies
run: |
pnpm install --frozen-lockfile
working-directory: ComfyUI_frontend
- name: Download blob reports
uses: actions/download-artifact@v4
with:
pattern: playwright-report-*
path: all-reports/
path: ComfyUI_frontend/all-blob-reports
pattern: blob-report-chromium-*
merge-multiple: true
- name: Upload merged report
- name: Merge into HTML Report
run: npx playwright merge-reports --reporter html ./all-blob-reports
working-directory: ComfyUI_frontend
- name: Upload HTML report
uses: actions/upload-artifact@v4
with:
name: playwright-report-merged
path: all-reports/
name: playwright-report-chromium
path: ComfyUI_frontend/playwright-report/
retention-days: 30

View File

@@ -35,12 +35,12 @@ jobs:
electron-types-tools-cache-${{ runner.os }}-
- name: Update electron types
run: pnpm install @comfyorg/comfyui-electron-types@latest
run: pnpm install --workspace-root @comfyorg/comfyui-electron-types@latest
- name: Get new version
id: get-version
run: |
NEW_VERSION=$(node -e "console.log(JSON.parse(require('fs').readFileSync('./pnpm-lock.yaml')).packages['node_modules/@comfyorg/comfyui-electron-types'].version)")
NEW_VERSION=$(pnpm list @comfyorg/comfyui-electron-types --json --depth=0 | jq -r '.[0].version')
echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_OUTPUT
- name: Create Pull Request

44
.vscode/tailwind.json vendored
View File

@@ -2,12 +2,32 @@
"version": 1.1,
"atDirectives": [
{
"name": "@tailwind",
"description": "Use the `@tailwind` directive to insert Tailwind's `base`, `components`, `utilities` and `screens` styles into your CSS.",
"name": "@import",
"description": "Use the `@import` directive to inline CSS files, including Tailwind itself, into your stylesheet.",
"references": [
{
"name": "Tailwind Documentation",
"url": "https://tailwindcss.com/docs/functions-and-directives#tailwind"
"url": "https://tailwindcss.com/docs/functions-and-directives#import"
}
]
},
{
"name": "@theme",
"description": "Use the `@theme` directive to define custom design tokens like fonts, colors, and breakpoints.",
"references": [
{
"name": "Tailwind Documentation",
"url": "https://tailwindcss.com/docs/functions-and-directives#theme"
}
]
},
{
"name": "@layer",
"description": "Use the `@layer` directive inside `@theme` to organize custom styles into different layers like `base`, `components`, and `utilities`.",
"references": [
{
"name": "Tailwind Documentation",
"url": "https://tailwindcss.com/docs/functions-and-directives#layer"
}
]
},
@@ -22,32 +42,32 @@
]
},
{
"name": "@responsive",
"description": "You can generate responsive variants of your own classes by wrapping their definitions in the `@responsive` directive:\n```css\n@responsive {\n .alert {\n background-color: #E53E3E;\n }\n}\n```\n",
"name": "@config",
"description": "Use the `@config` directive to load a legacy JavaScript-based Tailwind configuration file.",
"references": [
{
"name": "Tailwind Documentation",
"url": "https://tailwindcss.com/docs/functions-and-directives#responsive"
"url": "https://tailwindcss.com/docs/functions-and-directives#config"
}
]
},
{
"name": "@screen",
"description": "The `@screen` directive allows you to create media queries that reference your breakpoints by **name** instead of duplicating their values in your own CSS:\n```css\n@screen sm {\n /* ... */\n}\n```\n…gets transformed into this:\n```css\n@media (min-width: 640px) {\n /* ... */\n}\n```\n",
"name": "@reference",
"description": "Use the `@reference` directive to import theme variables, custom utilities, and custom variants from other files without duplicating CSS.",
"references": [
{
"name": "Tailwind Documentation",
"url": "https://tailwindcss.com/docs/functions-and-directives#screen"
"url": "https://tailwindcss.com/docs/functions-and-directives#reference"
}
]
},
{
"name": "@variants",
"description": "Generate `hover`, `focus`, `active` and other **variants** of your own utilities by wrapping their definitions in the `@variants` directive:\n```css\n@variants hover, focus {\n .btn-brand {\n background-color: #3182CE;\n }\n}\n```\n",
"name": "@plugin",
"description": "Use the `@plugin` directive to load a legacy JavaScript-based Tailwind plugin.",
"references": [
{
"name": "Tailwind Documentation",
"url": "https://tailwindcss.com/docs/functions-and-directives#variants"
"url": "https://tailwindcss.com/docs/functions-and-directives#plugin"
}
]
}

View File

@@ -1,87 +0,0 @@
# Playwright Test Sharding Strategy
## Overview
This document describes the optimized sharding strategy for Playwright tests to achieve balanced execution times across parallel CI jobs.
## Problem
The original naive sharding approach (dividing tests equally by file count) resulted in imbalanced execution times:
- Shard 5 (chromium): 9 minutes
- Other shards: 2-6 minutes
This was due to `interaction.spec.ts` containing 61 tests with 81 screenshot comparisons, making it significantly heavier than other test files.
## Solution
### 1. Weighted Test Distribution
Tests are assigned weights based on:
- Number of test cases
- Screenshot comparisons (heavy operations)
- Test complexity (DOM manipulation, async operations)
- Historical execution time
### 2. Optimized Shard Configuration
The sharding configuration uses a greedy algorithm to distribute tests:
1. Sort tests by weight (heaviest first)
2. Assign each test to the shard with lowest total weight
3. Result: ~4.5% imbalance vs. previous 80% imbalance
### 3. Project-Specific Sharding
- **chromium**: 5 shards with optimized distribution
- **chromium-2x, chromium-0.5x**: No sharding (fast enough)
- **mobile-chrome**: No sharding (fast enough)
## Implementation
### Generated Configuration
Run `pnpm test:browser:optimize-shards` to regenerate the shard configuration based on current test weights.
### Files
- `shardConfig.generated.ts`: Auto-generated shard assignments
- `playwright-sharded.config.ts`: Playwright config using optimized shards
- `scripts/optimizeSharding.js`: Script to analyze and optimize distribution
### CI Configuration
The GitHub workflow uses a matrix strategy with explicit shard configurations:
```yaml
matrix:
include:
- browser: chromium
shard: 1
shard-total: 5
# ... etc
```
## Shard Distribution (Balanced)
| Shard | Weight | Key Tests |
|-------|--------|-----------|
| 1 | 225 | interaction.spec.ts (heavy screenshots) |
| 2 | 220 | subgraph.spec.ts, workflows, primitives |
| 3 | 225 | widget.spec.ts, nodeLibrary, templates |
| 4 | 215 | nodeSearchBox, rightClickMenu, colorPalette |
| 5 | 215 | dialog, groupNode, remoteWidgets |
## Monitoring
After deployment, monitor CI execution times to ensure shards remain balanced. If new heavy tests are added, re-run the optimization script.
## Maintenance
1. When adding new heavy tests, update `TEST_WEIGHTS` in `optimizeSharding.js`
2. Run `pnpm test:browser:optimize-shards`
3. Commit the updated `shardConfig.generated.ts`
## Expected Results
- All chromium shards complete in 3-4 minutes (vs. 2-9 minutes)
- Total CI time reduced from 9 minutes to ~4 minutes
- Better resource utilization in CI runners

View File

@@ -1,73 +0,0 @@
#!/usr/bin/env node
/**
* Custom test runner for optimized sharding
* This script determines which tests to run based on shard configuration
*/
import { spawn } from 'child_process'
import { NO_SHARD_PROJECTS, getShardTests } from './shardConfig'
const projectName = process.env.PLAYWRIGHT_PROJECT || 'chromium'
const shardInfo = process.env.PLAYWRIGHT_SHARD
// Parse shard information from environment variable (format: "current/total")
let shardIndex = 1
let totalShards = 1
if (shardInfo) {
const [current, total] = shardInfo.split('/').map(Number)
shardIndex = current
totalShards = total
}
// Check if this project should skip sharding
if (NO_SHARD_PROJECTS.includes(projectName)) {
// For projects that don't need sharding, only run on shard 1
if (shardIndex > 1) {
console.log(
`Skipping shard ${shardIndex}/${totalShards} for project ${projectName} (no sharding needed)`
)
process.exit(0)
}
console.log(`Running all tests for project ${projectName} (no sharding)`)
} else {
console.log(
`Running shard ${shardIndex}/${totalShards} for project ${projectName}`
)
}
// Get the test files for this shard
const shardTests = getShardTests(shardIndex, totalShards, projectName)
// Build the Playwright command
const args = ['playwright', 'test', `--project=${projectName}`]
if (shardTests && shardTests.length > 0) {
// Add specific test files for this shard
shardTests.forEach((testFile) => {
args.push(`browser_tests/tests/${testFile}`)
})
} else if (shardTests === null) {
// Run all tests (no custom sharding)
// Don't add any test file filters
} else {
// Empty shard - no tests to run
console.log(`No tests assigned to shard ${shardIndex}/${totalShards}`)
process.exit(0)
}
// Add CI-specific options if running in CI
if (process.env.CI) {
args.push('--reporter=github')
}
// Execute Playwright with the constructed arguments
console.log(`Executing: npx ${args.join(' ')}`)
const child = spawn('npx', args, {
stdio: 'inherit',
shell: true
})
child.on('exit', (code) => {
process.exit(code || 0)
})

View File

@@ -734,10 +734,39 @@ export class ComfyPage {
await this.nextFrame()
}
async zoom(deltaY: number, steps: number = 1) {
await this.page.mouse.move(10, 10)
async zoom(
deltaY: number,
steps: number = 1,
wheelDeltaY?: number,
position?: Position
) {
const targetPos = position || { x: 10, y: 10 }
await this.page.mouse.move(targetPos.x, targetPos.y)
for (let i = 0; i < steps; i++) {
await this.page.mouse.wheel(0, deltaY)
if (wheelDeltaY !== undefined) {
// Dispatch a custom wheel event with wheelDeltaY property
await this.page.evaluate(
({ deltaY, wheelDeltaY, x, y }) => {
const canvas = document.getElementById('graph-canvas')
if (!canvas) return
const event = new WheelEvent('wheel', {
deltaY: deltaY,
deltaX: 0,
deltaMode: 0,
clientX: x,
clientY: y,
bubbles: true,
cancelable: true
})
// Add custom wheelDeltaY property
;(event as any).wheelDeltaY = wheelDeltaY
canvas.dispatchEvent(event)
},
{ deltaY, wheelDeltaY, x: targetPos.x, y: targetPos.y }
)
} else {
await this.page.mouse.wheel(0, deltaY)
}
}
await this.nextFrame()
}

View File

@@ -1,5 +1,4 @@
import { test as base } from '@playwright/test'
import { Page } from 'playwright'
import { Page, test as base } from '@playwright/test'
export class UserSelectPage {
constructor(

View File

@@ -1,7 +1,7 @@
import type { Request, Route } from '@playwright/test'
import _ from 'es-toolkit/compat'
import fs from 'fs'
import path from 'path'
import type { Request, Route } from 'playwright'
import { v4 as uuidv4 } from 'uuid'
import type {

View File

@@ -1,201 +0,0 @@
#!/usr/bin/env node
/**
* Script to analyze test distribution and create optimized shard configurations
* Run with: node browser_tests/scripts/optimizeSharding.js
*/
import { execSync } from 'child_process'
import fs from 'fs'
import path from 'path'
import { fileURLToPath } from 'url'
const __filename = fileURLToPath(import.meta.url)
const __dirname = path.dirname(__filename)
// Test weights based on empirical data and test characteristics
const TEST_WEIGHTS = {
'interaction.spec.ts': 180, // Very heavy - 61 tests with 81 screenshots
'subgraph.spec.ts': 60, // Heavy - 23 complex tests
'widget.spec.ts': 50, // Medium-heavy - screenshots
'nodeSearchBox.spec.ts': 45, // Medium-heavy - screenshots
'dialog.spec.ts': 40,
'groupNode.spec.ts': 40,
'rightClickMenu.spec.ts': 35,
'sidebar/workflows.spec.ts': 35,
'sidebar/nodeLibrary.spec.ts': 35,
'colorPalette.spec.ts': 30,
'nodeDisplay.spec.ts': 25,
'primitiveNode.spec.ts': 25,
'templates.spec.ts': 25,
'remoteWidgets.spec.ts': 25,
'useSettingSearch.spec.ts': 25,
'nodeHelp.spec.ts': 25,
'extensionAPI.spec.ts': 20,
'bottomPanelShortcuts.spec.ts': 20,
'featureFlags.spec.ts': 20,
'sidebar/queue.spec.ts': 20,
'graphCanvasMenu.spec.ts': 20,
'nodeBadge.spec.ts': 20,
'noteNode.spec.ts': 15,
'domWidget.spec.ts': 15,
'selectionToolbox.spec.ts': 15,
'execution.spec.ts': 15,
'rerouteNode.spec.ts': 15,
'copyPaste.spec.ts': 15,
'loadWorkflowInMedia.spec.ts': 15,
'menu.spec.ts': 15,
// Light tests
'backgroundImageUpload.spec.ts': 10,
'browserTabTitle.spec.ts': 10,
'changeTracker.spec.ts': 10,
'chatHistory.spec.ts': 10,
'commands.spec.ts': 10,
'customIcons.spec.ts': 10,
'graph.spec.ts': 10,
'keybindings.spec.ts': 10,
'litegraphEvent.spec.ts': 10,
'minimap.spec.ts': 10,
'releaseNotifications.spec.ts': 10,
'subgraph-rename-dialog.spec.ts': 10,
'userSelectView.spec.ts': 10,
'versionMismatchWarnings.spec.ts': 10,
'workflowTabThumbnail.spec.ts': 10,
'actionbar.spec.ts': 10
}
/**
* Get all test files from the browser_tests directory
*/
function getTestFiles() {
const testsDir = path.join(__dirname, '..', 'tests')
const files = []
function scanDir(dir, prefix = '') {
const items = fs.readdirSync(dir)
for (const item of items) {
const fullPath = path.join(dir, item)
const relativePath = prefix ? `${prefix}/${item}` : item
if (fs.statSync(fullPath).isDirectory()) {
scanDir(fullPath, relativePath)
} else if (item.endsWith('.spec.ts')) {
files.push(relativePath)
}
}
}
scanDir(testsDir)
return files
}
/**
* Create balanced shards based on test weights
*/
function createBalancedShards(testFiles, numShards) {
// Create test entries with weights
const tests = testFiles.map((file) => ({
file,
weight: TEST_WEIGHTS[file] || 15 // Default weight for unknown tests
}))
// Sort tests by weight (heaviest first)
tests.sort((a, b) => b.weight - a.weight)
// Initialize shards
const shards = Array.from({ length: numShards }, () => ({
tests: [],
totalWeight: 0
}))
// Distribute tests using a greedy algorithm (assign to shard with least weight)
for (const test of tests) {
// Find shard with minimum weight
let minShard = shards[0]
for (const shard of shards) {
if (shard.totalWeight < minShard.totalWeight) {
minShard = shard
}
}
// Add test to the lightest shard
minShard.tests.push(test.file)
minShard.totalWeight += test.weight
}
return shards
}
/**
* Print shard configuration
*/
function printShardConfig(shards) {
console.log('\n=== Optimized Shard Configuration ===\n')
shards.forEach((shard, index) => {
console.log(`Shard ${index + 1} (weight: ${shard.totalWeight})`)
console.log(' Tests:')
shard.tests.forEach((test) => {
const weight = TEST_WEIGHTS[test] || 15
console.log(` - ${test} (weight: ${weight})`)
})
console.log()
})
// Print weight balance analysis
const weights = shards.map((s) => s.totalWeight)
const maxWeight = Math.max(...weights)
const minWeight = Math.min(...weights)
const avgWeight = weights.reduce((a, b) => a + b, 0) / weights.length
console.log('=== Balance Analysis ===')
console.log(`Max weight: ${maxWeight}`)
console.log(`Min weight: ${minWeight}`)
console.log(`Avg weight: ${avgWeight.toFixed(1)}`)
console.log(
`Imbalance: ${(((maxWeight - minWeight) / avgWeight) * 100).toFixed(1)}%`
)
}
/**
* Generate TypeScript configuration file
*/
function generateConfigFile(shards) {
const config = `/**
* Auto-generated shard configuration for balanced test distribution
* Generated on: ${new Date().toISOString()}
*/
export const OPTIMIZED_SHARDS = ${JSON.stringify(
shards.map((s) => s.tests),
null,
2
)}
export function getShardTests(shardIndex: number): string[] {
return OPTIMIZED_SHARDS[shardIndex - 1] || []
}
export function getShardPattern(shardIndex: number): string[] {
return getShardTests(shardIndex).map(test => \`**/\${test}\`)
}
`
const configPath = path.join(__dirname, '..', 'shardConfig.generated.ts')
fs.writeFileSync(configPath, config)
console.log(`\n✅ Generated configuration file: ${configPath}`)
}
// Main execution
function main() {
const numShards = parseInt(process.argv[2]) || 5
console.log(`Analyzing test distribution for ${numShards} shards...`)
const testFiles = getTestFiles()
console.log(`Found ${testFiles.length} test files`)
const shards = createBalancedShards(testFiles, numShards)
printShardConfig(shards)
generateConfigFile(shards)
}
main()

View File

@@ -1,71 +0,0 @@
/**
* Auto-generated shard configuration for balanced test distribution
* Generated on: 2025-09-02T16:09:27.236Z
*/
export const OPTIMIZED_SHARDS = [
[
'interaction.spec.ts',
'selectionToolbox.spec.ts',
'chatHistory.spec.ts',
'litegraphEvent.spec.ts',
'versionMismatchWarnings.spec.ts'
],
[
'subgraph.spec.ts',
'sidebar/workflows.spec.ts',
'primitiveNode.spec.ts',
'bottomPanelShortcuts.spec.ts',
'nodeBadge.spec.ts',
'execution.spec.ts',
'rerouteNode.spec.ts',
'changeTracker.spec.ts',
'keybindings.spec.ts',
'userSelectView.spec.ts'
],
[
'widget.spec.ts',
'sidebar/nodeLibrary.spec.ts',
'nodeHelp.spec.ts',
'templates.spec.ts',
'featureFlags.spec.ts',
'copyPaste.spec.ts',
'loadWorkflowInMedia.spec.ts',
'actionbar.spec.ts',
'commands.spec.ts',
'minimap.spec.ts',
'workflowTabThumbnail.spec.ts'
],
[
'nodeSearchBox.spec.ts',
'rightClickMenu.spec.ts',
'colorPalette.spec.ts',
'useSettingSearch.spec.ts',
'graphCanvasMenu.spec.ts',
'domWidget.spec.ts',
'menu.spec.ts',
'backgroundImageUpload.spec.ts',
'customIcons.spec.ts',
'releaseNotifications.spec.ts'
],
[
'dialog.spec.ts',
'groupNode.spec.ts',
'nodeDisplay.spec.ts',
'remoteWidgets.spec.ts',
'extensionAPI.spec.ts',
'sidebar/queue.spec.ts',
'noteNode.spec.ts',
'browserTabTitle.spec.ts',
'graph.spec.ts',
'subgraph-rename-dialog.spec.ts'
]
]
export function getShardTests(shardIndex: number): string[] {
return OPTIMIZED_SHARDS[shardIndex - 1] || []
}
export function getShardPattern(shardIndex: number): string[] {
return getShardTests(shardIndex).map((test) => `**/${test}`)
}

View File

@@ -1,158 +0,0 @@
/**
* Custom sharding configuration for Playwright tests
* Balances test execution time across shards based on test complexity
*/
export interface ShardConfig {
testFiles: string[]
weight: number // Estimated relative execution time
}
// Group tests by execution characteristics
export const HEAVY_SCREENSHOT_TESTS = [
'interaction.spec.ts' // 61 tests, 81 screenshots - heaviest test file
]
export const MEDIUM_SCREENSHOT_TESTS = [
'widget.spec.ts', // 17 tests with screenshots
'rightClickMenu.spec.ts', // 11 tests with screenshots
'nodeSearchBox.spec.ts', // 23 tests with screenshots
'groupNode.spec.ts' // 17 tests with screenshots
]
export const LIGHT_SCREENSHOT_TESTS = [
'colorPalette.spec.ts',
'primitiveNode.spec.ts',
'nodeDisplay.spec.ts',
'graphCanvasMenu.spec.ts',
'nodeBadge.spec.ts',
'noteNode.spec.ts',
'domWidget.spec.ts',
'templates.spec.ts',
'selectionToolbox.spec.ts',
'execution.spec.ts',
'rerouteNode.spec.ts',
'copyPaste.spec.ts',
'loadWorkflowInMedia.spec.ts'
]
export const HEAVY_LOGIC_TESTS = [
'subgraph.spec.ts', // 23 tests, complex logic
'dialog.spec.ts', // 21 tests
'sidebar/workflows.spec.ts', // 18 tests
'sidebar/nodeLibrary.spec.ts' // 18 tests
]
export const MEDIUM_LOGIC_TESTS = [
'remoteWidgets.spec.ts', // 14 tests
'useSettingSearch.spec.ts', // 13 tests
'sidebar/queue.spec.ts', // 12 tests
'nodeHelp.spec.ts', // 12 tests
'extensionAPI.spec.ts', // 11 tests
'bottomPanelShortcuts.spec.ts', // 11 tests
'featureFlags.spec.ts', // 9 tests
'menu.spec.ts' // 9 tests
]
export const LIGHT_LOGIC_TESTS = [
'backgroundImageUpload.spec.ts',
'browserTabTitle.spec.ts',
'changeTracker.spec.ts',
'chatHistory.spec.ts',
'commands.spec.ts',
'customIcons.spec.ts',
'graph.spec.ts',
'keybindings.spec.ts',
'litegraphEvent.spec.ts',
'minimap.spec.ts',
'releaseNotifications.spec.ts',
'subgraph-rename-dialog.spec.ts',
'userSelectView.spec.ts',
'versionMismatchWarnings.spec.ts',
'workflowTabThumbnail.spec.ts',
'actionbar.spec.ts'
]
// Optimized shard distribution for chromium tests
export const CHROMIUM_SHARDS: ShardConfig[] = [
{
// Shard 1: Heavy screenshot test (interaction.spec.ts alone)
testFiles: HEAVY_SCREENSHOT_TESTS,
weight: 100
},
{
// Shard 2: Medium screenshot tests
testFiles: MEDIUM_SCREENSHOT_TESTS,
weight: 80
},
{
// Shard 3: Light screenshot tests
testFiles: LIGHT_SCREENSHOT_TESTS,
weight: 70
},
{
// Shard 4: Heavy logic tests
testFiles: HEAVY_LOGIC_TESTS,
weight: 75
},
{
// Shard 5: Medium and light logic tests
testFiles: [...MEDIUM_LOGIC_TESTS, ...LIGHT_LOGIC_TESTS],
weight: 65
}
]
// No sharding needed for these projects
export const NO_SHARD_PROJECTS = [
'mobile-chrome',
'chromium-0.5x',
'chromium-2x'
]
/**
* Get the test files for a specific shard
* @param shardIndex 1-based shard index
* @param totalShards Total number of shards
* @param projectName Name of the Playwright project
*/
export function getShardTests(
shardIndex: number,
totalShards: number,
projectName: string
): string[] | null {
// For projects that don't need sharding, return null to run all tests
if (NO_SHARD_PROJECTS.includes(projectName)) {
return null
}
// For chromium project, use custom sharding
if (projectName === 'chromium' && totalShards === 5) {
const shard = CHROMIUM_SHARDS[shardIndex - 1]
return shard ? shard.testFiles : []
}
// Fallback to default sharding for other configurations
return null
}
/**
* Get a grep pattern to filter tests for a specific shard
* @param shardIndex 1-based shard index
* @param totalShards Total number of shards
* @param projectName Name of the Playwright project
*/
export function getShardGrep(
shardIndex: number,
totalShards: number,
projectName: string
): RegExp | null {
const tests = getShardTests(shardIndex, totalShards, projectName)
if (!tests || tests.length === 0) {
return null
}
// Create a regex pattern that matches any of the test files
const pattern = tests.map((file) => file.replace(/\./g, '\\.')).join('|')
return new RegExp(pattern)
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 137 KiB

After

Width:  |  Height:  |  Size: 137 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 131 KiB

After

Width:  |  Height:  |  Size: 131 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 97 KiB

After

Width:  |  Height:  |  Size: 98 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 133 KiB

After

Width:  |  Height:  |  Size: 133 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 137 KiB

After

Width:  |  Height:  |  Size: 137 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 158 KiB

After

Width:  |  Height:  |  Size: 157 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 150 KiB

After

Width:  |  Height:  |  Size: 150 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 149 KiB

After

Width:  |  Height:  |  Size: 149 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 146 KiB

After

Width:  |  Height:  |  Size: 146 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 133 KiB

After

Width:  |  Height:  |  Size: 133 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 102 KiB

After

Width:  |  Height:  |  Size: 102 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 113 KiB

After

Width:  |  Height:  |  Size: 112 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 96 KiB

After

Width:  |  Height:  |  Size: 96 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 102 KiB

After

Width:  |  Height:  |  Size: 102 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 96 KiB

After

Width:  |  Height:  |  Size: 96 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 100 KiB

After

Width:  |  Height:  |  Size: 100 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 95 KiB

After

Width:  |  Height:  |  Size: 95 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 86 KiB

After

Width:  |  Height:  |  Size: 86 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 100 KiB

After

Width:  |  Height:  |  Size: 100 KiB

View File

@@ -854,15 +854,14 @@ test.describe('Canvas Navigation', () => {
})
test('Mouse wheel should zoom in/out', async ({ comfyPage }) => {
await comfyPage.page.mouse.move(400, 300)
await comfyPage.page.mouse.wheel(0, -120)
await comfyPage.nextFrame()
const position = { x: 400, y: 300 }
// Use custom zoom method with wheelDeltaY to simulate mouse wheel
await comfyPage.zoom(-120, 1, 120, position)
await expect(comfyPage.canvas).toHaveScreenshot(
'legacy-wheel-zoom-in.png'
)
await comfyPage.page.mouse.wheel(0, 240)
await comfyPage.nextFrame()
await comfyPage.zoom(240, 1, -240, position)
await expect(comfyPage.canvas).toHaveScreenshot(
'legacy-wheel-zoom-out.png'
)
@@ -923,7 +922,23 @@ test.describe('Canvas Navigation', () => {
test('Ctrl + mouse wheel should zoom in/out', async ({ comfyPage }) => {
await comfyPage.page.mouse.move(400, 300)
await comfyPage.page.keyboard.down('Control')
await comfyPage.page.mouse.wheel(0, -120)
// Dispatch custom wheel event with wheelDeltaY and Control key
await comfyPage.page.evaluate(() => {
const canvas = document.getElementById('graph-canvas')
if (!canvas) return
const event = new WheelEvent('wheel', {
deltaY: -120,
deltaX: 0,
deltaMode: 0,
clientX: 400,
clientY: 300,
ctrlKey: true,
bubbles: true,
cancelable: true
})
;(event as any).wheelDeltaY = 120
canvas.dispatchEvent(event)
})
await comfyPage.page.keyboard.up('Control')
await comfyPage.nextFrame()
await expect(comfyPage.canvas).toHaveScreenshot(
@@ -931,7 +946,22 @@ test.describe('Canvas Navigation', () => {
)
await comfyPage.page.keyboard.down('Control')
await comfyPage.page.mouse.wheel(0, 240)
await comfyPage.page.evaluate(() => {
const canvas = document.getElementById('graph-canvas')
if (!canvas) return
const event = new WheelEvent('wheel', {
deltaY: 240,
deltaX: 0,
deltaMode: 0,
clientX: 400,
clientY: 300,
ctrlKey: true,
bubbles: true,
cancelable: true
})
;(event as any).wheelDeltaY = -240
canvas.dispatchEvent(event)
})
await comfyPage.page.keyboard.up('Control')
await comfyPage.nextFrame()
await expect(comfyPage.canvas).toHaveScreenshot(
@@ -1017,10 +1047,26 @@ test.describe('Canvas Navigation', () => {
await expect(comfyPage.canvas).toHaveScreenshot('standard-initial.png')
await comfyPage.page.mouse.move(400, 300)
const position = { x: 400, y: 300 }
// Pan right with Shift + wheel
await comfyPage.page.keyboard.down('Shift')
await comfyPage.page.mouse.wheel(0, 120)
await comfyPage.page.evaluate(({ x, y }) => {
const canvas = document.getElementById('graph-canvas')
if (!canvas) return
const event = new WheelEvent('wheel', {
deltaY: 120,
deltaX: 0,
deltaMode: 0,
clientX: x,
clientY: y,
shiftKey: true,
bubbles: true,
cancelable: true
})
;(event as any).wheelDeltaY = -120
canvas.dispatchEvent(event)
}, position)
await comfyPage.page.keyboard.up('Shift')
await comfyPage.nextFrame()
await expect(comfyPage.canvas).toHaveScreenshot(
@@ -1028,7 +1074,22 @@ test.describe('Canvas Navigation', () => {
)
await comfyPage.page.keyboard.down('Shift')
await comfyPage.page.mouse.wheel(0, -240)
await comfyPage.page.evaluate(({ x, y }) => {
const canvas = document.getElementById('graph-canvas')
if (!canvas) return
const event = new WheelEvent('wheel', {
deltaY: -240,
deltaX: 0,
deltaMode: 0,
clientX: x,
clientY: y,
shiftKey: true,
bubbles: true,
cancelable: true
})
;(event as any).wheelDeltaY = 240
canvas.dispatchEvent(event)
}, position)
await comfyPage.page.keyboard.up('Shift')
await comfyPage.nextFrame()
await expect(comfyPage.canvas).toHaveScreenshot(
@@ -1036,7 +1097,22 @@ test.describe('Canvas Navigation', () => {
)
await comfyPage.page.keyboard.down('Shift')
await comfyPage.page.mouse.wheel(0, 120)
await comfyPage.page.evaluate(({ x, y }) => {
const canvas = document.getElementById('graph-canvas')
if (!canvas) return
const event = new WheelEvent('wheel', {
deltaY: 120,
deltaX: 0,
deltaMode: 0,
clientX: x,
clientY: y,
shiftKey: true,
bubbles: true,
cancelable: true
})
;(event as any).wheelDeltaY = -120
canvas.dispatchEvent(event)
}, position)
await comfyPage.page.keyboard.up('Shift')
await comfyPage.nextFrame()
await expect(comfyPage.canvas).toHaveScreenshot(

Binary file not shown.

Before

Width:  |  Height:  |  Size: 96 KiB

After

Width:  |  Height:  |  Size: 96 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 90 KiB

After

Width:  |  Height:  |  Size: 90 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 76 KiB

After

Width:  |  Height:  |  Size: 75 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 76 KiB

After

Width:  |  Height:  |  Size: 75 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 99 KiB

After

Width:  |  Height:  |  Size: 99 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 96 KiB

After

Width:  |  Height:  |  Size: 96 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 37 KiB

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 92 KiB

After

Width:  |  Height:  |  Size: 92 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 98 KiB

After

Width:  |  Height:  |  Size: 98 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 95 KiB

After

Width:  |  Height:  |  Size: 95 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 91 KiB

After

Width:  |  Height:  |  Size: 91 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 62 KiB

After

Width:  |  Height:  |  Size: 63 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 106 KiB

After

Width:  |  Height:  |  Size: 106 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 61 KiB

After

Width:  |  Height:  |  Size: 61 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 88 KiB

After

Width:  |  Height:  |  Size: 88 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 97 KiB

After

Width:  |  Height:  |  Size: 97 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 88 KiB

After

Width:  |  Height:  |  Size: 88 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 88 KiB

After

Width:  |  Height:  |  Size: 88 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 99 KiB

After

Width:  |  Height:  |  Size: 99 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 96 KiB

After

Width:  |  Height:  |  Size: 96 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 94 KiB

After

Width:  |  Height:  |  Size: 94 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 57 KiB

After

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 110 KiB

After

Width:  |  Height:  |  Size: 110 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 102 KiB

After

Width:  |  Height:  |  Size: 102 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 101 KiB

After

Width:  |  Height:  |  Size: 101 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 101 KiB

After

Width:  |  Height:  |  Size: 101 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 42 KiB

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 96 KiB

After

Width:  |  Height:  |  Size: 96 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 53 KiB

After

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 71 KiB

After

Width:  |  Height:  |  Size: 71 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 37 KiB

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 53 KiB

After

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 42 KiB

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.2 KiB

After

Width:  |  Height:  |  Size: 9.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 88 KiB

After

Width:  |  Height:  |  Size: 88 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 77 KiB

After

Width:  |  Height:  |  Size: 79 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 96 KiB

After

Width:  |  Height:  |  Size: 96 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 42 KiB

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 99 KiB

After

Width:  |  Height:  |  Size: 99 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 45 KiB

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 74 KiB

After

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 100 KiB

After

Width:  |  Height:  |  Size: 100 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 97 KiB

After

Width:  |  Height:  |  Size: 97 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 101 KiB

After

Width:  |  Height:  |  Size: 101 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 97 KiB

After

Width:  |  Height:  |  Size: 97 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 56 KiB

After

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 56 KiB

After

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 38 KiB

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 67 KiB

After

Width:  |  Height:  |  Size: 67 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 74 KiB

After

Width:  |  Height:  |  Size: 74 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 95 KiB

After

Width:  |  Height:  |  Size: 95 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 97 KiB

After

Width:  |  Height:  |  Size: 97 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 99 KiB

After

Width:  |  Height:  |  Size: 99 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 96 KiB

After

Width:  |  Height:  |  Size: 96 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 97 KiB

After

Width:  |  Height:  |  Size: 97 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 101 KiB

After

Width:  |  Height:  |  Size: 101 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 88 KiB

After

Width:  |  Height:  |  Size: 88 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 98 KiB

After

Width:  |  Height:  |  Size: 98 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 97 KiB

After

Width:  |  Height:  |  Size: 97 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 98 KiB

After

Width:  |  Height:  |  Size: 98 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 90 KiB

After

Width:  |  Height:  |  Size: 90 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 41 KiB

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 95 KiB

After

Width:  |  Height:  |  Size: 95 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 96 KiB

After

Width:  |  Height:  |  Size: 96 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 100 KiB

After

Width:  |  Height:  |  Size: 100 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 74 KiB

After

Width:  |  Height:  |  Size: 76 KiB

Some files were not shown because too many files have changed in this diff Show More