Compare commits
6 Commits
fix/small-
...
remove-flo
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c8e1f494fa | ||
|
|
c82c3c24f7 | ||
|
|
fffa81c9b5 | ||
|
|
db35e0b7d2 | ||
|
|
0c6eeb0632 | ||
|
|
fca95ad07e |
@@ -294,6 +294,7 @@ echo "Last stable release: $LAST_STABLE"
|
|||||||
1. Run complete test suite:
|
1. Run complete test suite:
|
||||||
```bash
|
```bash
|
||||||
pnpm test:unit
|
pnpm test:unit
|
||||||
|
pnpm test:component
|
||||||
```
|
```
|
||||||
2. Run type checking:
|
2. Run type checking:
|
||||||
```bash
|
```bash
|
||||||
|
|||||||
@@ -120,6 +120,7 @@ echo "Available commands:"
|
|||||||
echo " pnpm dev - Start development server"
|
echo " pnpm dev - Start development server"
|
||||||
echo " pnpm build - Build for production"
|
echo " pnpm build - Build for production"
|
||||||
echo " pnpm test:unit - Run unit tests"
|
echo " pnpm test:unit - Run unit tests"
|
||||||
|
echo " pnpm test:component - Run component tests"
|
||||||
echo " pnpm typecheck - Run TypeScript checks"
|
echo " pnpm typecheck - Run TypeScript checks"
|
||||||
echo " pnpm lint - Run ESLint"
|
echo " pnpm lint - Run ESLint"
|
||||||
echo " pnpm format - Format code with Prettier"
|
echo " pnpm format - Format code with Prettier"
|
||||||
|
|||||||
2
.gitattributes
vendored
@@ -12,5 +12,5 @@
|
|||||||
*.yaml text eol=lf
|
*.yaml text eol=lf
|
||||||
|
|
||||||
# Generated files
|
# Generated files
|
||||||
packages/registry-types/src/comfyRegistryTypes.ts linguist-generated=true
|
src/types/comfyRegistryTypes.ts linguist-generated=true
|
||||||
src/workbench/extensions/manager/types/generatedManagerTypes.ts linguist-generated=true
|
src/workbench/extensions/manager/types/generatedManagerTypes.ts linguist-generated=true
|
||||||
|
|||||||
67
.github/actions/setup-frontend/action.yml
vendored
@@ -1,67 +0,0 @@
|
|||||||
name: Setup Frontend
|
|
||||||
description: 'Setup ComfyUI frontend development environment'
|
|
||||||
inputs:
|
|
||||||
extra_server_params:
|
|
||||||
description: 'Additional parameters to pass to ComfyUI server'
|
|
||||||
required: false
|
|
||||||
default: ''
|
|
||||||
runs:
|
|
||||||
using: 'composite'
|
|
||||||
steps:
|
|
||||||
- name: Checkout ComfyUI
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
repository: 'comfyanonymous/ComfyUI'
|
|
||||||
path: 'ComfyUI'
|
|
||||||
|
|
||||||
- name: Checkout ComfyUI_frontend
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
repository: 'Comfy-Org/ComfyUI_frontend'
|
|
||||||
path: 'ComfyUI_frontend'
|
|
||||||
|
|
||||||
- name: Copy ComfyUI_devtools from frontend repo
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
mkdir -p ComfyUI/custom_nodes/ComfyUI_devtools
|
|
||||||
cp -r ComfyUI_frontend/tools/devtools/* ComfyUI/custom_nodes/ComfyUI_devtools/
|
|
||||||
|
|
||||||
- name: Install pnpm
|
|
||||||
uses: pnpm/action-setup@v4
|
|
||||||
with:
|
|
||||||
version: 10
|
|
||||||
|
|
||||||
- name: Setup Node.js
|
|
||||||
uses: actions/setup-node@v4
|
|
||||||
with:
|
|
||||||
node-version: 'lts/*'
|
|
||||||
cache: 'pnpm'
|
|
||||||
cache-dependency-path: 'ComfyUI_frontend/pnpm-lock.yaml'
|
|
||||||
|
|
||||||
- name: Setup Python
|
|
||||||
uses: actions/setup-python@v4
|
|
||||||
with:
|
|
||||||
python-version: '3.10'
|
|
||||||
|
|
||||||
- name: Install Python requirements
|
|
||||||
shell: bash
|
|
||||||
working-directory: ComfyUI
|
|
||||||
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
|
|
||||||
|
|
||||||
- name: Build & Install ComfyUI_frontend
|
|
||||||
shell: bash
|
|
||||||
working-directory: ComfyUI_frontend
|
|
||||||
run: |
|
|
||||||
pnpm install --frozen-lockfile
|
|
||||||
pnpm build
|
|
||||||
|
|
||||||
- name: Start ComfyUI server
|
|
||||||
shell: bash
|
|
||||||
working-directory: ComfyUI
|
|
||||||
run: |
|
|
||||||
python main.py --cpu --multi-user --front-end-root ../ComfyUI_frontend/dist ${{ inputs.extra_server_params }} &
|
|
||||||
wait-for-it --service 127.0.0.1:8188 -t 600
|
|
||||||
31
.github/actions/setup-playwright/action.yml
vendored
@@ -1,31 +0,0 @@
|
|||||||
name: Setup Playwright
|
|
||||||
description: Cache and install Playwright browsers with dependencies
|
|
||||||
runs:
|
|
||||||
using: composite
|
|
||||||
steps:
|
|
||||||
- name: Detect Playwright version
|
|
||||||
id: detect-version
|
|
||||||
shell: bash
|
|
||||||
working-directory: ComfyUI_frontend
|
|
||||||
run: |
|
|
||||||
PLAYWRIGHT_VERSION=$(pnpm ls @playwright/test --json | jq --raw-output '.[0].devDependencies["@playwright/test"].version')
|
|
||||||
echo "playwright-version=$PLAYWRIGHT_VERSION" >> $GITHUB_OUTPUT
|
|
||||||
|
|
||||||
- name: Cache Playwright Browsers
|
|
||||||
uses: actions/cache@v4
|
|
||||||
id: cache-playwright-browsers
|
|
||||||
with:
|
|
||||||
path: '~/.cache/ms-playwright'
|
|
||||||
key: ${{ runner.os }}-playwright-browsers-${{ steps.detect-version.outputs.playwright-version }}
|
|
||||||
|
|
||||||
- name: Install Playwright Browsers
|
|
||||||
if: steps.cache-playwright-browsers.outputs.cache-hit != 'true'
|
|
||||||
shell: bash
|
|
||||||
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'
|
|
||||||
shell: bash
|
|
||||||
run: pnpm exec playwright install-deps
|
|
||||||
working-directory: ComfyUI_frontend
|
|
||||||
@@ -60,7 +60,7 @@ jobs:
|
|||||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v5
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
57
.github/workflows/chromatic.yaml
vendored
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
name: 'Chromatic'
|
||||||
|
|
||||||
|
# - [Automate Chromatic with GitHub Actions • Chromatic docs]( https://www.chromatic.com/docs/github-actions/ )
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch: # Allow manual triggering
|
||||||
|
pull_request:
|
||||||
|
branches: [main]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
chromatic-deployment:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
# Only run for PRs from version-bump-* branches or manual triggers
|
||||||
|
if: github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'version-bump-')
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0 # Required for Chromatic baseline
|
||||||
|
|
||||||
|
- name: Install pnpm
|
||||||
|
uses: pnpm/action-setup@v4
|
||||||
|
with:
|
||||||
|
version: 10
|
||||||
|
|
||||||
|
- name: Setup Node.js
|
||||||
|
uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version: '20'
|
||||||
|
cache: 'pnpm'
|
||||||
|
|
||||||
|
|
||||||
|
- name: Cache tool outputs
|
||||||
|
uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
.cache
|
||||||
|
storybook-static
|
||||||
|
tsconfig.tsbuildinfo
|
||||||
|
key: storybook-cache-${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}-${{ hashFiles('src/**/*.{ts,vue,js}', '*.config.*', '.storybook/**/*') }}
|
||||||
|
restore-keys: |
|
||||||
|
storybook-cache-${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}-
|
||||||
|
storybook-cache-${{ runner.os }}-
|
||||||
|
storybook-tools-cache-${{ runner.os }}-
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: pnpm install --frozen-lockfile
|
||||||
|
|
||||||
|
- name: Build Storybook and run Chromatic
|
||||||
|
id: chromatic
|
||||||
|
uses: chromaui/action@latest
|
||||||
|
with:
|
||||||
|
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
|
||||||
|
buildScriptName: build-storybook
|
||||||
|
autoAcceptChanges: 'main' # Auto-accept changes on main branch
|
||||||
|
exitOnceUploaded: true # Don't wait for UI tests to complete
|
||||||
|
|
||||||
13
.github/workflows/claude-pr-review.yml
vendored
@@ -29,9 +29,11 @@ jobs:
|
|||||||
- name: Check if we should proceed
|
- name: Check if we should proceed
|
||||||
id: check-status
|
id: check-status
|
||||||
run: |
|
run: |
|
||||||
CHECK_RUNS=$(gh api repos/${{ github.repository }}/commits/${{ github.event.pull_request.head.sha }}/check-runs --jq '.check_runs[] | select(.name | test("lint-and-format")) | {name, conclusion}')
|
# Get all check runs for this commit
|
||||||
|
CHECK_RUNS=$(gh api repos/${{ github.repository }}/commits/${{ github.event.pull_request.head.sha }}/check-runs --jq '.check_runs[] | select(.name | test("lint-and-format|test|playwright-tests")) | {name, conclusion}')
|
||||||
if echo "$CHECK_RUNS" | grep -Eq '"conclusion": "(failure|cancelled|timed_out|action_required)"'; then
|
|
||||||
|
# Check if any required checks failed
|
||||||
|
if echo "$CHECK_RUNS" | grep -q '"conclusion": "failure"'; then
|
||||||
echo "Some CI checks failed - skipping Claude review"
|
echo "Some CI checks failed - skipping Claude review"
|
||||||
echo "proceed=false" >> $GITHUB_OUTPUT
|
echo "proceed=false" >> $GITHUB_OUTPUT
|
||||||
else
|
else
|
||||||
@@ -48,10 +50,9 @@ jobs:
|
|||||||
timeout-minutes: 30
|
timeout-minutes: 30
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v5
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
ref: refs/pull/${{ github.event.pull_request.number }}/head
|
|
||||||
|
|
||||||
- name: Install pnpm
|
- name: Install pnpm
|
||||||
uses: pnpm/action-setup@v4
|
uses: pnpm/action-setup@v4
|
||||||
@@ -85,4 +86,4 @@ jobs:
|
|||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
COMMIT_SHA: ${{ github.event.pull_request.head.sha }}
|
COMMIT_SHA: ${{ github.event.pull_request.head.sha }}
|
||||||
BASE_SHA: ${{ github.event.pull_request.base.sha }}
|
BASE_SHA: ${{ github.event.pull_request.base.sha }}
|
||||||
REPOSITORY: ${{ github.repository }}
|
REPOSITORY: ${{ github.repository }}
|
||||||
@@ -18,7 +18,7 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v5
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
token: ${{ secrets.PR_GH_TOKEN || secrets.GITHUB_TOKEN }}
|
token: ${{ secrets.PR_GH_TOKEN || secrets.GITHUB_TOKEN }}
|
||||||
@@ -15,7 +15,7 @@ jobs:
|
|||||||
version: ${{ steps.current_version.outputs.version }}
|
version: ${{ steps.current_version.outputs.version }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v5
|
uses: actions/checkout@v4
|
||||||
- name: Install pnpm
|
- name: Install pnpm
|
||||||
uses: pnpm/action-setup@v4
|
uses: pnpm/action-setup@v4
|
||||||
with:
|
with:
|
||||||
@@ -62,7 +62,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v5
|
uses: actions/checkout@v4
|
||||||
- name: Download dist artifact
|
- name: Download dist artifact
|
||||||
uses: actions/download-artifact@v4
|
uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
26
.github/workflows/devtools-python-check.yaml
vendored
@@ -1,26 +0,0 @@
|
|||||||
name: Devtools Python Check
|
|
||||||
|
|
||||||
on:
|
|
||||||
pull_request:
|
|
||||||
paths:
|
|
||||||
- 'tools/devtools/**'
|
|
||||||
push:
|
|
||||||
branches: [ main ]
|
|
||||||
paths:
|
|
||||||
- 'tools/devtools/**'
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
syntax:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout repository
|
|
||||||
uses: actions/checkout@v5
|
|
||||||
|
|
||||||
- name: Set up Python
|
|
||||||
uses: actions/setup-python@v5
|
|
||||||
with:
|
|
||||||
python-version: '3.11'
|
|
||||||
|
|
||||||
- name: Validate Python syntax
|
|
||||||
run: python3 -m compileall -q tools/devtools
|
|
||||||
@@ -22,22 +22,23 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout ComfyUI
|
- name: Checkout ComfyUI
|
||||||
uses: actions/checkout@v5
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
repository: comfyanonymous/ComfyUI
|
repository: comfyanonymous/ComfyUI
|
||||||
path: ComfyUI
|
path: ComfyUI
|
||||||
ref: master
|
ref: master
|
||||||
- name: Checkout ComfyUI_frontend
|
- name: Checkout ComfyUI_frontend
|
||||||
uses: actions/checkout@v5
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
repository: Comfy-Org/ComfyUI_frontend
|
repository: Comfy-Org/ComfyUI_frontend
|
||||||
path: ComfyUI_frontend
|
path: ComfyUI_frontend
|
||||||
- name: Copy ComfyUI_devtools from frontend repo
|
- name: Checkout ComfyUI_devtools
|
||||||
run: |
|
uses: actions/checkout@v4
|
||||||
mkdir -p ComfyUI/custom_nodes/ComfyUI_devtools
|
with:
|
||||||
cp -r ComfyUI_frontend/tools/devtools/* ComfyUI/custom_nodes/ComfyUI_devtools/
|
repository: Comfy-Org/ComfyUI_devtools
|
||||||
|
path: ComfyUI/custom_nodes/ComfyUI_devtools
|
||||||
- name: Checkout custom node repository
|
- name: Checkout custom node repository
|
||||||
uses: actions/checkout@v5
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
repository: ${{ inputs.owner }}/${{ inputs.repository }}
|
repository: ${{ inputs.owner }}/${{ inputs.repository }}
|
||||||
path: 'ComfyUI/custom_nodes/${{ inputs.repository }}'
|
path: 'ComfyUI/custom_nodes/${{ inputs.repository }}'
|
||||||
@@ -77,15 +78,16 @@ jobs:
|
|||||||
python main.py --cpu --multi-user &
|
python main.py --cpu --multi-user &
|
||||||
wait-for-it --service 127.0.0.1:8188 -t 600
|
wait-for-it --service 127.0.0.1:8188 -t 600
|
||||||
working-directory: ComfyUI
|
working-directory: ComfyUI
|
||||||
- name: Setup Playwright
|
- name: Install Playwright Browsers
|
||||||
uses: ./ComfyUI_frontend/.github/actions/setup-playwright
|
run: npx playwright install chromium --with-deps
|
||||||
|
working-directory: ComfyUI_frontend
|
||||||
- name: Start dev server
|
- name: Start dev server
|
||||||
# Run electron dev server as it is a superset of the web dev server
|
# Run electron dev server as it is a superset of the web dev server
|
||||||
# We do want electron specific UIs to be translated.
|
# We do want electron specific UIs to be translated.
|
||||||
run: pnpm dev:electron &
|
run: pnpm dev:electron &
|
||||||
working-directory: ComfyUI_frontend
|
working-directory: ComfyUI_frontend
|
||||||
- name: Capture base i18n
|
- name: Capture base i18n
|
||||||
run: pnpm exec tsx scripts/diff-i18n capture
|
run: npx tsx scripts/diff-i18n capture
|
||||||
working-directory: ComfyUI_frontend
|
working-directory: ComfyUI_frontend
|
||||||
- name: Update en.json
|
- name: Update en.json
|
||||||
run: pnpm collect-i18n
|
run: pnpm collect-i18n
|
||||||
@@ -98,7 +100,7 @@ jobs:
|
|||||||
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
|
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
|
||||||
working-directory: ComfyUI_frontend
|
working-directory: ComfyUI_frontend
|
||||||
- name: Diff base vs updated i18n
|
- name: Diff base vs updated i18n
|
||||||
run: pnpm exec tsx scripts/diff-i18n diff
|
run: npx tsx scripts/diff-i18n diff
|
||||||
working-directory: ComfyUI_frontend
|
working-directory: ComfyUI_frontend
|
||||||
- name: Update i18n in custom node repository
|
- name: Update i18n in custom node repository
|
||||||
run: |
|
run: |
|
||||||
@@ -14,8 +14,9 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: Comfy-Org/ComfyUI_frontend_setup_action@v3
|
- uses: Comfy-Org/ComfyUI_frontend_setup_action@v3
|
||||||
- name: Setup Playwright
|
- name: Install Playwright Browsers
|
||||||
uses: ./.github/actions/setup-playwright
|
run: npx playwright install chromium --with-deps
|
||||||
|
working-directory: ComfyUI_frontend
|
||||||
- name: Start dev server
|
- name: Start dev server
|
||||||
# Run electron dev server as it is a superset of the web dev server
|
# Run electron dev server as it is a superset of the web dev server
|
||||||
# We do want electron specific UIs to be translated.
|
# We do want electron specific UIs to be translated.
|
||||||
@@ -14,8 +14,7 @@ jobs:
|
|||||||
if: github.event_name == 'workflow_dispatch' || (github.event.pull_request.head.repo.full_name == github.repository && startsWith(github.head_ref, 'version-bump-'))
|
if: github.event_name == 'workflow_dispatch' || (github.event.pull_request.head.repo.full_name == github.repository && startsWith(github.head_ref, 'version-bump-'))
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Setup Frontend
|
- uses: Comfy-Org/ComfyUI_frontend_setup_action@v3
|
||||||
uses: ./.github/actions/setup-frontend
|
|
||||||
|
|
||||||
- name: Cache tool outputs
|
- name: Cache tool outputs
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@v4
|
||||||
@@ -26,8 +25,16 @@ jobs:
|
|||||||
key: i18n-tools-cache-${{ runner.os }}-${{ hashFiles('ComfyUI_frontend/pnpm-lock.yaml') }}
|
key: i18n-tools-cache-${{ runner.os }}-${{ hashFiles('ComfyUI_frontend/pnpm-lock.yaml') }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
i18n-tools-cache-${{ runner.os }}-
|
i18n-tools-cache-${{ runner.os }}-
|
||||||
- name: Setup Playwright
|
- name: Cache Playwright browsers
|
||||||
uses: ./.github/actions/setup-playwright
|
uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: ~/.cache/ms-playwright
|
||||||
|
key: playwright-browsers-${{ runner.os }}-${{ hashFiles('ComfyUI_frontend/pnpm-lock.yaml') }}
|
||||||
|
restore-keys: |
|
||||||
|
playwright-browsers-${{ runner.os }}-
|
||||||
|
- name: Install Playwright Browsers
|
||||||
|
run: npx playwright install chromium --with-deps
|
||||||
|
working-directory: ComfyUI_frontend
|
||||||
- name: Start dev server
|
- name: Start dev server
|
||||||
# Run electron dev server as it is a superset of the web dev server
|
# Run electron dev server as it is a superset of the web dev server
|
||||||
# We do want electron specific UIs to be translated.
|
# We do want electron specific UIs to be translated.
|
||||||
10
.github/workflows/lint-and-format.yaml
vendored
@@ -13,9 +13,11 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout PR
|
- name: Checkout PR
|
||||||
uses: actions/checkout@v5
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
ref: ${{ !github.event.pull_request.head.repo.fork && github.head_ref || github.ref }}
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
ref: ${{ github.event.pull_request.head.ref }}
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Install pnpm
|
- name: Install pnpm
|
||||||
uses: pnpm/action-setup@v4
|
uses: pnpm/action-setup@v4
|
||||||
@@ -67,7 +69,7 @@ jobs:
|
|||||||
git config --local user.email "action@github.com"
|
git config --local user.email "action@github.com"
|
||||||
git config --local user.name "GitHub Action"
|
git config --local user.name "GitHub Action"
|
||||||
git add .
|
git add .
|
||||||
git commit -m "[automated] Apply ESLint and Prettier fixes"
|
git commit -m "[auto-fix] Apply ESLint and Prettier fixes"
|
||||||
git push
|
git push
|
||||||
|
|
||||||
- name: Final validation
|
- name: Final validation
|
||||||
@@ -100,4 +102,4 @@ jobs:
|
|||||||
owner: context.repo.owner,
|
owner: context.repo.owner,
|
||||||
repo: context.repo.repo,
|
repo: context.repo.repo,
|
||||||
body: '## ⚠️ Linting/Formatting Issues Found\n\nThis PR has linting or formatting issues that need to be fixed.\n\n**Since this PR is from a fork, auto-fix cannot be applied automatically.**\n\n### Option 1: Set up pre-commit hooks (recommended)\nRun this once to automatically format code on every commit:\n```bash\npnpm prepare\n```\n\n### Option 2: Fix manually\nRun these commands and push the changes:\n```bash\npnpm lint:fix\npnpm format\n```\n\nSee [CONTRIBUTING.md](https://github.com/Comfy-Org/ComfyUI_frontend/blob/main/CONTRIBUTING.md#git-pre-commit-hooks) for more details.'
|
body: '## ⚠️ Linting/Formatting Issues Found\n\nThis PR has linting or formatting issues that need to be fixed.\n\n**Since this PR is from a fork, auto-fix cannot be applied automatically.**\n\n### Option 1: Set up pre-commit hooks (recommended)\nRun this once to automatically format code on every commit:\n```bash\npnpm prepare\n```\n\n### Option 2: Fix manually\nRun these commands and push the changes:\n```bash\npnpm lint:fix\npnpm format\n```\n\nSee [CONTRIBUTING.md](https://github.com/Comfy-Org/ComfyUI_frontend/blob/main/CONTRIBUTING.md#git-pre-commit-hooks) for more details.'
|
||||||
})
|
})
|
||||||
@@ -30,7 +30,7 @@ jobs:
|
|||||||
echo "Is forked: ${{ github.event.workflow_run.head_repository.full_name != github.event.workflow_run.repository.full_name }}"
|
echo "Is forked: ${{ github.event.workflow_run.head_repository.full_name != github.event.workflow_run.repository.full_name }}"
|
||||||
|
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v5
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Get PR Number
|
- name: Get PR Number
|
||||||
id: pr
|
id: pr
|
||||||
126
.github/workflows/pr-storybook-comment.yaml
vendored
Normal file
@@ -0,0 +1,126 @@
|
|||||||
|
name: PR Storybook Comment
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_run:
|
||||||
|
workflows: ['Chromatic']
|
||||||
|
types: [requested, completed]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
comment-storybook:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
if: >-
|
||||||
|
github.repository == 'Comfy-Org/ComfyUI_frontend'
|
||||||
|
&& github.event.workflow_run.event == 'pull_request'
|
||||||
|
&& startsWith(github.event.workflow_run.head_branch, 'version-bump-')
|
||||||
|
permissions:
|
||||||
|
pull-requests: write
|
||||||
|
actions: read
|
||||||
|
steps:
|
||||||
|
- name: Get PR number
|
||||||
|
id: pr
|
||||||
|
uses: actions/github-script@v7
|
||||||
|
with:
|
||||||
|
script: |
|
||||||
|
const { data: pullRequests } = await github.rest.pulls.list({
|
||||||
|
owner: context.repo.owner,
|
||||||
|
repo: context.repo.repo,
|
||||||
|
state: 'open',
|
||||||
|
head: `${context.repo.owner}:${context.payload.workflow_run.head_branch}`,
|
||||||
|
});
|
||||||
|
|
||||||
|
if (pullRequests.length === 0) {
|
||||||
|
console.log('No open PR found for this branch');
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
return pullRequests[0].number;
|
||||||
|
|
||||||
|
- name: Log when no PR found
|
||||||
|
if: steps.pr.outputs.result == 'null'
|
||||||
|
run: |
|
||||||
|
echo "⚠️ No open PR found for branch: ${{ github.event.workflow_run.head_branch }}"
|
||||||
|
echo "Workflow run ID: ${{ github.event.workflow_run.id }}"
|
||||||
|
echo "Repository: ${{ github.event.workflow_run.repository.full_name }}"
|
||||||
|
echo "Event: ${{ github.event.workflow_run.event }}"
|
||||||
|
|
||||||
|
- name: Get workflow run details
|
||||||
|
if: steps.pr.outputs.result != 'null' && github.event.action == 'completed'
|
||||||
|
id: workflow-run
|
||||||
|
uses: actions/github-script@v7
|
||||||
|
with:
|
||||||
|
script: |
|
||||||
|
const run = await github.rest.actions.getWorkflowRun({
|
||||||
|
owner: context.repo.owner,
|
||||||
|
repo: context.repo.repo,
|
||||||
|
run_id: context.payload.workflow_run.id,
|
||||||
|
});
|
||||||
|
|
||||||
|
return {
|
||||||
|
conclusion: run.data.conclusion,
|
||||||
|
html_url: run.data.html_url
|
||||||
|
};
|
||||||
|
|
||||||
|
- name: Get completion time
|
||||||
|
id: completion-time
|
||||||
|
run: echo "time=$(date -u '+%m/%d/%Y, %I:%M:%S %p')" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
- name: Comment PR - Storybook Started
|
||||||
|
if: steps.pr.outputs.result != 'null' && github.event.action == 'requested'
|
||||||
|
uses: edumserrano/find-create-or-update-comment@82880b65c8a3a6e4c70aa05a204995b6c9696f53 # v3.0.0
|
||||||
|
with:
|
||||||
|
issue-number: ${{ steps.pr.outputs.result }}
|
||||||
|
body-includes: '<!-- STORYBOOK_BUILD_STATUS -->'
|
||||||
|
comment-author: 'github-actions[bot]'
|
||||||
|
edit-mode: replace
|
||||||
|
body: |
|
||||||
|
<!-- STORYBOOK_BUILD_STATUS -->
|
||||||
|
## 🎨 Storybook Build Status
|
||||||
|
|
||||||
|
<img alt='comfy-loading-gif' src='https://github.com/user-attachments/assets/755c86ee-e445-4ea8-bc2c-cca85df48686' width='14px' height='14px' style='vertical-align: middle; margin-right: 4px;' /> **Build is starting...**
|
||||||
|
|
||||||
|
⏰ Started at: ${{ steps.completion-time.outputs.time }} UTC
|
||||||
|
|
||||||
|
### 🚀 Building Storybook
|
||||||
|
- 📦 Installing dependencies...
|
||||||
|
- 🔧 Building Storybook components...
|
||||||
|
- 🎨 Running Chromatic visual tests...
|
||||||
|
|
||||||
|
---
|
||||||
|
⏱️ Please wait while the Storybook build is in progress...
|
||||||
|
|
||||||
|
- name: Comment PR - Storybook Complete
|
||||||
|
if: steps.pr.outputs.result != 'null' && github.event.action == 'completed'
|
||||||
|
uses: edumserrano/find-create-or-update-comment@82880b65c8a3a6e4c70aa05a204995b6c9696f53 # v3.0.0
|
||||||
|
with:
|
||||||
|
issue-number: ${{ steps.pr.outputs.result }}
|
||||||
|
body-includes: '<!-- STORYBOOK_BUILD_STATUS -->'
|
||||||
|
comment-author: 'github-actions[bot]'
|
||||||
|
edit-mode: replace
|
||||||
|
body: |
|
||||||
|
<!-- STORYBOOK_BUILD_STATUS -->
|
||||||
|
## 🎨 Storybook Build Status
|
||||||
|
|
||||||
|
${{
|
||||||
|
fromJSON(steps.workflow-run.outputs.result).conclusion == 'success' && '✅'
|
||||||
|
|| fromJSON(steps.workflow-run.outputs.result).conclusion == 'skipped' && '⏭️'
|
||||||
|
|| fromJSON(steps.workflow-run.outputs.result).conclusion == 'cancelled' && '🚫'
|
||||||
|
|| '❌'
|
||||||
|
}} **${{
|
||||||
|
fromJSON(steps.workflow-run.outputs.result).conclusion == 'success' && 'Build completed successfully!'
|
||||||
|
|| fromJSON(steps.workflow-run.outputs.result).conclusion == 'skipped' && 'Build skipped.'
|
||||||
|
|| fromJSON(steps.workflow-run.outputs.result).conclusion == 'cancelled' && 'Build cancelled.'
|
||||||
|
|| 'Build failed!'
|
||||||
|
}}**
|
||||||
|
|
||||||
|
⏰ Completed at: ${{ steps.completion-time.outputs.time }} UTC
|
||||||
|
|
||||||
|
### 🔗 Links
|
||||||
|
- [📊 View Workflow Run](${{ fromJSON(steps.workflow-run.outputs.result).html_url }})
|
||||||
|
|
||||||
|
---
|
||||||
|
${{
|
||||||
|
fromJSON(steps.workflow-run.outputs.result).conclusion == 'success' && '🎉 Your Storybook is ready for review!'
|
||||||
|
|| fromJSON(steps.workflow-run.outputs.result).conclusion == 'skipped' && 'ℹ️ Chromatic was skipped for this PR.'
|
||||||
|
|| fromJSON(steps.workflow-run.outputs.result).conclusion == 'cancelled' && 'ℹ️ The Chromatic run was cancelled.'
|
||||||
|
|| '⚠️ Please check the workflow logs for error details.'
|
||||||
|
}}
|
||||||
90
.github/workflows/pr-storybook-deploy-forks.yaml
vendored
@@ -1,90 +0,0 @@
|
|||||||
name: PR Storybook Deploy (Forks)
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_run:
|
|
||||||
workflows: ['Storybook and Chromatic CI']
|
|
||||||
types: [requested, completed]
|
|
||||||
|
|
||||||
env:
|
|
||||||
DATE_FORMAT: '+%m/%d/%Y, %I:%M:%S %p'
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
deploy-and-comment-forked-pr:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
if: |
|
|
||||||
github.repository == 'Comfy-Org/ComfyUI_frontend' &&
|
|
||||||
github.event.workflow_run.event == 'pull_request' &&
|
|
||||||
github.event.workflow_run.head_repository != null &&
|
|
||||||
github.event.workflow_run.repository != null &&
|
|
||||||
github.event.workflow_run.head_repository.full_name != github.event.workflow_run.repository.full_name
|
|
||||||
permissions:
|
|
||||||
pull-requests: write
|
|
||||||
actions: read
|
|
||||||
steps:
|
|
||||||
- name: Log workflow trigger info
|
|
||||||
run: |
|
|
||||||
echo "Repository: ${{ github.repository }}"
|
|
||||||
echo "Event: ${{ github.event.workflow_run.event }}"
|
|
||||||
echo "Head repo: ${{ github.event.workflow_run.head_repository.full_name || 'null' }}"
|
|
||||||
echo "Base repo: ${{ github.event.workflow_run.repository.full_name || 'null' }}"
|
|
||||||
echo "Is forked: ${{ github.event.workflow_run.head_repository.full_name != github.event.workflow_run.repository.full_name }}"
|
|
||||||
|
|
||||||
- name: Checkout repository
|
|
||||||
uses: actions/checkout@v5
|
|
||||||
|
|
||||||
- name: Get PR Number
|
|
||||||
id: pr
|
|
||||||
uses: actions/github-script@v7
|
|
||||||
with:
|
|
||||||
script: |
|
|
||||||
const { data: prs } = await github.rest.pulls.list({
|
|
||||||
owner: context.repo.owner,
|
|
||||||
repo: context.repo.repo,
|
|
||||||
state: 'open',
|
|
||||||
});
|
|
||||||
|
|
||||||
const pr = prs.find(p => p.head.sha === context.payload.workflow_run.head_sha);
|
|
||||||
|
|
||||||
if (!pr) {
|
|
||||||
console.log('No PR found for SHA:', context.payload.workflow_run.head_sha);
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
console.log(`Found PR #${pr.number} from fork: ${context.payload.workflow_run.head_repository.full_name}`);
|
|
||||||
return pr.number;
|
|
||||||
|
|
||||||
- name: Handle Storybook Start
|
|
||||||
if: steps.pr.outputs.result != 'null' && github.event.action == 'requested'
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ github.token }}
|
|
||||||
run: |
|
|
||||||
chmod +x scripts/cicd/pr-storybook-deploy-and-comment.sh
|
|
||||||
./scripts/cicd/pr-storybook-deploy-and-comment.sh \
|
|
||||||
"${{ steps.pr.outputs.result }}" \
|
|
||||||
"${{ github.event.workflow_run.head_branch }}" \
|
|
||||||
"starting" \
|
|
||||||
"$(date -u '${{ env.DATE_FORMAT }}')"
|
|
||||||
|
|
||||||
- name: Download and Deploy Storybook
|
|
||||||
if: steps.pr.outputs.result != 'null' && github.event.action == 'completed' && github.event.workflow_run.conclusion == 'success'
|
|
||||||
uses: actions/download-artifact@v4
|
|
||||||
with:
|
|
||||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
run-id: ${{ github.event.workflow_run.id }}
|
|
||||||
name: storybook-static
|
|
||||||
path: storybook-static
|
|
||||||
|
|
||||||
- name: Handle Storybook Completion
|
|
||||||
if: steps.pr.outputs.result != 'null' && github.event.action == 'completed'
|
|
||||||
env:
|
|
||||||
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
|
||||||
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
|
|
||||||
GITHUB_TOKEN: ${{ github.token }}
|
|
||||||
WORKFLOW_CONCLUSION: ${{ github.event.workflow_run.conclusion }}
|
|
||||||
WORKFLOW_URL: ${{ github.event.workflow_run.html_url }}
|
|
||||||
run: |
|
|
||||||
chmod +x scripts/cicd/pr-storybook-deploy-and-comment.sh
|
|
||||||
./scripts/cicd/pr-storybook-deploy-and-comment.sh \
|
|
||||||
"${{ steps.pr.outputs.result }}" \
|
|
||||||
"${{ github.event.workflow_run.head_branch }}" \
|
|
||||||
"completed"
|
|
||||||
231
.github/workflows/storybook-and-chromatic-ci.yaml
vendored
@@ -1,231 +0,0 @@
|
|||||||
name: Storybook and Chromatic CI
|
|
||||||
|
|
||||||
# - [Automate Chromatic with GitHub Actions • Chromatic docs]( https://www.chromatic.com/docs/github-actions/ )
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_dispatch: # Allow manual triggering
|
|
||||||
pull_request:
|
|
||||||
branches: [main]
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
# Post starting comment for non-forked PRs
|
|
||||||
comment-on-pr-start:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork == false
|
|
||||||
permissions:
|
|
||||||
pull-requests: write
|
|
||||||
steps:
|
|
||||||
- name: Checkout repository
|
|
||||||
uses: actions/checkout@v5
|
|
||||||
|
|
||||||
- name: Post starting comment
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ github.token }}
|
|
||||||
run: |
|
|
||||||
chmod +x scripts/cicd/pr-storybook-deploy-and-comment.sh
|
|
||||||
./scripts/cicd/pr-storybook-deploy-and-comment.sh \
|
|
||||||
"${{ github.event.pull_request.number }}" \
|
|
||||||
"${{ github.head_ref }}" \
|
|
||||||
"starting" \
|
|
||||||
"$(date -u '+%m/%d/%Y, %I:%M:%S %p')"
|
|
||||||
|
|
||||||
# Build Storybook for all PRs (free Cloudflare deployment)
|
|
||||||
storybook-build:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
if: github.event_name == 'pull_request'
|
|
||||||
outputs:
|
|
||||||
conclusion: ${{ steps.job-status.outputs.conclusion }}
|
|
||||||
workflow-url: ${{ steps.workflow-url.outputs.url }}
|
|
||||||
steps:
|
|
||||||
- name: Checkout code
|
|
||||||
uses: actions/checkout@v5
|
|
||||||
|
|
||||||
- name: Install pnpm
|
|
||||||
uses: pnpm/action-setup@v4
|
|
||||||
with:
|
|
||||||
version: 10
|
|
||||||
|
|
||||||
- name: Setup Node.js
|
|
||||||
uses: actions/setup-node@v4
|
|
||||||
with:
|
|
||||||
node-version: '20'
|
|
||||||
cache: 'pnpm'
|
|
||||||
|
|
||||||
- name: Cache tool outputs
|
|
||||||
uses: actions/cache@v4
|
|
||||||
with:
|
|
||||||
path: |
|
|
||||||
.cache
|
|
||||||
storybook-static
|
|
||||||
tsconfig.tsbuildinfo
|
|
||||||
key: storybook-cache-${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}-${{ hashFiles('src/**/*.{ts,vue,js}', '*.config.*', '.storybook/**/*') }}
|
|
||||||
restore-keys: |
|
|
||||||
storybook-cache-${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}-
|
|
||||||
storybook-cache-${{ runner.os }}-
|
|
||||||
storybook-tools-cache-${{ runner.os }}-
|
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
run: pnpm install --frozen-lockfile
|
|
||||||
|
|
||||||
- name: Build Storybook
|
|
||||||
run: pnpm build-storybook
|
|
||||||
|
|
||||||
- name: Set job status
|
|
||||||
id: job-status
|
|
||||||
if: always()
|
|
||||||
run: |
|
|
||||||
echo "conclusion=${{ job.status }}" >> $GITHUB_OUTPUT
|
|
||||||
|
|
||||||
- name: Get workflow URL
|
|
||||||
id: workflow-url
|
|
||||||
if: always()
|
|
||||||
run: |
|
|
||||||
echo "url=${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" >> $GITHUB_OUTPUT
|
|
||||||
|
|
||||||
- name: Upload Storybook build
|
|
||||||
if: success() && github.event.pull_request.head.repo.fork == false
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: storybook-static
|
|
||||||
path: storybook-static/
|
|
||||||
retention-days: 7
|
|
||||||
|
|
||||||
# Chromatic deployment only for version-bump-* branches or manual triggers
|
|
||||||
chromatic-deployment:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
if: github.event_name == 'workflow_dispatch' || (github.event_name == 'pull_request' && startsWith(github.head_ref, 'version-bump-'))
|
|
||||||
outputs:
|
|
||||||
conclusion: ${{ steps.job-status.outputs.conclusion }}
|
|
||||||
workflow-url: ${{ steps.workflow-url.outputs.url }}
|
|
||||||
chromatic-build-url: ${{ steps.chromatic.outputs.buildUrl }}
|
|
||||||
chromatic-storybook-url: ${{ steps.chromatic.outputs.storybookUrl }}
|
|
||||||
steps:
|
|
||||||
- name: Checkout code
|
|
||||||
uses: actions/checkout@v5
|
|
||||||
with:
|
|
||||||
fetch-depth: 0 # Required for Chromatic baseline
|
|
||||||
|
|
||||||
- name: Install pnpm
|
|
||||||
uses: pnpm/action-setup@v4
|
|
||||||
with:
|
|
||||||
version: 10
|
|
||||||
|
|
||||||
- name: Setup Node.js
|
|
||||||
uses: actions/setup-node@v4
|
|
||||||
with:
|
|
||||||
node-version: '20'
|
|
||||||
cache: 'pnpm'
|
|
||||||
|
|
||||||
- name: Cache tool outputs
|
|
||||||
uses: actions/cache@v4
|
|
||||||
with:
|
|
||||||
path: |
|
|
||||||
.cache
|
|
||||||
storybook-static
|
|
||||||
tsconfig.tsbuildinfo
|
|
||||||
key: storybook-cache-${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}-${{ hashFiles('src/**/*.{ts,vue,js}', '*.config.*', '.storybook/**/*') }}
|
|
||||||
restore-keys: |
|
|
||||||
storybook-cache-${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}-
|
|
||||||
storybook-cache-${{ runner.os }}-
|
|
||||||
storybook-tools-cache-${{ runner.os }}-
|
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
run: pnpm install --frozen-lockfile
|
|
||||||
|
|
||||||
- name: Build Storybook and run Chromatic
|
|
||||||
id: chromatic
|
|
||||||
uses: chromaui/action@latest
|
|
||||||
with:
|
|
||||||
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
|
|
||||||
buildScriptName: build-storybook
|
|
||||||
autoAcceptChanges: 'main' # Auto-accept changes on main branch
|
|
||||||
exitOnceUploaded: true # Don't wait for UI tests to complete
|
|
||||||
onlyChanged: true # Only capture changed stories
|
|
||||||
|
|
||||||
- name: Set job status
|
|
||||||
id: job-status
|
|
||||||
if: always()
|
|
||||||
run: |
|
|
||||||
echo "conclusion=${{ job.status }}" >> $GITHUB_OUTPUT
|
|
||||||
|
|
||||||
- name: Get workflow URL
|
|
||||||
id: workflow-url
|
|
||||||
if: always()
|
|
||||||
run: |
|
|
||||||
echo "url=${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" >> $GITHUB_OUTPUT
|
|
||||||
|
|
||||||
# Deploy and comment for non-forked PRs only
|
|
||||||
deploy-and-comment:
|
|
||||||
needs: [storybook-build]
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork == false && always()
|
|
||||||
permissions:
|
|
||||||
pull-requests: write
|
|
||||||
contents: read
|
|
||||||
steps:
|
|
||||||
- name: Checkout repository
|
|
||||||
uses: actions/checkout@v5
|
|
||||||
|
|
||||||
- name: Download Storybook build
|
|
||||||
if: needs.storybook-build.outputs.conclusion == 'success'
|
|
||||||
uses: actions/download-artifact@v4
|
|
||||||
with:
|
|
||||||
name: storybook-static
|
|
||||||
path: storybook-static
|
|
||||||
|
|
||||||
- name: Make deployment script executable
|
|
||||||
run: chmod +x scripts/cicd/pr-storybook-deploy-and-comment.sh
|
|
||||||
|
|
||||||
- name: Deploy Storybook and comment on PR
|
|
||||||
env:
|
|
||||||
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
|
||||||
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
|
|
||||||
GITHUB_TOKEN: ${{ github.token }}
|
|
||||||
WORKFLOW_CONCLUSION: ${{ needs.storybook-build.outputs.conclusion }}
|
|
||||||
WORKFLOW_URL: ${{ needs.storybook-build.outputs.workflow-url }}
|
|
||||||
run: |
|
|
||||||
./scripts/cicd/pr-storybook-deploy-and-comment.sh \
|
|
||||||
"${{ github.event.pull_request.number }}" \
|
|
||||||
"${{ github.head_ref }}" \
|
|
||||||
"completed"
|
|
||||||
|
|
||||||
# Update comment with Chromatic URLs for version-bump branches
|
|
||||||
update-comment-with-chromatic:
|
|
||||||
needs: [chromatic-deployment, deploy-and-comment]
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork == false && startsWith(github.head_ref, 'version-bump-') && needs.chromatic-deployment.outputs.chromatic-build-url != ''
|
|
||||||
permissions:
|
|
||||||
pull-requests: write
|
|
||||||
steps:
|
|
||||||
- name: Update comment with Chromatic URLs
|
|
||||||
uses: actions/github-script@v7
|
|
||||||
with:
|
|
||||||
script: |
|
|
||||||
const buildUrl = '${{ needs.chromatic-deployment.outputs.chromatic-build-url }}';
|
|
||||||
const storybookUrl = '${{ needs.chromatic-deployment.outputs.chromatic-storybook-url }}';
|
|
||||||
|
|
||||||
// Find the existing Storybook comment
|
|
||||||
const { data: comments } = await github.rest.issues.listComments({
|
|
||||||
owner: context.repo.owner,
|
|
||||||
repo: context.repo.repo,
|
|
||||||
issue_number: ${{ github.event.pull_request.number }}
|
|
||||||
});
|
|
||||||
|
|
||||||
const storybookComment = comments.find(comment =>
|
|
||||||
comment.body.includes('<!-- STORYBOOK_BUILD_STATUS -->')
|
|
||||||
);
|
|
||||||
|
|
||||||
if (storybookComment && buildUrl && storybookUrl) {
|
|
||||||
// Append Chromatic info to existing comment
|
|
||||||
const updatedBody = storybookComment.body.replace(
|
|
||||||
/---\n(.*)$/s,
|
|
||||||
`---\n### 🎨 Chromatic Visual Tests\n- 📊 [View Chromatic Build](${buildUrl})\n- 📚 [View Chromatic Storybook](${storybookUrl})\n\n$1`
|
|
||||||
);
|
|
||||||
|
|
||||||
await github.rest.issues.updateComment({
|
|
||||||
owner: context.repo.owner,
|
|
||||||
repo: context.repo.repo,
|
|
||||||
comment_id: storybookComment.id,
|
|
||||||
body: updatedBody
|
|
||||||
});
|
|
||||||
}
|
|
||||||
@@ -10,15 +10,20 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: github.event.label.name == 'New Browser Test Expectations'
|
if: github.event.label.name == 'New Browser Test Expectations'
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout workflow repo
|
- uses: Comfy-Org/ComfyUI_frontend_setup_action@v3
|
||||||
uses: actions/checkout@v5
|
- name: Cache Playwright browsers
|
||||||
- name: Setup Frontend
|
uses: actions/cache@v4
|
||||||
uses: ./.github/actions/setup-frontend
|
with:
|
||||||
- name: Setup Playwright
|
path: ~/.cache/ms-playwright
|
||||||
uses: ./.github/actions/setup-playwright
|
key: playwright-browsers-${{ runner.os }}-${{ hashFiles('ComfyUI_frontend/pnpm-lock.yaml') }}
|
||||||
|
restore-keys: |
|
||||||
|
playwright-browsers-${{ runner.os }}-
|
||||||
|
- name: Install Playwright Browsers
|
||||||
|
run: npx playwright install chromium --with-deps
|
||||||
|
working-directory: ComfyUI_frontend
|
||||||
- name: Run Playwright tests and update snapshots
|
- name: Run Playwright tests and update snapshots
|
||||||
id: playwright-tests
|
id: playwright-tests
|
||||||
run: pnpm exec playwright test --update-snapshots
|
run: npx playwright test --update-snapshots
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
working-directory: ComfyUI_frontend
|
working-directory: ComfyUI_frontend
|
||||||
- uses: actions/upload-artifact@v4
|
- uses: actions/upload-artifact@v4
|
||||||
@@ -39,6 +44,6 @@ jobs:
|
|||||||
git fetch origin ${{ github.head_ref }}
|
git fetch origin ${{ github.head_ref }}
|
||||||
git checkout -B ${{ github.head_ref }} origin/${{ github.head_ref }}
|
git checkout -B ${{ github.head_ref }} origin/${{ github.head_ref }}
|
||||||
git add browser_tests
|
git add browser_tests
|
||||||
git commit -m "[automated] Update test expectations"
|
git commit -m "Update test expectations [skip ci]"
|
||||||
git push origin HEAD:${{ github.head_ref }}
|
git push origin HEAD:${{ github.head_ref }}
|
||||||
working-directory: ComfyUI_frontend
|
working-directory: ComfyUI_frontend
|
||||||
@@ -12,24 +12,27 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
outputs:
|
outputs:
|
||||||
cache-key: ${{ steps.cache-key.outputs.key }}
|
cache-key: ${{ steps.cache-key.outputs.key }}
|
||||||
|
playwright-version: ${{ steps.playwright-version.outputs.PLAYWRIGHT_VERSION }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout ComfyUI
|
- name: Checkout ComfyUI
|
||||||
uses: actions/checkout@v5
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
repository: 'comfyanonymous/ComfyUI'
|
repository: 'comfyanonymous/ComfyUI'
|
||||||
path: 'ComfyUI'
|
path: 'ComfyUI'
|
||||||
ref: master
|
ref: master
|
||||||
|
|
||||||
- name: Checkout ComfyUI_frontend
|
- name: Checkout ComfyUI_frontend
|
||||||
uses: actions/checkout@v5
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
repository: 'Comfy-Org/ComfyUI_frontend'
|
repository: 'Comfy-Org/ComfyUI_frontend'
|
||||||
path: 'ComfyUI_frontend'
|
path: 'ComfyUI_frontend'
|
||||||
|
|
||||||
- name: Copy ComfyUI_devtools from frontend repo
|
- name: Checkout ComfyUI_devtools
|
||||||
run: |
|
uses: actions/checkout@v4
|
||||||
mkdir -p ComfyUI/custom_nodes/ComfyUI_devtools
|
with:
|
||||||
cp -r ComfyUI_frontend/tools/devtools/* ComfyUI/custom_nodes/ComfyUI_devtools/
|
repository: 'Comfy-Org/ComfyUI_devtools'
|
||||||
|
path: 'ComfyUI/custom_nodes/ComfyUI_devtools'
|
||||||
|
ref: 'd05fd48dd787a4192e16802d4244cfcc0e2f9684'
|
||||||
|
|
||||||
- name: Install pnpm
|
- name: Install pnpm
|
||||||
uses: pnpm/action-setup@v4
|
uses: pnpm/action-setup@v4
|
||||||
@@ -64,6 +67,12 @@ jobs:
|
|||||||
id: cache-key
|
id: cache-key
|
||||||
run: echo "key=$(date +%s)" >> $GITHUB_OUTPUT
|
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
|
- name: Save cache
|
||||||
uses: actions/cache/save@5a3ec84eff668545956fd18022155c47e93e2684
|
uses: actions/cache/save@5a3ec84eff668545956fd18022155c47e93e2684
|
||||||
@@ -116,8 +125,22 @@ jobs:
|
|||||||
working-directory: ComfyUI
|
working-directory: ComfyUI
|
||||||
|
|
||||||
|
|
||||||
- name: Setup Playwright
|
- name: Cache Playwright Browsers
|
||||||
uses: ./ComfyUI_frontend/.github/actions/setup-playwright
|
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
|
- name: Start ComfyUI server
|
||||||
run: |
|
run: |
|
||||||
@@ -127,7 +150,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Run Playwright tests (Shard ${{ matrix.shardIndex }}/${{ matrix.shardTotal }})
|
- name: Run Playwright tests (Shard ${{ matrix.shardIndex }}/${{ matrix.shardTotal }})
|
||||||
id: playwright
|
id: playwright
|
||||||
run: pnpm exec playwright test --project=chromium --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }} --reporter=blob
|
run: npx playwright test --project=chromium --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }} --reporter=blob
|
||||||
working-directory: ComfyUI_frontend
|
working-directory: ComfyUI_frontend
|
||||||
env:
|
env:
|
||||||
PLAYWRIGHT_BLOB_OUTPUT_DIR: ../blob-report
|
PLAYWRIGHT_BLOB_OUTPUT_DIR: ../blob-report
|
||||||
@@ -181,8 +204,22 @@ jobs:
|
|||||||
pip install wait-for-it
|
pip install wait-for-it
|
||||||
working-directory: ComfyUI
|
working-directory: ComfyUI
|
||||||
|
|
||||||
- name: Setup Playwright
|
- name: Cache Playwright Browsers
|
||||||
uses: ./ComfyUI_frontend/.github/actions/setup-playwright
|
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
|
- name: Start ComfyUI server
|
||||||
run: |
|
run: |
|
||||||
@@ -195,7 +232,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
# Run tests with both HTML and JSON reporters
|
# Run tests with both HTML and JSON reporters
|
||||||
PLAYWRIGHT_JSON_OUTPUT_NAME=playwright-report/report.json \
|
PLAYWRIGHT_JSON_OUTPUT_NAME=playwright-report/report.json \
|
||||||
pnpm exec playwright test --project=${{ matrix.browser }} \
|
npx playwright test --project=${{ matrix.browser }} \
|
||||||
--reporter=list \
|
--reporter=list \
|
||||||
--reporter=html \
|
--reporter=html \
|
||||||
--reporter=json
|
--reporter=json
|
||||||
@@ -215,7 +252,7 @@ jobs:
|
|||||||
if: ${{ !cancelled() }}
|
if: ${{ !cancelled() }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout ComfyUI_frontend
|
- name: Checkout ComfyUI_frontend
|
||||||
uses: actions/checkout@v5
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
repository: 'Comfy-Org/ComfyUI_frontend'
|
repository: 'Comfy-Org/ComfyUI_frontend'
|
||||||
path: 'ComfyUI_frontend'
|
path: 'ComfyUI_frontend'
|
||||||
@@ -246,10 +283,10 @@ jobs:
|
|||||||
- name: Merge into HTML Report
|
- name: Merge into HTML Report
|
||||||
run: |
|
run: |
|
||||||
# Generate HTML report
|
# Generate HTML report
|
||||||
pnpm exec playwright merge-reports --reporter=html ./all-blob-reports
|
npx playwright merge-reports --reporter=html ./all-blob-reports
|
||||||
# Generate JSON report separately with explicit output path
|
# Generate JSON report separately with explicit output path
|
||||||
PLAYWRIGHT_JSON_OUTPUT_NAME=playwright-report/report.json \
|
PLAYWRIGHT_JSON_OUTPUT_NAME=playwright-report/report.json \
|
||||||
pnpm exec playwright merge-reports --reporter=json ./all-blob-reports
|
npx playwright merge-reports --reporter=json ./all-blob-reports
|
||||||
working-directory: ComfyUI_frontend
|
working-directory: ComfyUI_frontend
|
||||||
|
|
||||||
- name: Upload HTML report
|
- name: Upload HTML report
|
||||||
@@ -271,7 +308,7 @@ jobs:
|
|||||||
pull-requests: write
|
pull-requests: write
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v5
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Get start time
|
- name: Get start time
|
||||||
id: start-time
|
id: start-time
|
||||||
@@ -298,7 +335,7 @@ jobs:
|
|||||||
contents: read
|
contents: read
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v5
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Download all playwright reports
|
- name: Download all playwright reports
|
||||||
uses: actions/download-artifact@v4
|
uses: actions/download-artifact@v4
|
||||||
2
.github/workflows/update-electron-types.yaml
vendored
@@ -12,7 +12,7 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v5
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Install pnpm
|
- name: Install pnpm
|
||||||
uses: pnpm/action-setup@v4
|
uses: pnpm/action-setup@v4
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ jobs:
|
|||||||
pull-requests: write
|
pull-requests: write
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v5
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Install pnpm
|
- name: Install pnpm
|
||||||
uses: pnpm/action-setup@v4
|
uses: pnpm/action-setup@v4
|
||||||
@@ -51,7 +51,7 @@ jobs:
|
|||||||
comfyui-manager-repo-${{ runner.os }}-
|
comfyui-manager-repo-${{ runner.os }}-
|
||||||
|
|
||||||
- name: Checkout ComfyUI-Manager repository
|
- name: Checkout ComfyUI-Manager repository
|
||||||
uses: actions/checkout@v5
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
repository: Comfy-Org/ComfyUI-Manager
|
repository: Comfy-Org/ComfyUI-Manager
|
||||||
path: ComfyUI-Manager
|
path: ComfyUI-Manager
|
||||||
@@ -68,7 +68,7 @@ jobs:
|
|||||||
- name: Generate Manager API types
|
- name: Generate Manager API types
|
||||||
run: |
|
run: |
|
||||||
echo "Generating TypeScript types from ComfyUI-Manager@${{ steps.manager-info.outputs.commit }}..."
|
echo "Generating TypeScript types from ComfyUI-Manager@${{ steps.manager-info.outputs.commit }}..."
|
||||||
pnpm dlx openapi-typescript ./ComfyUI-Manager/openapi.yaml --output ./src/types/generatedManagerTypes.ts
|
npx openapi-typescript ./ComfyUI-Manager/openapi.yaml --output ./src/types/generatedManagerTypes.ts
|
||||||
|
|
||||||
- name: Validate generated types
|
- name: Validate generated types
|
||||||
run: |
|
run: |
|
||||||
@@ -16,7 +16,7 @@ jobs:
|
|||||||
pull-requests: write
|
pull-requests: write
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v5
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Install pnpm
|
- name: Install pnpm
|
||||||
uses: pnpm/action-setup@v4
|
uses: pnpm/action-setup@v4
|
||||||
@@ -50,7 +50,7 @@ jobs:
|
|||||||
comfy-api-repo-${{ runner.os }}-
|
comfy-api-repo-${{ runner.os }}-
|
||||||
|
|
||||||
- name: Checkout comfy-api repository
|
- name: Checkout comfy-api repository
|
||||||
uses: actions/checkout@v5
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
repository: Comfy-Org/comfy-api
|
repository: Comfy-Org/comfy-api
|
||||||
path: comfy-api
|
path: comfy-api
|
||||||
@@ -68,18 +68,17 @@ jobs:
|
|||||||
- name: Generate API types
|
- name: Generate API types
|
||||||
run: |
|
run: |
|
||||||
echo "Generating TypeScript types from comfy-api@${{ steps.api-info.outputs.commit }}..."
|
echo "Generating TypeScript types from comfy-api@${{ steps.api-info.outputs.commit }}..."
|
||||||
mkdir -p ./packages/registry-types/src
|
npx openapi-typescript ./comfy-api/openapi.yml --output ./src/types/comfyRegistryTypes.ts
|
||||||
pnpm dlx openapi-typescript ./comfy-api/openapi.yml --output ./packages/registry-types/src/comfyRegistryTypes.ts
|
|
||||||
|
|
||||||
- name: Validate generated types
|
- name: Validate generated types
|
||||||
run: |
|
run: |
|
||||||
if [ ! -f ./packages/registry-types/src/comfyRegistryTypes.ts ]; then
|
if [ ! -f ./src/types/comfyRegistryTypes.ts ]; then
|
||||||
echo "Error: Types file was not generated."
|
echo "Error: Types file was not generated."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Check if file is not empty
|
# Check if file is not empty
|
||||||
if [ ! -s ./packages/registry-types/src/comfyRegistryTypes.ts ]; then
|
if [ ! -s ./src/types/comfyRegistryTypes.ts ]; then
|
||||||
echo "Error: Generated types file is empty."
|
echo "Error: Generated types file is empty."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
@@ -87,12 +86,12 @@ jobs:
|
|||||||
- name: Lint generated types
|
- name: Lint generated types
|
||||||
run: |
|
run: |
|
||||||
echo "Linting generated Comfy Registry API types..."
|
echo "Linting generated Comfy Registry API types..."
|
||||||
pnpm lint:fix:no-cache -- ./packages/registry-types/src/comfyRegistryTypes.ts
|
pnpm lint:fix:no-cache -- ./src/types/comfyRegistryTypes.ts
|
||||||
|
|
||||||
- name: Check for changes
|
- name: Check for changes
|
||||||
id: check-changes
|
id: check-changes
|
||||||
run: |
|
run: |
|
||||||
if [[ -z $(git status --porcelain ./packages/registry-types/src/comfyRegistryTypes.ts) ]]; then
|
if [[ -z $(git status --porcelain ./src/types/comfyRegistryTypes.ts) ]]; then
|
||||||
echo "No changes to Comfy Registry API types detected."
|
echo "No changes to Comfy Registry API types detected."
|
||||||
echo "changed=false" >> $GITHUB_OUTPUT
|
echo "changed=false" >> $GITHUB_OUTPUT
|
||||||
exit 0
|
exit 0
|
||||||
@@ -122,4 +121,4 @@ jobs:
|
|||||||
labels: CNR
|
labels: CNR
|
||||||
delete-branch: true
|
delete-branch: true
|
||||||
add-paths: |
|
add-paths: |
|
||||||
packages/registry-types/src/comfyRegistryTypes.ts
|
src/types/comfyRegistryTypes.ts
|
||||||
15
.github/workflows/validate-json.yaml
vendored
@@ -1,15 +0,0 @@
|
|||||||
name: Validate JSON
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
pull_request:
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
json-lint:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v5
|
|
||||||
- name: Validate JSON syntax
|
|
||||||
run: ./scripts/cicd/check-json.sh
|
|
||||||
2
.github/workflows/version-bump.yaml
vendored
@@ -24,7 +24,7 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v5
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Install pnpm
|
- name: Install pnpm
|
||||||
uses: pnpm/action-setup@v4
|
uses: pnpm/action-setup@v4
|
||||||
|
|||||||
44
.github/workflows/vitest-tests.yaml
vendored
@@ -1,44 +0,0 @@
|
|||||||
name: Vitest Tests
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches: [main, master, dev*, core/*, desktop/*]
|
|
||||||
pull_request:
|
|
||||||
branches-ignore: [wip/*, draft/*, temp/*]
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
test:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v5
|
|
||||||
|
|
||||||
- name: Install pnpm
|
|
||||||
uses: pnpm/action-setup@v4
|
|
||||||
with:
|
|
||||||
version: 10
|
|
||||||
|
|
||||||
- name: Use Node.js
|
|
||||||
uses: actions/setup-node@v4
|
|
||||||
with:
|
|
||||||
node-version: "lts/*"
|
|
||||||
cache: "pnpm"
|
|
||||||
|
|
||||||
- name: Cache tool outputs
|
|
||||||
uses: actions/cache@v4
|
|
||||||
with:
|
|
||||||
path: |
|
|
||||||
.cache
|
|
||||||
coverage
|
|
||||||
.vitest-cache
|
|
||||||
key: vitest-cache-${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}-${{ hashFiles('src/**/*.{ts,vue,js}', 'vitest.config.*', 'tsconfig.json') }}
|
|
||||||
restore-keys: |
|
|
||||||
vitest-cache-${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}-
|
|
||||||
vitest-cache-${{ runner.os }}-
|
|
||||||
test-tools-cache-${{ runner.os }}-
|
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
run: pnpm install --frozen-lockfile
|
|
||||||
|
|
||||||
- name: Run Vitest tests
|
|
||||||
run: pnpm test:unit
|
|
||||||
46
.github/workflows/vitest.yaml
vendored
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
name: Vitest Tests
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ main, master, dev*, core/*, desktop/* ]
|
||||||
|
pull_request:
|
||||||
|
branches-ignore: [ wip/*, draft/*, temp/* ]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
test:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Install pnpm
|
||||||
|
uses: pnpm/action-setup@v4
|
||||||
|
with:
|
||||||
|
version: 10
|
||||||
|
|
||||||
|
- name: Use Node.js
|
||||||
|
uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version: 'lts/*'
|
||||||
|
cache: 'pnpm'
|
||||||
|
|
||||||
|
- name: Cache tool outputs
|
||||||
|
uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
.cache
|
||||||
|
coverage
|
||||||
|
.vitest-cache
|
||||||
|
key: vitest-cache-${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}-${{ hashFiles('src/**/*.{ts,vue,js}', 'vitest.config.*', 'tsconfig.json') }}
|
||||||
|
restore-keys: |
|
||||||
|
vitest-cache-${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}-
|
||||||
|
vitest-cache-${{ runner.os }}-
|
||||||
|
test-tools-cache-${{ runner.os }}-
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: pnpm install --frozen-lockfile
|
||||||
|
|
||||||
|
- name: Run Vitest tests
|
||||||
|
run: |
|
||||||
|
pnpm test:component
|
||||||
|
pnpm test:unit
|
||||||
4
.gitignore
vendored
@@ -22,8 +22,6 @@ dist-ssr
|
|||||||
*.local
|
*.local
|
||||||
# Claude configuration
|
# Claude configuration
|
||||||
.claude/*.local.json
|
.claude/*.local.json
|
||||||
.claude/*.local.md
|
|
||||||
.claude/*.local.txt
|
|
||||||
CLAUDE.local.md
|
CLAUDE.local.md
|
||||||
|
|
||||||
# Editor directories and files
|
# Editor directories and files
|
||||||
@@ -31,7 +29,6 @@ CLAUDE.local.md
|
|||||||
*.code-workspace
|
*.code-workspace
|
||||||
!.vscode/extensions.json
|
!.vscode/extensions.json
|
||||||
!.vscode/tailwind.json
|
!.vscode/tailwind.json
|
||||||
!.vscode/custom-css.json
|
|
||||||
!.vscode/settings.json.default
|
!.vscode/settings.json.default
|
||||||
!.vscode/launch.json.default
|
!.vscode/launch.json.default
|
||||||
.idea
|
.idea
|
||||||
@@ -47,7 +44,6 @@ components.d.ts
|
|||||||
tests-ui/data/*
|
tests-ui/data/*
|
||||||
tests-ui/ComfyUI_examples
|
tests-ui/ComfyUI_examples
|
||||||
tests-ui/workflows/examples
|
tests-ui/workflows/examples
|
||||||
coverage/
|
|
||||||
|
|
||||||
# Browser tests
|
# Browser tests
|
||||||
/test-results/
|
/test-results/
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
pnpm exec lint-staged
|
pnpm exec lint-staged
|
||||||
pnpm exec tsx scripts/check-unused-i18n-keys.ts
|
pnpm exec tsx scripts/check-unused-i18n-keys.ts
|
||||||
|
|||||||
1
.npmrc
@@ -1,2 +1 @@
|
|||||||
ignore-workspace-root-check=true
|
ignore-workspace-root-check=true
|
||||||
catalog-mode=prefer
|
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
packages/registry-types/src/comfyRegistryTypes.ts
|
src/types/comfyRegistryTypes.ts
|
||||||
src/types/generatedManagerTypes.ts
|
src/types/generatedManagerTypes.ts
|
||||||
@@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
- `pnpm storybook`: Start Storybook development server
|
- `pnpm storybook`: Start Storybook development server
|
||||||
- `pnpm build-storybook`: Build static Storybook
|
- `pnpm build-storybook`: Build static Storybook
|
||||||
- `pnpm test:unit`: Run unit tests (includes Storybook components)
|
- `pnpm test:component`: Run component tests (includes Storybook components)
|
||||||
|
|
||||||
## Development Workflow for Storybook
|
## Development Workflow for Storybook
|
||||||
|
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ const config: StorybookConfig = {
|
|||||||
compiler: 'vue3',
|
compiler: 'vue3',
|
||||||
customCollections: {
|
customCollections: {
|
||||||
comfy: FileSystemIconLoader(
|
comfy: FileSystemIconLoader(
|
||||||
process.cwd() + '/packages/design-system/src/icons'
|
process.cwd() + '/src/assets/icons/custom'
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
|
|||||||
50
.vscode/custom-css.json
vendored
@@ -1,50 +0,0 @@
|
|||||||
{
|
|
||||||
"version": 1.1,
|
|
||||||
"properties": [
|
|
||||||
{
|
|
||||||
"name": "app-region",
|
|
||||||
"description": "Electron-specific CSS property that defines draggable regions in custom title bar windows. Setting 'drag' marks a rectangular area as draggable for moving the window; 'no-drag' excludes areas from the draggable region.",
|
|
||||||
"values": [
|
|
||||||
{
|
|
||||||
"name": "drag",
|
|
||||||
"description": "Marks the element as draggable for moving the Electron window"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "no-drag",
|
|
||||||
"description": "Excludes the element from being used to drag the Electron window"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"references": [
|
|
||||||
{
|
|
||||||
"name": "Electron Window Customization",
|
|
||||||
"url": "https://www.electronjs.org/docs/latest/tutorial/window-customization"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "speak",
|
|
||||||
"description": "Deprecated CSS2 aural stylesheet property for controlling screen reader speech. Use ARIA attributes instead.",
|
|
||||||
"values": [
|
|
||||||
{
|
|
||||||
"name": "auto",
|
|
||||||
"description": "Content is read aurally if element is not a block and is visible"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "never",
|
|
||||||
"description": "Content will not be read aurally"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "always",
|
|
||||||
"description": "Content will be read aurally regardless of display settings"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"references": [
|
|
||||||
{
|
|
||||||
"name": "CSS-Tricks Reference",
|
|
||||||
"url": "https://css-tricks.com/almanac/properties/s/speak/"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"status": "obsolete"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
3
.vscode/settings.json.default
vendored
@@ -1,6 +1,5 @@
|
|||||||
{
|
{
|
||||||
"css.customData": [
|
"css.customData": [
|
||||||
".vscode/tailwind.json",
|
".vscode/tailwind.json"
|
||||||
".vscode/custom-css.json"
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
36
.vscode/tailwind.json
vendored
@@ -7,7 +7,7 @@
|
|||||||
"references": [
|
"references": [
|
||||||
{
|
{
|
||||||
"name": "Tailwind Documentation",
|
"name": "Tailwind Documentation",
|
||||||
"url": "https://tailwindcss.com/docs/functions-and-directives#import-directive"
|
"url": "https://tailwindcss.com/docs/functions-and-directives#import"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@@ -17,7 +17,7 @@
|
|||||||
"references": [
|
"references": [
|
||||||
{
|
{
|
||||||
"name": "Tailwind Documentation",
|
"name": "Tailwind Documentation",
|
||||||
"url": "https://tailwindcss.com/docs/functions-and-directives#theme-directive"
|
"url": "https://tailwindcss.com/docs/functions-and-directives#theme"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@@ -27,17 +27,17 @@
|
|||||||
"references": [
|
"references": [
|
||||||
{
|
{
|
||||||
"name": "Tailwind Documentation",
|
"name": "Tailwind Documentation",
|
||||||
"url": "https://tailwindcss.com/docs/theme#layers"
|
"url": "https://tailwindcss.com/docs/functions-and-directives#layer"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "@apply",
|
"name": "@apply",
|
||||||
"description": "DO NOT USE. IF YOU ARE CAUGHT USING @apply YOU WILL FACE SEVERE CONSEQUENCES.",
|
"description": "Use the `@apply` directive to inline any existing utility classes into your own custom CSS. This is useful when you find a common utility pattern in your HTML that you’d like to extract to a new component.",
|
||||||
"references": [
|
"references": [
|
||||||
{
|
{
|
||||||
"name": "Tailwind Documentation",
|
"name": "Tailwind Documentation",
|
||||||
"url": "https://tailwindcss.com/docs/functions-and-directives#apply-directive"
|
"url": "https://tailwindcss.com/docs/functions-and-directives#apply"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@@ -47,7 +47,7 @@
|
|||||||
"references": [
|
"references": [
|
||||||
{
|
{
|
||||||
"name": "Tailwind Documentation",
|
"name": "Tailwind Documentation",
|
||||||
"url": "https://tailwindcss.com/docs/functions-and-directives#config-directive"
|
"url": "https://tailwindcss.com/docs/functions-and-directives#config"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@@ -57,7 +57,7 @@
|
|||||||
"references": [
|
"references": [
|
||||||
{
|
{
|
||||||
"name": "Tailwind Documentation",
|
"name": "Tailwind Documentation",
|
||||||
"url": "https://tailwindcss.com/docs/functions-and-directives#reference-directive"
|
"url": "https://tailwindcss.com/docs/functions-and-directives#reference"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@@ -67,27 +67,7 @@
|
|||||||
"references": [
|
"references": [
|
||||||
{
|
{
|
||||||
"name": "Tailwind Documentation",
|
"name": "Tailwind Documentation",
|
||||||
"url": "https://tailwindcss.com/docs/functions-and-directives#plugin-directive"
|
"url": "https://tailwindcss.com/docs/functions-and-directives#plugin"
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "@custom-variant",
|
|
||||||
"description": "Use the `@custom-variant` directive to add a custom variant to your project. Custom variants can be used with utilities like `hover`, `focus`, and responsive breakpoints. Use `@slot` inside the variant to indicate where the utility's styles should be inserted.",
|
|
||||||
"references": [
|
|
||||||
{
|
|
||||||
"name": "Tailwind Documentation",
|
|
||||||
"url": "https://tailwindcss.com/docs/adding-custom-styles#adding-custom-variants"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "@utility",
|
|
||||||
"description": "Use the `@utility` directive to add custom utilities to your project. Custom utilities work with all variants like `hover`, `focus`, and responsive variants. Use `--value()` to create functional utilities that accept arguments.",
|
|
||||||
"references": [
|
|
||||||
{
|
|
||||||
"name": "Tailwind Documentation",
|
|
||||||
"url": "https://tailwindcss.com/docs/adding-custom-styles#adding-custom-utilities"
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,7 +12,8 @@
|
|||||||
- `pnpm dev:electron`: Dev server with Electron API mocks.
|
- `pnpm dev:electron`: Dev server with Electron API mocks.
|
||||||
- `pnpm build`: Type-check then production build to `dist/`.
|
- `pnpm build`: Type-check then production build to `dist/`.
|
||||||
- `pnpm preview`: Preview the production build locally.
|
- `pnpm preview`: Preview the production build locally.
|
||||||
- `pnpm test:unit`: Run Vitest unit tests.
|
- `pnpm test:unit`: Run Vitest unit tests (`tests-ui/`).
|
||||||
|
- `pnpm test:component`: Run component tests (`src/components/`).
|
||||||
- `pnpm test:browser`: Run Playwright E2E tests (`browser_tests/`).
|
- `pnpm test:browser`: Run Playwright E2E tests (`browser_tests/`).
|
||||||
- `pnpm lint` / `pnpm lint:fix`: Lint (ESLint). `pnpm format` / `format:check`: Prettier.
|
- `pnpm lint` / `pnpm lint:fix`: Lint (ESLint). `pnpm format` / `format:check`: Prettier.
|
||||||
- `pnpm typecheck`: Vue TSC type checking.
|
- `pnpm typecheck`: Vue TSC type checking.
|
||||||
@@ -30,9 +31,10 @@
|
|||||||
- Playwright: place tests in `browser_tests/`; optional tags like `@mobile`, `@2x` are respected by config.
|
- Playwright: place tests in `browser_tests/`; optional tags like `@mobile`, `@2x` are respected by config.
|
||||||
|
|
||||||
## Commit & Pull Request Guidelines
|
## Commit & Pull Request Guidelines
|
||||||
- Commits: Use `[skip ci]` for locale-only updates when appropriate.
|
- Commits: Prefer Conventional Commits (e.g., `feat(ui): add sidebar`), `refactor(litegraph): …`. Use `[skip ci]` for locale-only updates when appropriate.
|
||||||
- PRs: Include clear description, linked issues (`- Fixes #123`), and screenshots/GIFs for UI changes.
|
- PRs: Include clear description, linked issues (`Fixes #123`), and screenshots/GIFs for UI changes. Add/adjust tests and i18n strings when applicable.
|
||||||
- Quality gates: `pnpm lint`, `pnpm typecheck`, and relevant tests must pass. Keep PRs focused and small.
|
- Quality gates: `pnpm lint`, `pnpm typecheck`, and relevant tests must pass. Keep PRs focused and small.
|
||||||
|
|
||||||
## Security & Configuration Tips
|
## Security & Configuration Tips
|
||||||
- Secrets: Use `.env` (see `.env_example`); do not commit secrets.
|
- Secrets: Use `.env` (see `.env_example`); do not commit secrets.
|
||||||
|
- Backend: Dev server expects ComfyUI backend at `localhost:8188` by default; configure via `.env`.
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ This bootstraps the monorepo with dependencies, builds, tests, and dev server ve
|
|||||||
- `pnpm build`: Build for production (via nx)
|
- `pnpm build`: Build for production (via nx)
|
||||||
- `pnpm lint`: Linting (via nx)
|
- `pnpm lint`: Linting (via nx)
|
||||||
- `pnpm format`: Prettier formatting
|
- `pnpm format`: Prettier formatting
|
||||||
|
- `pnpm test:component`: Run component tests with browser environment
|
||||||
- `pnpm test:unit`: Run all unit tests
|
- `pnpm test:unit`: Run all unit tests
|
||||||
- `pnpm test:browser`: Run E2E tests via Playwright
|
- `pnpm test:browser`: Run E2E tests via Playwright
|
||||||
- `pnpm test:unit -- tests-ui/tests/example.test.ts`: Run single test file
|
- `pnpm test:unit -- tests-ui/tests/example.test.ts`: Run single test file
|
||||||
|
|||||||
70
CODEOWNERS
@@ -1,61 +1,17 @@
|
|||||||
# Desktop/Electron
|
# Admins
|
||||||
/src/types/desktop/ @webfiltered
|
* @Comfy-Org/comfy_frontend_devs
|
||||||
/src/constants/desktopDialogs.ts @webfiltered
|
|
||||||
/src/constants/desktopMaintenanceTasks.ts @webfiltered
|
|
||||||
/src/stores/electronDownloadStore.ts @webfiltered
|
|
||||||
/src/extensions/core/electronAdapter.ts @webfiltered
|
|
||||||
/src/views/DesktopDialogView.vue @webfiltered
|
|
||||||
/src/components/install/ @webfiltered
|
|
||||||
/src/components/maintenance/ @webfiltered
|
|
||||||
/vite.electron.config.mts @webfiltered
|
|
||||||
|
|
||||||
# Common UI Components
|
# Maintainers
|
||||||
/src/components/chip/ @viva-jinyi
|
*.md @Comfy-Org/comfy_maintainer
|
||||||
/src/components/card/ @viva-jinyi
|
/tests-ui/ @Comfy-Org/comfy_maintainer
|
||||||
/src/components/button/ @viva-jinyi
|
/browser_tests/ @Comfy-Org/comfy_maintainer
|
||||||
/src/components/input/ @viva-jinyi
|
/.env_example @Comfy-Org/comfy_maintainer
|
||||||
|
|
||||||
# Topbar
|
# Translations (AIGODLIKE team + shinshin86)
|
||||||
/src/components/topbar/ @pythongosssss
|
/src/locales/ @Yorha4D @KarryCharon @DorotaLuna @shinshin86 @Comfy-Org/comfy_maintainer
|
||||||
|
|
||||||
# Thumbnail
|
# Load 3D extension
|
||||||
/src/renderer/core/thumbnail/ @pythongosssss
|
/src/extensions/core/load3d.ts @jtydhr88 @Comfy-Org/comfy_frontend_devs
|
||||||
|
|
||||||
# Legacy UI
|
# Mask Editor extension
|
||||||
/scripts/ui/ @pythongosssss
|
/src/extensions/core/maskeditor.ts @brucew4yn3rp @trsommer @Comfy-Org/comfy_frontend_devs
|
||||||
|
|
||||||
# Link rendering
|
|
||||||
/src/renderer/core/canvas/links/ @benceruleanlu
|
|
||||||
|
|
||||||
# Node help system
|
|
||||||
/src/utils/nodeHelpUtil.ts @benceruleanlu
|
|
||||||
/src/stores/workspace/nodeHelpStore.ts @benceruleanlu
|
|
||||||
/src/services/nodeHelpService.ts @benceruleanlu
|
|
||||||
|
|
||||||
# Selection toolbox
|
|
||||||
/src/components/graph/selectionToolbox/ @Myestery
|
|
||||||
|
|
||||||
# Minimap
|
|
||||||
/src/renderer/extensions/minimap/ @jtydhr88
|
|
||||||
|
|
||||||
# Assets
|
|
||||||
/src/platform/assets/ @arjansingh
|
|
||||||
|
|
||||||
# Workflow Templates
|
|
||||||
/src/platform/workflow/templates/ @Myestery @christian-byrne @comfyui-wiki
|
|
||||||
/src/components/templates/ @Myestery @christian-byrne @comfyui-wiki
|
|
||||||
|
|
||||||
# Mask Editor
|
|
||||||
/src/extensions/core/maskeditor.ts @trsommer @brucew4yn3rp
|
|
||||||
/src/extensions/core/maskEditorLayerFilenames.ts @trsommer @brucew4yn3rp
|
|
||||||
/src/extensions/core/maskEditorOld.ts @trsommer @brucew4yn3rp
|
|
||||||
|
|
||||||
# 3D
|
|
||||||
/src/extensions/core/load3d.ts @jtydhr88
|
|
||||||
/src/components/load3d/ @jtydhr88
|
|
||||||
|
|
||||||
# Manager
|
|
||||||
/src/workbench/extensions/manager/ @viva-jinyi @christian-byrne @ltdrdata
|
|
||||||
|
|
||||||
# Translations
|
|
||||||
/src/locales/ @Yorha4D @KarryCharon @shinshin86 @Comfy-Org/comfy_maintainer
|
|
||||||
|
|||||||
@@ -213,6 +213,12 @@ Here's how Claude Code can use the Playwright MCP server to inspect the interfac
|
|||||||
- `pnpm i` to install all dependencies
|
- `pnpm i` to install all dependencies
|
||||||
- `pnpm test:unit` to execute all unit tests
|
- `pnpm test:unit` to execute all unit tests
|
||||||
|
|
||||||
|
### Component Tests
|
||||||
|
|
||||||
|
Component tests verify Vue components in `src/components/`.
|
||||||
|
|
||||||
|
- `pnpm test:component` to execute all component tests
|
||||||
|
|
||||||
### Playwright Tests
|
### Playwright Tests
|
||||||
|
|
||||||
Playwright tests verify the whole app. See [browser_tests/README.md](browser_tests/README.md) for details.
|
Playwright tests verify the whole app. See [browser_tests/README.md](browser_tests/README.md) for details.
|
||||||
@@ -223,6 +229,7 @@ Before submitting a PR, ensure all tests pass:
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
pnpm test:unit
|
pnpm test:unit
|
||||||
|
pnpm test:component
|
||||||
pnpm test:browser
|
pnpm test:browser
|
||||||
pnpm typecheck
|
pnpm typecheck
|
||||||
pnpm lint
|
pnpm lint
|
||||||
@@ -258,9 +265,9 @@ The project supports three types of icons, all with automatic imports (no manual
|
|||||||
2. **Iconify Icons** - 200,000+ icons from various libraries: `<i-lucide:settings />`, `<i-mdi:folder />`
|
2. **Iconify Icons** - 200,000+ icons from various libraries: `<i-lucide:settings />`, `<i-mdi:folder />`
|
||||||
3. **Custom Icons** - Your own SVG icons: `<i-comfy:workflow />`
|
3. **Custom Icons** - Your own SVG icons: `<i-comfy:workflow />`
|
||||||
|
|
||||||
Icons are powered by the unplugin-icons system, which automatically discovers and imports icons as Vue components. Custom icons are stored in `packages/design-system/src/icons/` and processed by `packages/design-system/src/iconCollection.ts` with automatic validation.
|
Icons are powered by the unplugin-icons system, which automatically discovers and imports icons as Vue components. Custom icons are stored in `src/assets/icons/custom/` and processed by `build/customIconCollection.ts` with automatic validation.
|
||||||
|
|
||||||
For detailed instructions and code examples, see [packages/design-system/src/icons/README.md](packages/design-system/src/icons/README.md).
|
For detailed instructions and code examples, see [src/assets/icons/README.md](src/assets/icons/README.md).
|
||||||
|
|
||||||
## Working with litegraph.js
|
## Working with litegraph.js
|
||||||
|
|
||||||
|
|||||||
@@ -16,20 +16,15 @@ Without this flag, parallel tests will conflict and fail randomly.
|
|||||||
|
|
||||||
### ComfyUI devtools
|
### ComfyUI devtools
|
||||||
|
|
||||||
ComfyUI_devtools is included in this repository under `tools/devtools/`. During CI/CD, these files are automatically copied to the `custom_nodes` directory.
|
Clone <https://github.com/Comfy-Org/ComfyUI_devtools> to your `custom_nodes` directory.
|
||||||
_ComfyUI_devtools adds additional API endpoints and nodes to ComfyUI for browser testing._
|
_ComfyUI_devtools adds additional API endpoints and nodes to ComfyUI for browser testing._
|
||||||
|
|
||||||
For local development, copy the devtools files to your ComfyUI installation:
|
|
||||||
```bash
|
|
||||||
cp -r tools/devtools/* /path/to/your/ComfyUI/custom_nodes/ComfyUI_devtools/
|
|
||||||
```
|
|
||||||
|
|
||||||
### Node.js & Playwright Prerequisites
|
### Node.js & Playwright Prerequisites
|
||||||
|
|
||||||
Ensure you have Node.js v20 or v22 installed. Then, set up the Chromium test driver:
|
Ensure you have Node.js v20 or v22 installed. Then, set up the Chromium test driver:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
pnpm exec playwright install chromium --with-deps
|
npx playwright install chromium --with-deps
|
||||||
```
|
```
|
||||||
|
|
||||||
### Environment Configuration
|
### Environment Configuration
|
||||||
@@ -56,6 +51,14 @@ TEST_COMFYUI_DIR=/path/to/your/ComfyUI
|
|||||||
|
|
||||||
### Common Setup Issues
|
### Common Setup Issues
|
||||||
|
|
||||||
|
**Most tests require the new menu system** - Add to your test:
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
test.beforeEach(async ({ comfyPage }) => {
|
||||||
|
await comfyPage.setSetting('Comfy.UseNewMenu', 'Top')
|
||||||
|
})
|
||||||
|
```
|
||||||
|
|
||||||
### Release API Mocking
|
### Release API Mocking
|
||||||
|
|
||||||
By default, all tests mock the release API (`api.comfy.org/releases`) to prevent release notification popups from interfering with test execution. This is necessary because the release notifications can appear over UI elements and block test interactions.
|
By default, all tests mock the release API (`api.comfy.org/releases`) to prevent release notification popups from interfering with test execution. This is necessary because the release notifications can appear over UI elements and block test interactions.
|
||||||
@@ -73,7 +76,7 @@ For tests that specifically need to test release functionality, see the example
|
|||||||
**Always use UI mode for development:**
|
**Always use UI mode for development:**
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
pnpm exec playwright test --ui
|
npx playwright test --ui
|
||||||
```
|
```
|
||||||
|
|
||||||
UI mode features:
|
UI mode features:
|
||||||
@@ -84,13 +87,13 @@ UI mode features:
|
|||||||
- **Console/Network Tabs**: View logs and API calls at each step
|
- **Console/Network Tabs**: View logs and API calls at each step
|
||||||
- **Attachments Tab**: View all snapshots with expected and actual images
|
- **Attachments Tab**: View all snapshots with expected and actual images
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
For CI or headless testing:
|
For CI or headless testing:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
pnpm exec playwright test # Run all tests
|
npx playwright test # Run all tests
|
||||||
pnpm exec playwright test widget.spec.ts # Run specific test file
|
npx playwright test widget.spec.ts # Run specific test file
|
||||||
```
|
```
|
||||||
|
|
||||||
### Local Development Config
|
### Local Development Config
|
||||||
@@ -386,7 +389,7 @@ export default defineConfig({
|
|||||||
Option 2 - Generate local baselines for comparison:
|
Option 2 - Generate local baselines for comparison:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
pnpm exec playwright test --update-snapshots
|
npx playwright test --update-snapshots
|
||||||
```
|
```
|
||||||
|
|
||||||
### Creating New Screenshot Baselines
|
### Creating New Screenshot Baselines
|
||||||
|
|||||||
@@ -1,221 +0,0 @@
|
|||||||
{
|
|
||||||
"id": "e74f5af9-b886-4a21-abbf-ed535d12e2fb",
|
|
||||||
"revision": 0,
|
|
||||||
"last_node_id": 8,
|
|
||||||
"last_link_id": 0,
|
|
||||||
"nodes": [
|
|
||||||
{
|
|
||||||
"id": 1,
|
|
||||||
"type": "LoadAudio",
|
|
||||||
"pos": [
|
|
||||||
41.52964782714844,
|
|
||||||
16.930862426757812
|
|
||||||
],
|
|
||||||
"size": [
|
|
||||||
444,
|
|
||||||
125
|
|
||||||
],
|
|
||||||
"flags": {},
|
|
||||||
"order": 0,
|
|
||||||
"mode": 0,
|
|
||||||
"inputs": [],
|
|
||||||
"outputs": [
|
|
||||||
{
|
|
||||||
"name": "AUDIO",
|
|
||||||
"type": "AUDIO",
|
|
||||||
"links": null
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"properties": {
|
|
||||||
"Node name for S&R": "LoadAudio"
|
|
||||||
},
|
|
||||||
"widgets_values": [
|
|
||||||
null,
|
|
||||||
null,
|
|
||||||
""
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 2,
|
|
||||||
"type": "LoadVideo",
|
|
||||||
"pos": [
|
|
||||||
502.28570556640625,
|
|
||||||
16.857147216796875
|
|
||||||
],
|
|
||||||
"size": [
|
|
||||||
444,
|
|
||||||
525
|
|
||||||
],
|
|
||||||
"flags": {},
|
|
||||||
"order": 1,
|
|
||||||
"mode": 0,
|
|
||||||
"inputs": [],
|
|
||||||
"outputs": [
|
|
||||||
{
|
|
||||||
"name": "VIDEO",
|
|
||||||
"type": "VIDEO",
|
|
||||||
"links": null
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"properties": {
|
|
||||||
"Node name for S&R": "LoadVideo"
|
|
||||||
},
|
|
||||||
"widgets_values": [
|
|
||||||
null,
|
|
||||||
"image"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 3,
|
|
||||||
"type": "DevToolsLoadAnimatedImageTest",
|
|
||||||
"pos": [
|
|
||||||
41.71427917480469,
|
|
||||||
188.0000457763672
|
|
||||||
],
|
|
||||||
"size": [
|
|
||||||
444,
|
|
||||||
553
|
|
||||||
],
|
|
||||||
"flags": {},
|
|
||||||
"order": 2,
|
|
||||||
"mode": 0,
|
|
||||||
"inputs": [],
|
|
||||||
"outputs": [
|
|
||||||
{
|
|
||||||
"name": "IMAGE",
|
|
||||||
"type": "IMAGE",
|
|
||||||
"links": null
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "MASK",
|
|
||||||
"type": "MASK",
|
|
||||||
"links": null
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"properties": {
|
|
||||||
"Node name for S&R": "DevToolsLoadAnimatedImageTest"
|
|
||||||
},
|
|
||||||
"widgets_values": [
|
|
||||||
null,
|
|
||||||
"image"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 5,
|
|
||||||
"type": "LoadImage",
|
|
||||||
"pos": [
|
|
||||||
958.285888671875,
|
|
||||||
16.57145118713379
|
|
||||||
],
|
|
||||||
"size": [
|
|
||||||
444,
|
|
||||||
553
|
|
||||||
],
|
|
||||||
"flags": {},
|
|
||||||
"order": 3,
|
|
||||||
"mode": 0,
|
|
||||||
"inputs": [],
|
|
||||||
"outputs": [
|
|
||||||
{
|
|
||||||
"name": "IMAGE",
|
|
||||||
"type": "IMAGE",
|
|
||||||
"links": null
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "MASK",
|
|
||||||
"type": "MASK",
|
|
||||||
"links": null
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"properties": {
|
|
||||||
"Node name for S&R": "LoadImage"
|
|
||||||
},
|
|
||||||
"widgets_values": [
|
|
||||||
null,
|
|
||||||
"image"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 6,
|
|
||||||
"type": "LoadImageMask",
|
|
||||||
"pos": [
|
|
||||||
503.4285888671875,
|
|
||||||
588
|
|
||||||
],
|
|
||||||
"size": [
|
|
||||||
444,
|
|
||||||
563
|
|
||||||
],
|
|
||||||
"flags": {},
|
|
||||||
"order": 4,
|
|
||||||
"mode": 0,
|
|
||||||
"inputs": [],
|
|
||||||
"outputs": [
|
|
||||||
{
|
|
||||||
"name": "MASK",
|
|
||||||
"type": "MASK",
|
|
||||||
"links": null
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"properties": {
|
|
||||||
"Node name for S&R": "LoadImageMask"
|
|
||||||
},
|
|
||||||
"widgets_values": [
|
|
||||||
null,
|
|
||||||
"alpha",
|
|
||||||
"image"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 7,
|
|
||||||
"type": "LoadImageOutput",
|
|
||||||
"pos": [
|
|
||||||
965.1429443359375,
|
|
||||||
612
|
|
||||||
],
|
|
||||||
"size": [
|
|
||||||
444,
|
|
||||||
553
|
|
||||||
],
|
|
||||||
"flags": {},
|
|
||||||
"order": 5,
|
|
||||||
"mode": 0,
|
|
||||||
"inputs": [],
|
|
||||||
"outputs": [
|
|
||||||
{
|
|
||||||
"name": "IMAGE",
|
|
||||||
"type": "IMAGE",
|
|
||||||
"links": null
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "MASK",
|
|
||||||
"type": "MASK",
|
|
||||||
"links": null
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"properties": {
|
|
||||||
"Node name for S&R": "LoadImageOutput"
|
|
||||||
},
|
|
||||||
"widgets_values": [
|
|
||||||
null,
|
|
||||||
false,
|
|
||||||
"refresh",
|
|
||||||
"image"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"links": [],
|
|
||||||
"groups": [],
|
|
||||||
"config": {},
|
|
||||||
"extra": {
|
|
||||||
"ds": {
|
|
||||||
"scale": 1,
|
|
||||||
"offset": [
|
|
||||||
0,
|
|
||||||
0
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"frontendVersion": "1.28.3"
|
|
||||||
},
|
|
||||||
"version": 0.4
|
|
||||||
}
|
|
||||||
@@ -1643,7 +1643,7 @@ export const comfyPageFixture = base.extend<{
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
await comfyPage.setupSettings({
|
await comfyPage.setupSettings({
|
||||||
'Comfy.UseNewMenu': 'Top',
|
'Comfy.UseNewMenu': 'Disabled',
|
||||||
// Hide canvas menu/info/selection toolbox by default.
|
// Hide canvas menu/info/selection toolbox by default.
|
||||||
'Comfy.Graph.CanvasInfo': false,
|
'Comfy.Graph.CanvasInfo': false,
|
||||||
'Comfy.Graph.CanvasMenu': false,
|
'Comfy.Graph.CanvasMenu': false,
|
||||||
|
|||||||
@@ -22,13 +22,6 @@ export class VueNodeHelpers {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Get locator for a Vue node by the node's title (displayed name in the header)
|
|
||||||
*/
|
|
||||||
getNodeByTitle(title: string): Locator {
|
|
||||||
return this.page.locator(`[data-node-id]`).filter({ hasText: title })
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get total count of Vue nodes in the DOM
|
* Get total count of Vue nodes in the DOM
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -151,8 +151,7 @@ class NodeSlotReference {
|
|||||||
const convertedPos =
|
const convertedPos =
|
||||||
window['app'].canvas.ds.convertOffsetToCanvas(rawPos)
|
window['app'].canvas.ds.convertOffsetToCanvas(rawPos)
|
||||||
|
|
||||||
// Debug logging - convert Float64Arrays to regular arrays for visibility
|
// Debug logging - convert Float32Arrays to regular arrays for visibility
|
||||||
// eslint-disable-next-line no-console
|
|
||||||
console.log(
|
console.log(
|
||||||
`NodeSlotReference debug for ${type} slot ${index} on node ${id}:`,
|
`NodeSlotReference debug for ${type} slot ${index} on node ${id}:`,
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -2,10 +2,6 @@ import { expect } from '@playwright/test'
|
|||||||
|
|
||||||
import { comfyPageFixture as test } from '../fixtures/ComfyPage'
|
import { comfyPageFixture as test } from '../fixtures/ComfyPage'
|
||||||
|
|
||||||
test.beforeEach(async ({ comfyPage }) => {
|
|
||||||
await comfyPage.setSetting('Comfy.UseNewMenu', 'Disabled')
|
|
||||||
})
|
|
||||||
|
|
||||||
test.describe('Background Image Upload', () => {
|
test.describe('Background Image Upload', () => {
|
||||||
test.beforeEach(async ({ comfyPage }) => {
|
test.beforeEach(async ({ comfyPage }) => {
|
||||||
// Reset the background image setting before each test
|
// Reset the background image setting before each test
|
||||||
|
|||||||
@@ -15,10 +15,6 @@ async function afterChange(comfyPage: ComfyPage) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
test.beforeEach(async ({ comfyPage }) => {
|
|
||||||
await comfyPage.setSetting('Comfy.UseNewMenu', 'Disabled')
|
|
||||||
})
|
|
||||||
|
|
||||||
test.describe('Change Tracker', () => {
|
test.describe('Change Tracker', () => {
|
||||||
test.describe('Undo/Redo', () => {
|
test.describe('Undo/Redo', () => {
|
||||||
test.beforeEach(async ({ comfyPage }) => {
|
test.beforeEach(async ({ comfyPage }) => {
|
||||||
|
|||||||
@@ -3,10 +3,6 @@ import { expect } from '@playwright/test'
|
|||||||
|
|
||||||
import { comfyPageFixture as test } from '../fixtures/ComfyPage'
|
import { comfyPageFixture as test } from '../fixtures/ComfyPage'
|
||||||
|
|
||||||
test.beforeEach(async ({ comfyPage }) => {
|
|
||||||
await comfyPage.setSetting('Comfy.UseNewMenu', 'Disabled')
|
|
||||||
})
|
|
||||||
|
|
||||||
interface ChatHistoryEntry {
|
interface ChatHistoryEntry {
|
||||||
prompt: string
|
prompt: string
|
||||||
response: string
|
response: string
|
||||||
|
|||||||
@@ -3,10 +3,6 @@ import { expect } from '@playwright/test'
|
|||||||
import type { Palette } from '../../src/schemas/colorPaletteSchema'
|
import type { Palette } from '../../src/schemas/colorPaletteSchema'
|
||||||
import { comfyPageFixture as test } from '../fixtures/ComfyPage'
|
import { comfyPageFixture as test } from '../fixtures/ComfyPage'
|
||||||
|
|
||||||
test.beforeEach(async ({ comfyPage }) => {
|
|
||||||
await comfyPage.setSetting('Comfy.UseNewMenu', 'Disabled')
|
|
||||||
})
|
|
||||||
|
|
||||||
const customColorPalettes: Record<string, Palette> = {
|
const customColorPalettes: Record<string, Palette> = {
|
||||||
obsidian: {
|
obsidian: {
|
||||||
version: 102,
|
version: 102,
|
||||||
|
|||||||
@@ -2,10 +2,6 @@ import { expect } from '@playwright/test'
|
|||||||
|
|
||||||
import { comfyPageFixture as test } from '../fixtures/ComfyPage'
|
import { comfyPageFixture as test } from '../fixtures/ComfyPage'
|
||||||
|
|
||||||
test.beforeEach(async ({ comfyPage }) => {
|
|
||||||
await comfyPage.setSetting('Comfy.UseNewMenu', 'Disabled')
|
|
||||||
})
|
|
||||||
|
|
||||||
test.describe('Keybindings', () => {
|
test.describe('Keybindings', () => {
|
||||||
test('Should execute command', async ({ comfyPage }) => {
|
test('Should execute command', async ({ comfyPage }) => {
|
||||||
await comfyPage.registerCommand('TestCommand', () => {
|
await comfyPage.registerCommand('TestCommand', () => {
|
||||||
|
|||||||
@@ -2,10 +2,6 @@ import { expect } from '@playwright/test'
|
|||||||
|
|
||||||
import { comfyPageFixture as test } from '../fixtures/ComfyPage'
|
import { comfyPageFixture as test } from '../fixtures/ComfyPage'
|
||||||
|
|
||||||
test.beforeEach(async ({ comfyPage }) => {
|
|
||||||
await comfyPage.setSetting('Comfy.UseNewMenu', 'Disabled')
|
|
||||||
})
|
|
||||||
|
|
||||||
test.describe('Copy Paste', () => {
|
test.describe('Copy Paste', () => {
|
||||||
test('Can copy and paste node', async ({ comfyPage }) => {
|
test('Can copy and paste node', async ({ comfyPage }) => {
|
||||||
await comfyPage.clickEmptyLatentNode()
|
await comfyPage.clickEmptyLatentNode()
|
||||||
|
|||||||
@@ -4,10 +4,6 @@ import { expect } from '@playwright/test'
|
|||||||
import type { Keybinding } from '../../src/schemas/keyBindingSchema'
|
import type { Keybinding } from '../../src/schemas/keyBindingSchema'
|
||||||
import { comfyPageFixture as test } from '../fixtures/ComfyPage'
|
import { comfyPageFixture as test } from '../fixtures/ComfyPage'
|
||||||
|
|
||||||
test.beforeEach(async ({ comfyPage }) => {
|
|
||||||
await comfyPage.setSetting('Comfy.UseNewMenu', 'Disabled')
|
|
||||||
})
|
|
||||||
|
|
||||||
test.describe('Load workflow warning', () => {
|
test.describe('Load workflow warning', () => {
|
||||||
test('Should display a warning when loading a workflow with missing nodes', async ({
|
test('Should display a warning when loading a workflow with missing nodes', async ({
|
||||||
comfyPage
|
comfyPage
|
||||||
|
|||||||
@@ -2,10 +2,6 @@ import { expect } from '@playwright/test'
|
|||||||
|
|
||||||
import { comfyPageFixture as test } from '../fixtures/ComfyPage'
|
import { comfyPageFixture as test } from '../fixtures/ComfyPage'
|
||||||
|
|
||||||
test.beforeEach(async ({ comfyPage }) => {
|
|
||||||
await comfyPage.setSetting('Comfy.UseNewMenu', 'Disabled')
|
|
||||||
})
|
|
||||||
|
|
||||||
test.describe('DOM Widget', () => {
|
test.describe('DOM Widget', () => {
|
||||||
test('Collapsed multiline textarea is not visible', async ({ comfyPage }) => {
|
test('Collapsed multiline textarea is not visible', async ({ comfyPage }) => {
|
||||||
await comfyPage.loadWorkflow('widgets/collapsed_multiline')
|
await comfyPage.loadWorkflow('widgets/collapsed_multiline')
|
||||||
@@ -53,10 +49,6 @@ test.describe('DOM Widget', () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
test('should reposition when layout changes', async ({ comfyPage }) => {
|
test('should reposition when layout changes', async ({ comfyPage }) => {
|
||||||
test.skip(
|
|
||||||
true,
|
|
||||||
'Only recalculates when the Canvas size changes, need to recheck the logic'
|
|
||||||
)
|
|
||||||
// --- setup ---
|
// --- setup ---
|
||||||
|
|
||||||
const textareaWidget = comfyPage.page
|
const textareaWidget = comfyPage.page
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 88 KiB After Width: | Height: | Size: 88 KiB |
@@ -2,10 +2,6 @@ import { expect } from '@playwright/test'
|
|||||||
|
|
||||||
import { comfyPageFixture as test } from '../fixtures/ComfyPage'
|
import { comfyPageFixture as test } from '../fixtures/ComfyPage'
|
||||||
|
|
||||||
test.beforeEach(async ({ comfyPage }) => {
|
|
||||||
await comfyPage.setSetting('Comfy.UseNewMenu', 'Disabled')
|
|
||||||
})
|
|
||||||
|
|
||||||
test.describe('Execution', () => {
|
test.describe('Execution', () => {
|
||||||
test('Report error on unconnected slot', async ({ comfyPage }) => {
|
test('Report error on unconnected slot', async ({ comfyPage }) => {
|
||||||
await comfyPage.disconnectEdge()
|
await comfyPage.disconnectEdge()
|
||||||
|
|||||||
@@ -2,10 +2,6 @@ import { expect } from '@playwright/test'
|
|||||||
|
|
||||||
import { comfyPageFixture as test } from '../fixtures/ComfyPage'
|
import { comfyPageFixture as test } from '../fixtures/ComfyPage'
|
||||||
|
|
||||||
test.beforeEach(async ({ comfyPage }) => {
|
|
||||||
await comfyPage.setSetting('Comfy.UseNewMenu', 'Disabled')
|
|
||||||
})
|
|
||||||
|
|
||||||
test.describe('Feature Flags', () => {
|
test.describe('Feature Flags', () => {
|
||||||
test('Client and server exchange feature flags on connection', async ({
|
test('Client and server exchange feature flags on connection', async ({
|
||||||
comfyPage
|
comfyPage
|
||||||
|
|||||||
@@ -2,10 +2,6 @@ import { expect } from '@playwright/test'
|
|||||||
|
|
||||||
import { comfyPageFixture as test } from '../fixtures/ComfyPage'
|
import { comfyPageFixture as test } from '../fixtures/ComfyPage'
|
||||||
|
|
||||||
test.beforeEach(async ({ comfyPage }) => {
|
|
||||||
await comfyPage.setSetting('Comfy.UseNewMenu', 'Disabled')
|
|
||||||
})
|
|
||||||
|
|
||||||
test.describe('Graph', () => {
|
test.describe('Graph', () => {
|
||||||
// Should be able to fix link input slot index after swap the input order
|
// Should be able to fix link input slot index after swap the input order
|
||||||
// Ref: https://github.com/Comfy-Org/ComfyUI_frontend/issues/3348
|
// Ref: https://github.com/Comfy-Org/ComfyUI_frontend/issues/3348
|
||||||
|
|||||||
@@ -2,10 +2,6 @@ import { expect } from '@playwright/test'
|
|||||||
|
|
||||||
import { comfyPageFixture as test } from '../fixtures/ComfyPage'
|
import { comfyPageFixture as test } from '../fixtures/ComfyPage'
|
||||||
|
|
||||||
test.beforeEach(async ({ comfyPage }) => {
|
|
||||||
await comfyPage.setSetting('Comfy.UseNewMenu', 'Disabled')
|
|
||||||
})
|
|
||||||
|
|
||||||
test.describe('Graph Canvas Menu', () => {
|
test.describe('Graph Canvas Menu', () => {
|
||||||
test.beforeEach(async ({ comfyPage }) => {
|
test.beforeEach(async ({ comfyPage }) => {
|
||||||
// Set link render mode to spline to make sure it's not affected by other tests'
|
// Set link render mode to spline to make sure it's not affected by other tests'
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 86 KiB After Width: | Height: | Size: 86 KiB |
|
Before Width: | Height: | Size: 100 KiB After Width: | Height: | Size: 100 KiB |
@@ -4,10 +4,6 @@ import type { ComfyPage } from '../fixtures/ComfyPage'
|
|||||||
import { comfyPageFixture as test } from '../fixtures/ComfyPage'
|
import { comfyPageFixture as test } from '../fixtures/ComfyPage'
|
||||||
import type { NodeReference } from '../fixtures/utils/litegraphUtils'
|
import type { NodeReference } from '../fixtures/utils/litegraphUtils'
|
||||||
|
|
||||||
test.beforeEach(async ({ comfyPage }) => {
|
|
||||||
await comfyPage.setSetting('Comfy.UseNewMenu', 'Disabled')
|
|
||||||
})
|
|
||||||
|
|
||||||
test.describe('Group Node', () => {
|
test.describe('Group Node', () => {
|
||||||
test.describe('Node library sidebar', () => {
|
test.describe('Node library sidebar', () => {
|
||||||
const groupNodeName = 'DefautWorkflowGroupNode'
|
const groupNodeName = 'DefautWorkflowGroupNode'
|
||||||
|
|||||||
@@ -9,10 +9,6 @@ import {
|
|||||||
} from '../fixtures/ComfyPage'
|
} from '../fixtures/ComfyPage'
|
||||||
import type { NodeReference } from '../fixtures/utils/litegraphUtils'
|
import type { NodeReference } from '../fixtures/utils/litegraphUtils'
|
||||||
|
|
||||||
test.beforeEach(async ({ comfyPage }) => {
|
|
||||||
await comfyPage.setSetting('Comfy.UseNewMenu', 'Disabled')
|
|
||||||
})
|
|
||||||
|
|
||||||
test.describe('Item Interaction', () => {
|
test.describe('Item Interaction', () => {
|
||||||
test('Can select/delete all items', async ({ comfyPage }) => {
|
test('Can select/delete all items', async ({ comfyPage }) => {
|
||||||
await comfyPage.loadWorkflow('groups/mixed_graph_items')
|
await comfyPage.loadWorkflow('groups/mixed_graph_items')
|
||||||
|
|||||||
@@ -2,10 +2,6 @@ import { expect } from '@playwright/test'
|
|||||||
|
|
||||||
import { comfyPageFixture as test } from '../fixtures/ComfyPage'
|
import { comfyPageFixture as test } from '../fixtures/ComfyPage'
|
||||||
|
|
||||||
test.beforeEach(async ({ comfyPage }) => {
|
|
||||||
await comfyPage.setSetting('Comfy.UseNewMenu', 'Disabled')
|
|
||||||
})
|
|
||||||
|
|
||||||
test.describe('Keybindings', () => {
|
test.describe('Keybindings', () => {
|
||||||
test('Should not trigger non-modifier keybinding when typing in input fields', async ({
|
test('Should not trigger non-modifier keybinding when typing in input fields', async ({
|
||||||
comfyPage
|
comfyPage
|
||||||
|
|||||||
@@ -2,10 +2,6 @@ import { expect } from '@playwright/test'
|
|||||||
|
|
||||||
import { comfyPageFixture as test } from '../fixtures/ComfyPage'
|
import { comfyPageFixture as test } from '../fixtures/ComfyPage'
|
||||||
|
|
||||||
test.beforeEach(async ({ comfyPage }) => {
|
|
||||||
await comfyPage.setSetting('Comfy.UseNewMenu', 'Disabled')
|
|
||||||
})
|
|
||||||
|
|
||||||
function listenForEvent(): Promise<Event> {
|
function listenForEvent(): Promise<Event> {
|
||||||
return new Promise<Event>((resolve) => {
|
return new Promise<Event>((resolve) => {
|
||||||
document.addEventListener('litegraph:canvas', (e) => resolve(e), {
|
document.addEventListener('litegraph:canvas', (e) => resolve(e), {
|
||||||
|
|||||||
@@ -2,10 +2,6 @@ import { expect } from '@playwright/test'
|
|||||||
|
|
||||||
import { comfyPageFixture as test } from '../fixtures/ComfyPage'
|
import { comfyPageFixture as test } from '../fixtures/ComfyPage'
|
||||||
|
|
||||||
test.beforeEach(async ({ comfyPage }) => {
|
|
||||||
await comfyPage.setSetting('Comfy.UseNewMenu', 'Disabled')
|
|
||||||
})
|
|
||||||
|
|
||||||
test.describe('Load Workflow in Media', () => {
|
test.describe('Load Workflow in Media', () => {
|
||||||
const fileNames = [
|
const fileNames = [
|
||||||
'workflow.webp',
|
'workflow.webp',
|
||||||
|
|||||||
@@ -2,10 +2,6 @@ import { expect } from '@playwright/test'
|
|||||||
|
|
||||||
import { comfyPageFixture as test } from '../fixtures/ComfyPage'
|
import { comfyPageFixture as test } from '../fixtures/ComfyPage'
|
||||||
|
|
||||||
test.beforeEach(async ({ comfyPage }) => {
|
|
||||||
await comfyPage.setSetting('Comfy.UseNewMenu', 'Disabled')
|
|
||||||
})
|
|
||||||
|
|
||||||
test.describe('LOD Threshold', () => {
|
test.describe('LOD Threshold', () => {
|
||||||
test('Should switch to low quality mode at correct zoom threshold', async ({
|
test('Should switch to low quality mode at correct zoom threshold', async ({
|
||||||
comfyPage
|
comfyPage
|
||||||
|
|||||||
@@ -4,10 +4,6 @@ import type { ComfyApp } from '../../src/scripts/app'
|
|||||||
import { NodeBadgeMode } from '../../src/types/nodeSource'
|
import { NodeBadgeMode } from '../../src/types/nodeSource'
|
||||||
import { comfyPageFixture as test } from '../fixtures/ComfyPage'
|
import { comfyPageFixture as test } from '../fixtures/ComfyPage'
|
||||||
|
|
||||||
test.beforeEach(async ({ comfyPage }) => {
|
|
||||||
await comfyPage.setSetting('Comfy.UseNewMenu', 'Disabled')
|
|
||||||
})
|
|
||||||
|
|
||||||
test.describe('Node Badge', () => {
|
test.describe('Node Badge', () => {
|
||||||
test('Can add badge', async ({ comfyPage }) => {
|
test('Can add badge', async ({ comfyPage }) => {
|
||||||
await comfyPage.page.evaluate(() => {
|
await comfyPage.page.evaluate(() => {
|
||||||
|
|||||||
@@ -2,10 +2,6 @@ import { expect } from '@playwright/test'
|
|||||||
|
|
||||||
import { comfyPageFixture as test } from '../fixtures/ComfyPage'
|
import { comfyPageFixture as test } from '../fixtures/ComfyPage'
|
||||||
|
|
||||||
test.beforeEach(async ({ comfyPage }) => {
|
|
||||||
await comfyPage.setSetting('Comfy.UseNewMenu', 'Disabled')
|
|
||||||
})
|
|
||||||
|
|
||||||
// If an input is optional by node definition, it should be shown as
|
// If an input is optional by node definition, it should be shown as
|
||||||
// a hollow circle no matter what shape it was defined in the workflow JSON.
|
// a hollow circle no matter what shape it was defined in the workflow JSON.
|
||||||
test.describe('Optional input', () => {
|
test.describe('Optional input', () => {
|
||||||
|
|||||||
@@ -3,10 +3,6 @@ import {
|
|||||||
comfyPageFixture as test
|
comfyPageFixture as test
|
||||||
} from '../fixtures/ComfyPage'
|
} from '../fixtures/ComfyPage'
|
||||||
|
|
||||||
test.beforeEach(async ({ comfyPage }) => {
|
|
||||||
await comfyPage.setSetting('Comfy.UseNewMenu', 'Disabled')
|
|
||||||
})
|
|
||||||
|
|
||||||
test.describe('Node search box', () => {
|
test.describe('Node search box', () => {
|
||||||
test.beforeEach(async ({ comfyPage }) => {
|
test.beforeEach(async ({ comfyPage }) => {
|
||||||
await comfyPage.setSetting('Comfy.LinkRelease.Action', 'search box')
|
await comfyPage.setSetting('Comfy.LinkRelease.Action', 'search box')
|
||||||
|
|||||||
@@ -2,10 +2,6 @@ import { expect } from '@playwright/test'
|
|||||||
|
|
||||||
import { comfyPageFixture as test } from '../fixtures/ComfyPage'
|
import { comfyPageFixture as test } from '../fixtures/ComfyPage'
|
||||||
|
|
||||||
test.beforeEach(async ({ comfyPage }) => {
|
|
||||||
await comfyPage.setSetting('Comfy.UseNewMenu', 'Disabled')
|
|
||||||
})
|
|
||||||
|
|
||||||
test.describe('Note Node', () => {
|
test.describe('Note Node', () => {
|
||||||
test('Can load node nodes', async ({ comfyPage }) => {
|
test('Can load node nodes', async ({ comfyPage }) => {
|
||||||
await comfyPage.loadWorkflow('nodes/note_nodes')
|
await comfyPage.loadWorkflow('nodes/note_nodes')
|
||||||
|
|||||||
@@ -3,10 +3,6 @@ import { expect } from '@playwright/test'
|
|||||||
import { comfyPageFixture as test } from '../fixtures/ComfyPage'
|
import { comfyPageFixture as test } from '../fixtures/ComfyPage'
|
||||||
import type { NodeReference } from '../fixtures/utils/litegraphUtils'
|
import type { NodeReference } from '../fixtures/utils/litegraphUtils'
|
||||||
|
|
||||||
test.beforeEach(async ({ comfyPage }) => {
|
|
||||||
await comfyPage.setSetting('Comfy.UseNewMenu', 'Disabled')
|
|
||||||
})
|
|
||||||
|
|
||||||
test.describe('Primitive Node', () => {
|
test.describe('Primitive Node', () => {
|
||||||
test('Can load with correct size', async ({ comfyPage }) => {
|
test('Can load with correct size', async ({ comfyPage }) => {
|
||||||
await comfyPage.loadWorkflow('primitive/primitive_node')
|
await comfyPage.loadWorkflow('primitive/primitive_node')
|
||||||
|
|||||||
@@ -40,7 +40,6 @@ test.describe('Reroute Node', () => {
|
|||||||
|
|
||||||
test.describe('LiteGraph Native Reroute Node', () => {
|
test.describe('LiteGraph Native Reroute Node', () => {
|
||||||
test.beforeEach(async ({ comfyPage }) => {
|
test.beforeEach(async ({ comfyPage }) => {
|
||||||
await comfyPage.setSetting('Comfy.UseNewMenu', 'Disabled')
|
|
||||||
await comfyPage.setSetting('LiteGraph.Reroute.SplineOffset', 80)
|
await comfyPage.setSetting('LiteGraph.Reroute.SplineOffset', 80)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 29 KiB After Width: | Height: | Size: 29 KiB |
@@ -3,10 +3,6 @@ import { expect } from '@playwright/test'
|
|||||||
import { NodeBadgeMode } from '../../src/types/nodeSource'
|
import { NodeBadgeMode } from '../../src/types/nodeSource'
|
||||||
import { comfyPageFixture as test } from '../fixtures/ComfyPage'
|
import { comfyPageFixture as test } from '../fixtures/ComfyPage'
|
||||||
|
|
||||||
test.beforeEach(async ({ comfyPage }) => {
|
|
||||||
await comfyPage.setSetting('Comfy.UseNewMenu', 'Disabled')
|
|
||||||
})
|
|
||||||
|
|
||||||
test.describe('Canvas Right Click Menu', () => {
|
test.describe('Canvas Right Click Menu', () => {
|
||||||
test('Can add node', async ({ comfyPage }) => {
|
test('Can add node', async ({ comfyPage }) => {
|
||||||
await comfyPage.rightClickCanvas()
|
await comfyPage.rightClickCanvas()
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 105 KiB After Width: | Height: | Size: 105 KiB |
|
Before Width: | Height: | Size: 107 KiB After Width: | Height: | Size: 107 KiB |
|
Before Width: | Height: | Size: 105 KiB After Width: | Height: | Size: 105 KiB |
@@ -4,9 +4,6 @@ import { comfyPageFixture } from '../fixtures/ComfyPage'
|
|||||||
|
|
||||||
const test = comfyPageFixture
|
const test = comfyPageFixture
|
||||||
|
|
||||||
test.beforeEach(async ({ comfyPage }) => {
|
|
||||||
await comfyPage.setSetting('Comfy.UseNewMenu', 'Disabled')
|
|
||||||
})
|
|
||||||
const BLUE_COLOR = 'rgb(51, 51, 85)'
|
const BLUE_COLOR = 'rgb(51, 51, 85)'
|
||||||
const RED_COLOR = 'rgb(85, 51, 51)'
|
const RED_COLOR = 'rgb(85, 51, 51)'
|
||||||
|
|
||||||
|
|||||||
@@ -2,10 +2,6 @@ import { expect } from '@playwright/test'
|
|||||||
|
|
||||||
import { comfyPageFixture as test } from '../fixtures/ComfyPage'
|
import { comfyPageFixture as test } from '../fixtures/ComfyPage'
|
||||||
|
|
||||||
test.beforeEach(async ({ comfyPage }) => {
|
|
||||||
await comfyPage.setSetting('Comfy.UseNewMenu', 'Disabled')
|
|
||||||
})
|
|
||||||
|
|
||||||
test.describe('Selection Toolbox - More Options Submenus', () => {
|
test.describe('Selection Toolbox - More Options Submenus', () => {
|
||||||
test.beforeEach(async ({ comfyPage }) => {
|
test.beforeEach(async ({ comfyPage }) => {
|
||||||
await comfyPage.setSetting('Comfy.Canvas.SelectionToolbox', true)
|
await comfyPage.setSetting('Comfy.Canvas.SelectionToolbox', true)
|
||||||
|
|||||||
@@ -80,12 +80,6 @@ test.describe('Templates', () => {
|
|||||||
// Load a template
|
// Load a template
|
||||||
await comfyPage.executeCommand('Comfy.BrowseTemplates')
|
await comfyPage.executeCommand('Comfy.BrowseTemplates')
|
||||||
await expect(comfyPage.templates.content).toBeVisible()
|
await expect(comfyPage.templates.content).toBeVisible()
|
||||||
|
|
||||||
await comfyPage.page
|
|
||||||
.locator(
|
|
||||||
'nav > div:nth-child(2) > div > span:has-text("Getting Started")'
|
|
||||||
)
|
|
||||||
.click()
|
|
||||||
await comfyPage.templates.loadTemplate('default')
|
await comfyPage.templates.loadTemplate('default')
|
||||||
await expect(comfyPage.templates.content).toBeHidden()
|
await expect(comfyPage.templates.content).toBeHidden()
|
||||||
|
|
||||||
@@ -108,72 +102,48 @@ test.describe('Templates', () => {
|
|||||||
expect(await comfyPage.templates.content.isVisible()).toBe(true)
|
expect(await comfyPage.templates.content.isVisible()).toBe(true)
|
||||||
})
|
})
|
||||||
|
|
||||||
test('Uses proper locale files for templates', async ({ comfyPage }) => {
|
test('Uses title field as fallback when the key is not found in locales', async ({
|
||||||
// Set locale to French before opening templates
|
|
||||||
await comfyPage.setSetting('Comfy.Locale', 'fr')
|
|
||||||
|
|
||||||
// Load the templates dialog and wait for the French index file request
|
|
||||||
const requestPromise = comfyPage.page.waitForRequest(
|
|
||||||
'**/templates/index.fr.json'
|
|
||||||
)
|
|
||||||
|
|
||||||
await comfyPage.executeCommand('Comfy.BrowseTemplates')
|
|
||||||
|
|
||||||
const request = await requestPromise
|
|
||||||
|
|
||||||
// Verify French index was requested
|
|
||||||
expect(request.url()).toContain('templates/index.fr.json')
|
|
||||||
|
|
||||||
await expect(comfyPage.templates.content).toBeVisible()
|
|
||||||
})
|
|
||||||
|
|
||||||
test('Falls back to English templates when locale file not found', async ({
|
|
||||||
comfyPage
|
comfyPage
|
||||||
}) => {
|
}) => {
|
||||||
// Set locale to a language that doesn't have a template file
|
// Capture request for the index.json
|
||||||
await comfyPage.setSetting('Comfy.Locale', 'de') // German - no index.de.json exists
|
await comfyPage.page.route('**/templates/index.json', async (route, _) => {
|
||||||
|
// Add a new template that won't have a translation pre-generated
|
||||||
// Wait for the German request (expected to 404)
|
const response = [
|
||||||
const germanRequestPromise = comfyPage.page.waitForRequest(
|
{
|
||||||
'**/templates/index.de.json'
|
moduleName: 'default',
|
||||||
)
|
title: 'FALLBACK CATEGORY',
|
||||||
|
type: 'image',
|
||||||
// Wait for the fallback English request
|
templates: [
|
||||||
const englishRequestPromise = comfyPage.page.waitForRequest(
|
{
|
||||||
'**/templates/index.json'
|
name: 'unknown_key_has_no_translation_available',
|
||||||
)
|
title: 'FALLBACK TEMPLATE NAME',
|
||||||
|
mediaType: 'image',
|
||||||
// Intercept the German file to simulate a 404
|
mediaSubtype: 'webp',
|
||||||
await comfyPage.page.route('**/templates/index.de.json', async (route) => {
|
description: 'No translations found'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
await route.fulfill({
|
await route.fulfill({
|
||||||
status: 404,
|
status: 200,
|
||||||
headers: { 'Content-Type': 'text/plain' },
|
body: JSON.stringify(response),
|
||||||
body: 'Not Found'
|
headers: {
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
'Cache-Control': 'no-store'
|
||||||
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
// Allow the English index to load normally
|
|
||||||
await comfyPage.page.route('**/templates/index.json', (route) =>
|
|
||||||
route.continue()
|
|
||||||
)
|
|
||||||
|
|
||||||
// Load the templates dialog
|
// Load the templates dialog
|
||||||
await comfyPage.executeCommand('Comfy.BrowseTemplates')
|
await comfyPage.executeCommand('Comfy.BrowseTemplates')
|
||||||
await expect(comfyPage.templates.content).toBeVisible()
|
|
||||||
|
|
||||||
// Verify German was requested first, then English as fallback
|
// Expect the title to be used as fallback for template cards
|
||||||
const germanRequest = await germanRequestPromise
|
|
||||||
const englishRequest = await englishRequestPromise
|
|
||||||
|
|
||||||
expect(germanRequest.url()).toContain('templates/index.de.json')
|
|
||||||
expect(englishRequest.url()).toContain('templates/index.json')
|
|
||||||
|
|
||||||
// Verify English titles are shown as fallback
|
|
||||||
await expect(
|
await expect(
|
||||||
comfyPage.templates.content.getByRole('heading', {
|
comfyPage.templates.content.getByText('FALLBACK TEMPLATE NAME')
|
||||||
name: 'Image Generation'
|
|
||||||
})
|
|
||||||
).toBeVisible()
|
).toBeVisible()
|
||||||
|
|
||||||
|
// Expect the title to be used as fallback for the template categories
|
||||||
|
await expect(comfyPage.page.getByLabel('FALLBACK CATEGORY')).toBeVisible()
|
||||||
})
|
})
|
||||||
|
|
||||||
test('template cards are dynamically sized and responsive', async ({
|
test('template cards are dynamically sized and responsive', async ({
|
||||||
@@ -181,33 +151,46 @@ test.describe('Templates', () => {
|
|||||||
}) => {
|
}) => {
|
||||||
// Open templates dialog
|
// Open templates dialog
|
||||||
await comfyPage.executeCommand('Comfy.BrowseTemplates')
|
await comfyPage.executeCommand('Comfy.BrowseTemplates')
|
||||||
await comfyPage.templates.content.waitFor({ state: 'visible' })
|
await expect(comfyPage.templates.content).toBeVisible()
|
||||||
|
|
||||||
const templateGrid = comfyPage.page.locator(
|
// Wait for at least one template card to appear
|
||||||
'[data-testid="template-workflows-content"]'
|
await expect(comfyPage.page.locator('.template-card').first()).toBeVisible({
|
||||||
)
|
timeout: 5000
|
||||||
const nav = comfyPage.page
|
})
|
||||||
.locator('header')
|
|
||||||
.filter({ hasText: 'Templates' })
|
|
||||||
|
|
||||||
const cardCount = await comfyPage.page
|
// Take snapshot of the template grid
|
||||||
.locator('[data-testid^="template-workflow-"]')
|
const templateGrid = comfyPage.templates.content.locator('.grid').first()
|
||||||
.count()
|
|
||||||
expect(cardCount).toBeGreaterThan(0)
|
|
||||||
await expect(templateGrid).toBeVisible()
|
await expect(templateGrid).toBeVisible()
|
||||||
await expect(nav).toBeVisible() // Nav should be visible at desktop size
|
await expect(templateGrid).toHaveScreenshot('template-grid-desktop.png')
|
||||||
|
|
||||||
const mobileSize = { width: 640, height: 800 }
|
// Check cards at mobile viewport size
|
||||||
await comfyPage.page.setViewportSize(mobileSize)
|
await comfyPage.page.setViewportSize({ width: 640, height: 800 })
|
||||||
expect(cardCount).toBeGreaterThan(0)
|
|
||||||
await expect(templateGrid).toBeVisible()
|
await expect(templateGrid).toBeVisible()
|
||||||
await expect(nav).not.toBeVisible() // Nav should collapse at mobile size
|
await expect(templateGrid).toHaveScreenshot('template-grid-mobile.png')
|
||||||
|
|
||||||
const tabletSize = { width: 1024, height: 800 }
|
// Check cards at tablet size
|
||||||
await comfyPage.page.setViewportSize(tabletSize)
|
await comfyPage.page.setViewportSize({ width: 1024, height: 800 })
|
||||||
expect(cardCount).toBeGreaterThan(0)
|
|
||||||
await expect(templateGrid).toBeVisible()
|
await expect(templateGrid).toBeVisible()
|
||||||
await expect(nav).toBeVisible() // Nav should be visible at tablet size
|
await expect(templateGrid).toHaveScreenshot('template-grid-tablet.png')
|
||||||
|
})
|
||||||
|
|
||||||
|
test('hover effects work on template cards', async ({ comfyPage }) => {
|
||||||
|
// Open templates dialog
|
||||||
|
await comfyPage.executeCommand('Comfy.BrowseTemplates')
|
||||||
|
await expect(comfyPage.templates.content).toBeVisible()
|
||||||
|
|
||||||
|
// Get a template card
|
||||||
|
const firstCard = comfyPage.page.locator('.template-card').first()
|
||||||
|
await expect(firstCard).toBeVisible({ timeout: 5000 })
|
||||||
|
|
||||||
|
// Take snapshot before hover
|
||||||
|
await expect(firstCard).toHaveScreenshot('template-card-before-hover.png')
|
||||||
|
|
||||||
|
// Hover over the card
|
||||||
|
await firstCard.hover()
|
||||||
|
|
||||||
|
// Take snapshot after hover to verify hover effect
|
||||||
|
await expect(firstCard).toHaveScreenshot('template-card-after-hover.png')
|
||||||
})
|
})
|
||||||
|
|
||||||
test('template cards descriptions adjust height dynamically', async ({
|
test('template cards descriptions adjust height dynamically', async ({
|
||||||
@@ -274,42 +257,21 @@ test.describe('Templates', () => {
|
|||||||
await comfyPage.executeCommand('Comfy.BrowseTemplates')
|
await comfyPage.executeCommand('Comfy.BrowseTemplates')
|
||||||
await expect(comfyPage.templates.content).toBeVisible()
|
await expect(comfyPage.templates.content).toBeVisible()
|
||||||
|
|
||||||
// Wait for cards to load
|
// Verify cards are visible with varying content lengths
|
||||||
await expect(
|
await expect(
|
||||||
comfyPage.page.locator(
|
comfyPage.page.getByText('This is a short description.')
|
||||||
'[data-testid="template-workflow-short-description"]'
|
).toBeVisible({ timeout: 5000 })
|
||||||
)
|
await expect(
|
||||||
|
comfyPage.page.getByText('This is a medium length description')
|
||||||
|
).toBeVisible({ timeout: 5000 })
|
||||||
|
await expect(
|
||||||
|
comfyPage.page.getByText('This is a much longer description')
|
||||||
).toBeVisible({ timeout: 5000 })
|
).toBeVisible({ timeout: 5000 })
|
||||||
|
|
||||||
// Verify all three cards with different descriptions are visible
|
// Take snapshot of a grid with specific cards
|
||||||
const shortDescCard = comfyPage.page.locator(
|
const templateGrid = comfyPage.templates.content
|
||||||
'[data-testid="template-workflow-short-description"]'
|
.locator('.grid:has-text("Short Description")')
|
||||||
)
|
.first()
|
||||||
const mediumDescCard = comfyPage.page.locator(
|
|
||||||
'[data-testid="template-workflow-medium-description"]'
|
|
||||||
)
|
|
||||||
const longDescCard = comfyPage.page.locator(
|
|
||||||
'[data-testid="template-workflow-long-description"]'
|
|
||||||
)
|
|
||||||
|
|
||||||
await expect(shortDescCard).toBeVisible()
|
|
||||||
await expect(mediumDescCard).toBeVisible()
|
|
||||||
await expect(longDescCard).toBeVisible()
|
|
||||||
|
|
||||||
// Verify descriptions are visible and have line-clamp class
|
|
||||||
// The description is in a p tag with text-muted class
|
|
||||||
const shortDesc = shortDescCard.locator('p.text-muted.line-clamp-2')
|
|
||||||
const mediumDesc = mediumDescCard.locator('p.text-muted.line-clamp-2')
|
|
||||||
const longDesc = longDescCard.locator('p.text-muted.line-clamp-2')
|
|
||||||
|
|
||||||
await expect(shortDesc).toContainText('short description')
|
|
||||||
await expect(mediumDesc).toContainText('medium length description')
|
|
||||||
await expect(longDesc).toContainText('much longer description')
|
|
||||||
|
|
||||||
// Verify grid layout maintains consistency
|
|
||||||
const templateGrid = comfyPage.page.locator(
|
|
||||||
'[data-testid="template-workflows-content"]'
|
|
||||||
)
|
|
||||||
await expect(templateGrid).toBeVisible()
|
await expect(templateGrid).toBeVisible()
|
||||||
await expect(templateGrid).toHaveScreenshot(
|
await expect(templateGrid).toHaveScreenshot(
|
||||||
'template-grid-varying-content.png'
|
'template-grid-varying-content.png'
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 93 KiB After Width: | Height: | Size: 81 KiB |
|
Before Width: | Height: | Size: 98 KiB After Width: | Height: | Size: 77 KiB |
|
Before Width: | Height: | Size: 68 KiB After Width: | Height: | Size: 68 KiB |
@@ -2,10 +2,6 @@ import { expect } from '@playwright/test'
|
|||||||
|
|
||||||
import { comfyPageFixture as test } from '../fixtures/ComfyPage'
|
import { comfyPageFixture as test } from '../fixtures/ComfyPage'
|
||||||
|
|
||||||
test.beforeEach(async ({ comfyPage }) => {
|
|
||||||
await comfyPage.setSetting('Comfy.UseNewMenu', 'Disabled')
|
|
||||||
})
|
|
||||||
|
|
||||||
test.describe('Settings Search functionality', () => {
|
test.describe('Settings Search functionality', () => {
|
||||||
test.beforeEach(async ({ comfyPage }) => {
|
test.beforeEach(async ({ comfyPage }) => {
|
||||||
// Register test settings to verify hidden/deprecated filtering
|
// Register test settings to verify hidden/deprecated filtering
|
||||||
|
|||||||
@@ -85,7 +85,6 @@ test.describe('Version Mismatch Warnings', () => {
|
|||||||
test('should persist dismissed state across sessions', async ({
|
test('should persist dismissed state across sessions', async ({
|
||||||
comfyPage
|
comfyPage
|
||||||
}) => {
|
}) => {
|
||||||
test.setTimeout(30_000)
|
|
||||||
// Mock system_stats route to indicate that the installed version is always ahead of the required version
|
// Mock system_stats route to indicate that the installed version is always ahead of the required version
|
||||||
await comfyPage.page.route('**/system_stats**', async (route) => {
|
await comfyPage.page.route('**/system_stats**', async (route) => {
|
||||||
await route.fulfill({
|
await route.fulfill({
|
||||||
@@ -107,11 +106,6 @@ test.describe('Version Mismatch Warnings', () => {
|
|||||||
const dismissButton = warningToast.getByRole('button', { name: 'Close' })
|
const dismissButton = warningToast.getByRole('button', { name: 'Close' })
|
||||||
await dismissButton.click()
|
await dismissButton.click()
|
||||||
|
|
||||||
// Wait for the dismissed state to be persisted
|
|
||||||
await comfyPage.page.waitForFunction(
|
|
||||||
() => !!localStorage.getItem('comfy.versionMismatch.dismissals')
|
|
||||||
)
|
|
||||||
|
|
||||||
// Reload the page, keeping local storage
|
// Reload the page, keeping local storage
|
||||||
await comfyPage.setup({ clearStorage: false })
|
await comfyPage.setup({ clearStorage: false })
|
||||||
|
|
||||||
|
|||||||
@@ -1,20 +1,67 @@
|
|||||||
import {
|
import {
|
||||||
comfyExpect as expect,
|
comfyExpect as expect,
|
||||||
comfyPageFixture as test
|
comfyPageFixture as test
|
||||||
} from '../../../fixtures/ComfyPage'
|
} from '../../fixtures/ComfyPage'
|
||||||
import { VueNodeFixture } from '../../../fixtures/utils/vueNodeFixtures'
|
import { VueNodeFixture } from '../../fixtures/utils/vueNodeFixtures'
|
||||||
|
|
||||||
test.describe('Vue Node Collapse', () => {
|
test.describe('NodeHeader', () => {
|
||||||
test.beforeEach(async ({ comfyPage }) => {
|
test.beforeEach(async ({ comfyPage }) => {
|
||||||
|
await comfyPage.setSetting('Comfy.UseNewMenu', 'Top')
|
||||||
await comfyPage.setSetting('Comfy.Graph.CanvasMenu', false)
|
await comfyPage.setSetting('Comfy.Graph.CanvasMenu', false)
|
||||||
await comfyPage.setSetting('Comfy.EnableTooltips', true)
|
await comfyPage.setSetting('Comfy.EnableTooltips', true)
|
||||||
await comfyPage.setSetting('Comfy.VueNodes.Enabled', true)
|
await comfyPage.setSetting('Comfy.VueNodes.Enabled', true)
|
||||||
await comfyPage.setup()
|
await comfyPage.setup()
|
||||||
})
|
})
|
||||||
|
|
||||||
test('should allow collapsing node with collapse icon', async ({
|
test('displays node title', async ({ comfyPage }) => {
|
||||||
comfyPage
|
// Get the KSampler node from the default workflow
|
||||||
}) => {
|
const nodes = await comfyPage.getNodeRefsByType('KSampler')
|
||||||
|
expect(nodes.length).toBeGreaterThanOrEqual(1)
|
||||||
|
|
||||||
|
const node = nodes[0]
|
||||||
|
const vueNode = new VueNodeFixture(node, comfyPage.page)
|
||||||
|
|
||||||
|
const title = await vueNode.getTitle()
|
||||||
|
expect(title).toBe('KSampler')
|
||||||
|
|
||||||
|
// Verify title is visible in the header
|
||||||
|
const header = await vueNode.getHeader()
|
||||||
|
await expect(header).toContainText('KSampler')
|
||||||
|
})
|
||||||
|
|
||||||
|
test('allows title renaming', async ({ comfyPage }) => {
|
||||||
|
const nodes = await comfyPage.getNodeRefsByType('KSampler')
|
||||||
|
const node = nodes[0]
|
||||||
|
const vueNode = new VueNodeFixture(node, comfyPage.page)
|
||||||
|
|
||||||
|
// Test renaming with Enter
|
||||||
|
await vueNode.setTitle('My Custom Sampler')
|
||||||
|
const newTitle = await vueNode.getTitle()
|
||||||
|
expect(newTitle).toBe('My Custom Sampler')
|
||||||
|
|
||||||
|
// Verify the title is displayed
|
||||||
|
const header = await vueNode.getHeader()
|
||||||
|
await expect(header).toContainText('My Custom Sampler')
|
||||||
|
|
||||||
|
// Test cancel with Escape
|
||||||
|
const titleElement = await vueNode.getTitleElement()
|
||||||
|
await titleElement.dblclick()
|
||||||
|
await comfyPage.nextFrame()
|
||||||
|
|
||||||
|
// Type a different value but cancel
|
||||||
|
const input = (await vueNode.getHeader()).locator(
|
||||||
|
'[data-testid="node-title-input"]'
|
||||||
|
)
|
||||||
|
await input.fill('This Should Be Cancelled')
|
||||||
|
await input.press('Escape')
|
||||||
|
await comfyPage.nextFrame()
|
||||||
|
|
||||||
|
// Title should remain as the previously saved value
|
||||||
|
const titleAfterCancel = await vueNode.getTitle()
|
||||||
|
expect(titleAfterCancel).toBe('My Custom Sampler')
|
||||||
|
})
|
||||||
|
|
||||||
|
test('handles node collapsing', async ({ comfyPage }) => {
|
||||||
// Get the KSampler node from the default workflow
|
// Get the KSampler node from the default workflow
|
||||||
const nodes = await comfyPage.getNodeRefsByType('KSampler')
|
const nodes = await comfyPage.getNodeRefsByType('KSampler')
|
||||||
const node = nodes[0]
|
const node = nodes[0]
|
||||||
@@ -43,7 +90,7 @@ test.describe('Vue Node Collapse', () => {
|
|||||||
expect(expandedSize.height).toBeGreaterThanOrEqual(collapsedSize.height)
|
expect(expandedSize.height).toBeGreaterThanOrEqual(collapsedSize.height)
|
||||||
})
|
})
|
||||||
|
|
||||||
test('should show collapse/expand icon state', async ({ comfyPage }) => {
|
test('shows collapse/expand icon state', async ({ comfyPage }) => {
|
||||||
const nodes = await comfyPage.getNodeRefsByType('KSampler')
|
const nodes = await comfyPage.getNodeRefsByType('KSampler')
|
||||||
const node = nodes[0]
|
const node = nodes[0]
|
||||||
const vueNode = new VueNodeFixture(node, comfyPage.page)
|
const vueNode = new VueNodeFixture(node, comfyPage.page)
|
||||||
@@ -63,9 +110,7 @@ test.describe('Vue Node Collapse', () => {
|
|||||||
expect(iconClass).toContain('pi-chevron-down')
|
expect(iconClass).toContain('pi-chevron-down')
|
||||||
})
|
})
|
||||||
|
|
||||||
test('should preserve title when collapsing/expanding', async ({
|
test('preserves title when collapsing/expanding', async ({ comfyPage }) => {
|
||||||
comfyPage
|
|
||||||
}) => {
|
|
||||||
const nodes = await comfyPage.getNodeRefsByType('KSampler')
|
const nodes = await comfyPage.getNodeRefsByType('KSampler')
|
||||||
const node = nodes[0]
|
const node = nodes[0]
|
||||||
const vueNode = new VueNodeFixture(node, comfyPage.page)
|
const vueNode = new VueNodeFixture(node, comfyPage.page)
|
||||||
@@ -1,10 +1,6 @@
|
|||||||
import { expect } from '@playwright/test'
|
import { expect } from '@playwright/test'
|
||||||
|
|
||||||
import { comfyPageFixture as test } from '../../../../fixtures/ComfyPage'
|
import { comfyPageFixture as test } from '../../fixtures/ComfyPage'
|
||||||
|
|
||||||
test.beforeEach(async ({ comfyPage }) => {
|
|
||||||
await comfyPage.setSetting('Comfy.UseNewMenu', 'Disabled')
|
|
||||||
})
|
|
||||||
|
|
||||||
test.describe('Vue Nodes - Delete Key Interaction', () => {
|
test.describe('Vue Nodes - Delete Key Interaction', () => {
|
||||||
test.beforeEach(async ({ comfyPage }) => {
|
test.beforeEach(async ({ comfyPage }) => {
|
||||||
@@ -1,33 +0,0 @@
|
|||||||
import {
|
|
||||||
comfyExpect as expect,
|
|
||||||
comfyPageFixture as test
|
|
||||||
} from '../../../fixtures/ComfyPage'
|
|
||||||
|
|
||||||
const CREATE_GROUP_HOTKEY = 'Control+g'
|
|
||||||
|
|
||||||
test.describe('Vue Node Groups', () => {
|
|
||||||
test.beforeEach(async ({ comfyPage }) => {
|
|
||||||
await comfyPage.setSetting('Comfy.VueNodes.Enabled', true)
|
|
||||||
await comfyPage.vueNodes.waitForNodes()
|
|
||||||
})
|
|
||||||
|
|
||||||
test('should allow creating groups with hotkey', async ({ comfyPage }) => {
|
|
||||||
await comfyPage.page.getByText('Load Checkpoint').click()
|
|
||||||
await comfyPage.page.getByText('KSampler').click({ modifiers: ['Control'] })
|
|
||||||
await comfyPage.page.keyboard.press(CREATE_GROUP_HOTKEY)
|
|
||||||
await expect(comfyPage.canvas).toHaveScreenshot(
|
|
||||||
'vue-groups-create-group.png'
|
|
||||||
)
|
|
||||||
})
|
|
||||||
|
|
||||||
test('should allow fitting group to contents', async ({ comfyPage }) => {
|
|
||||||
await comfyPage.setup()
|
|
||||||
await comfyPage.loadWorkflow('groups/oversized_group')
|
|
||||||
await comfyPage.ctrlA()
|
|
||||||
await comfyPage.executeCommand('Comfy.Graph.FitGroupToContents')
|
|
||||||
await comfyPage.nextFrame()
|
|
||||||
await expect(comfyPage.canvas).toHaveScreenshot(
|
|
||||||
'vue-groups-fit-to-contents.png'
|
|
||||||
)
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
Before Width: | Height: | Size: 95 KiB |
|
Before Width: | Height: | Size: 47 KiB |
@@ -1,18 +0,0 @@
|
|||||||
import {
|
|
||||||
comfyExpect as expect,
|
|
||||||
comfyPageFixture as test
|
|
||||||
} from '../../../../fixtures/ComfyPage'
|
|
||||||
|
|
||||||
test.describe('Vue Nodes Canvas Pan', () => {
|
|
||||||
test.beforeEach(async ({ comfyPage }) => {
|
|
||||||
await comfyPage.setSetting('Comfy.VueNodes.Enabled', true)
|
|
||||||
await comfyPage.vueNodes.waitForNodes()
|
|
||||||
})
|
|
||||||
|
|
||||||
test('@mobile Can pan with touch', async ({ comfyPage }) => {
|
|
||||||
await comfyPage.panWithTouch({ x: 64, y: 64 }, { x: 256, y: 256 })
|
|
||||||
await expect(comfyPage.canvas).toHaveScreenshot(
|
|
||||||
'vue-nodes-paned-with-touch.png'
|
|
||||||
)
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
Before Width: | Height: | Size: 10 KiB |
@@ -1,33 +0,0 @@
|
|||||||
import {
|
|
||||||
comfyExpect as expect,
|
|
||||||
comfyPageFixture as test
|
|
||||||
} from '../../../../fixtures/ComfyPage'
|
|
||||||
|
|
||||||
test.describe('Vue Nodes Zoom', () => {
|
|
||||||
test.beforeEach(async ({ comfyPage }) => {
|
|
||||||
await comfyPage.setSetting('Comfy.VueNodes.Enabled', true)
|
|
||||||
await comfyPage.vueNodes.waitForNodes()
|
|
||||||
})
|
|
||||||
|
|
||||||
test('should not capture drag while zooming with ctrl+shift+drag', async ({
|
|
||||||
comfyPage
|
|
||||||
}) => {
|
|
||||||
const checkpointNode = comfyPage.vueNodes.getNodeByTitle('Load Checkpoint')
|
|
||||||
const nodeBoundingBox = await checkpointNode.boundingBox()
|
|
||||||
if (!nodeBoundingBox) throw new Error('Node bounding box not available')
|
|
||||||
|
|
||||||
const nodeMidpointX = nodeBoundingBox.x + nodeBoundingBox.width / 2
|
|
||||||
const nodeMidpointY = nodeBoundingBox.y + nodeBoundingBox.height / 2
|
|
||||||
|
|
||||||
// Start the Ctrl+Shift drag-to-zoom on the canvas and continue dragging over
|
|
||||||
// the node. The node should not capture the drag while drag-zooming.
|
|
||||||
await comfyPage.page.keyboard.down('Control')
|
|
||||||
await comfyPage.page.keyboard.down('Shift')
|
|
||||||
await comfyPage.dragAndDrop(
|
|
||||||
{ x: 200, y: 300 },
|
|
||||||
{ x: nodeMidpointX, y: nodeMidpointY }
|
|
||||||
)
|
|
||||||
|
|
||||||
await expect(comfyPage.canvas).toHaveScreenshot('zoomed-in-ctrl-shift.png')
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
Before Width: | Height: | Size: 15 KiB |
@@ -1,696 +0,0 @@
|
|||||||
import type { Locator, Page } from '@playwright/test'
|
|
||||||
|
|
||||||
import type { NodeId } from '../../../../../src/platform/workflow/validation/schemas/workflowSchema'
|
|
||||||
import { getSlotKey } from '../../../../../src/renderer/core/layout/slots/slotIdentifier'
|
|
||||||
import {
|
|
||||||
comfyExpect as expect,
|
|
||||||
comfyPageFixture as test
|
|
||||||
} from '../../../../fixtures/ComfyPage'
|
|
||||||
import { getMiddlePoint } from '../../../../fixtures/utils/litegraphUtils'
|
|
||||||
import { fitToViewInstant } from '../../../../helpers/fitToView'
|
|
||||||
|
|
||||||
async function getCenter(locator: Locator): Promise<{ x: number; y: number }> {
|
|
||||||
const box = await locator.boundingBox()
|
|
||||||
if (!box) throw new Error('Slot bounding box not available')
|
|
||||||
return {
|
|
||||||
x: box.x + box.width / 2,
|
|
||||||
y: box.y + box.height / 2
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
async function getInputLinkDetails(
|
|
||||||
page: Page,
|
|
||||||
nodeId: NodeId,
|
|
||||||
slotIndex: number
|
|
||||||
) {
|
|
||||||
return await page.evaluate(
|
|
||||||
([targetNodeId, targetSlot]) => {
|
|
||||||
const app = window['app']
|
|
||||||
const graph = app?.canvas?.graph ?? app?.graph
|
|
||||||
if (!graph) return null
|
|
||||||
|
|
||||||
const node = graph.getNodeById(targetNodeId)
|
|
||||||
if (!node) return null
|
|
||||||
|
|
||||||
const input = node.inputs?.[targetSlot]
|
|
||||||
if (!input) return null
|
|
||||||
|
|
||||||
const linkId = input.link
|
|
||||||
if (linkId == null) return null
|
|
||||||
|
|
||||||
const link = graph.getLink?.(linkId)
|
|
||||||
if (!link) return null
|
|
||||||
|
|
||||||
return {
|
|
||||||
id: link.id,
|
|
||||||
originId: link.origin_id,
|
|
||||||
originSlot:
|
|
||||||
typeof link.origin_slot === 'string'
|
|
||||||
? Number.parseInt(link.origin_slot, 10)
|
|
||||||
: link.origin_slot,
|
|
||||||
targetId: link.target_id,
|
|
||||||
targetSlot:
|
|
||||||
typeof link.target_slot === 'string'
|
|
||||||
? Number.parseInt(link.target_slot, 10)
|
|
||||||
: link.target_slot,
|
|
||||||
parentId: link.parentId ?? null
|
|
||||||
}
|
|
||||||
},
|
|
||||||
[nodeId, slotIndex] as const
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Test helpers to reduce repetition across cases
|
|
||||||
function slotLocator(
|
|
||||||
page: Page,
|
|
||||||
nodeId: NodeId,
|
|
||||||
slotIndex: number,
|
|
||||||
isInput: boolean
|
|
||||||
) {
|
|
||||||
const key = getSlotKey(String(nodeId), slotIndex, isInput)
|
|
||||||
return page.locator(`[data-slot-key="${key}"]`)
|
|
||||||
}
|
|
||||||
|
|
||||||
async function expectVisibleAll(...locators: Locator[]) {
|
|
||||||
await Promise.all(locators.map((l) => expect(l).toBeVisible()))
|
|
||||||
}
|
|
||||||
|
|
||||||
async function getSlotCenter(
|
|
||||||
page: Page,
|
|
||||||
nodeId: NodeId,
|
|
||||||
slotIndex: number,
|
|
||||||
isInput: boolean
|
|
||||||
) {
|
|
||||||
const locator = slotLocator(page, nodeId, slotIndex, isInput)
|
|
||||||
await expect(locator).toBeVisible()
|
|
||||||
return await getCenter(locator)
|
|
||||||
}
|
|
||||||
|
|
||||||
async function connectSlots(
|
|
||||||
page: Page,
|
|
||||||
from: { nodeId: NodeId; index: number },
|
|
||||||
to: { nodeId: NodeId; index: number },
|
|
||||||
nextFrame: () => Promise<void>
|
|
||||||
) {
|
|
||||||
const fromLoc = slotLocator(page, from.nodeId, from.index, false)
|
|
||||||
const toLoc = slotLocator(page, to.nodeId, to.index, true)
|
|
||||||
await expectVisibleAll(fromLoc, toLoc)
|
|
||||||
await fromLoc.dragTo(toLoc)
|
|
||||||
await nextFrame()
|
|
||||||
}
|
|
||||||
|
|
||||||
test.describe('Vue Node Link Interaction', () => {
|
|
||||||
test.beforeEach(async ({ comfyPage }) => {
|
|
||||||
await comfyPage.setSetting('Comfy.UseNewMenu', 'Top')
|
|
||||||
await comfyPage.setSetting('Comfy.VueNodes.Enabled', true)
|
|
||||||
await comfyPage.setup()
|
|
||||||
await comfyPage.loadWorkflow('vueNodes/simple-triple')
|
|
||||||
await comfyPage.vueNodes.waitForNodes()
|
|
||||||
await fitToViewInstant(comfyPage)
|
|
||||||
})
|
|
||||||
|
|
||||||
test('should show a link dragging out from a slot when dragging on a slot', async ({
|
|
||||||
comfyPage,
|
|
||||||
comfyMouse
|
|
||||||
}) => {
|
|
||||||
const samplerNode = (await comfyPage.getNodeRefsByType('KSampler'))[0]
|
|
||||||
expect(samplerNode).toBeTruthy()
|
|
||||||
|
|
||||||
const slot = slotLocator(comfyPage.page, samplerNode.id, 0, false)
|
|
||||||
await expect(slot).toBeVisible()
|
|
||||||
|
|
||||||
const start = await getCenter(slot)
|
|
||||||
|
|
||||||
// Arbitrary value
|
|
||||||
const dragTarget = {
|
|
||||||
x: start.x + 180,
|
|
||||||
y: start.y - 140
|
|
||||||
}
|
|
||||||
|
|
||||||
await comfyMouse.move(start)
|
|
||||||
await comfyMouse.drag(dragTarget)
|
|
||||||
await comfyPage.nextFrame()
|
|
||||||
|
|
||||||
try {
|
|
||||||
await expect(comfyPage.canvas).toHaveScreenshot(
|
|
||||||
'vue-node-dragging-link.png'
|
|
||||||
)
|
|
||||||
} finally {
|
|
||||||
await comfyMouse.drop()
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
test('should create a link when dropping on a compatible slot', async ({
|
|
||||||
comfyPage
|
|
||||||
}) => {
|
|
||||||
const samplerNode = (await comfyPage.getNodeRefsByType('KSampler'))[0]
|
|
||||||
const vaeNode = (await comfyPage.getNodeRefsByType('VAEDecode'))[0]
|
|
||||||
expect(samplerNode && vaeNode).toBeTruthy()
|
|
||||||
|
|
||||||
const samplerOutput = await samplerNode.getOutput(0)
|
|
||||||
const vaeInput = await vaeNode.getInput(0)
|
|
||||||
|
|
||||||
await connectSlots(
|
|
||||||
comfyPage.page,
|
|
||||||
{ nodeId: samplerNode.id, index: 0 },
|
|
||||||
{ nodeId: vaeNode.id, index: 0 },
|
|
||||||
() => comfyPage.nextFrame()
|
|
||||||
)
|
|
||||||
|
|
||||||
expect(await samplerOutput.getLinkCount()).toBe(1)
|
|
||||||
expect(await vaeInput.getLinkCount()).toBe(1)
|
|
||||||
|
|
||||||
const linkDetails = await getInputLinkDetails(comfyPage.page, vaeNode.id, 0)
|
|
||||||
expect(linkDetails).not.toBeNull()
|
|
||||||
expect(linkDetails).toMatchObject({
|
|
||||||
originId: samplerNode.id,
|
|
||||||
originSlot: 0,
|
|
||||||
targetId: vaeNode.id,
|
|
||||||
targetSlot: 0
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
test('should not create a link when slot types are incompatible', async ({
|
|
||||||
comfyPage
|
|
||||||
}) => {
|
|
||||||
const samplerNode = (await comfyPage.getNodeRefsByType('KSampler'))[0]
|
|
||||||
const clipNode = (await comfyPage.getNodeRefsByType('CLIPTextEncode'))[0]
|
|
||||||
expect(samplerNode && clipNode).toBeTruthy()
|
|
||||||
|
|
||||||
const samplerOutput = await samplerNode.getOutput(0)
|
|
||||||
const clipInput = await clipNode.getInput(0)
|
|
||||||
|
|
||||||
const outputSlot = slotLocator(comfyPage.page, samplerNode.id, 0, false)
|
|
||||||
const inputSlot = slotLocator(comfyPage.page, clipNode.id, 0, true)
|
|
||||||
await expectVisibleAll(outputSlot, inputSlot)
|
|
||||||
|
|
||||||
await outputSlot.dragTo(inputSlot)
|
|
||||||
await comfyPage.nextFrame()
|
|
||||||
|
|
||||||
expect(await samplerOutput.getLinkCount()).toBe(0)
|
|
||||||
expect(await clipInput.getLinkCount()).toBe(0)
|
|
||||||
|
|
||||||
const graphLinkDetails = await getInputLinkDetails(
|
|
||||||
comfyPage.page,
|
|
||||||
clipNode.id,
|
|
||||||
0
|
|
||||||
)
|
|
||||||
expect(graphLinkDetails).toBeNull()
|
|
||||||
})
|
|
||||||
|
|
||||||
test('should not create a link when dropping onto a slot on the same node', async ({
|
|
||||||
comfyPage
|
|
||||||
}) => {
|
|
||||||
const samplerNode = (await comfyPage.getNodeRefsByType('KSampler'))[0]
|
|
||||||
expect(samplerNode).toBeTruthy()
|
|
||||||
|
|
||||||
const samplerOutput = await samplerNode.getOutput(0)
|
|
||||||
const samplerInput = await samplerNode.getInput(3)
|
|
||||||
|
|
||||||
const outputSlot = slotLocator(comfyPage.page, samplerNode.id, 0, false)
|
|
||||||
const inputSlot = slotLocator(comfyPage.page, samplerNode.id, 3, true)
|
|
||||||
await expectVisibleAll(outputSlot, inputSlot)
|
|
||||||
|
|
||||||
await outputSlot.dragTo(inputSlot)
|
|
||||||
await comfyPage.nextFrame()
|
|
||||||
|
|
||||||
expect(await samplerOutput.getLinkCount()).toBe(0)
|
|
||||||
expect(await samplerInput.getLinkCount()).toBe(0)
|
|
||||||
})
|
|
||||||
|
|
||||||
test('should reuse the existing origin when dragging an input link', async ({
|
|
||||||
comfyPage,
|
|
||||||
comfyMouse
|
|
||||||
}) => {
|
|
||||||
const samplerNode = (await comfyPage.getNodeRefsByType('KSampler'))[0]
|
|
||||||
const vaeNode = (await comfyPage.getNodeRefsByType('VAEDecode'))[0]
|
|
||||||
expect(samplerNode && vaeNode).toBeTruthy()
|
|
||||||
const samplerOutputCenter = await getSlotCenter(
|
|
||||||
comfyPage.page,
|
|
||||||
samplerNode.id,
|
|
||||||
0,
|
|
||||||
false
|
|
||||||
)
|
|
||||||
const vaeInputCenter = await getSlotCenter(
|
|
||||||
comfyPage.page,
|
|
||||||
vaeNode.id,
|
|
||||||
0,
|
|
||||||
true
|
|
||||||
)
|
|
||||||
|
|
||||||
await comfyMouse.move(samplerOutputCenter)
|
|
||||||
await comfyMouse.drag(vaeInputCenter)
|
|
||||||
await comfyMouse.drop()
|
|
||||||
|
|
||||||
const dragTarget = {
|
|
||||||
x: vaeInputCenter.x + 160,
|
|
||||||
y: vaeInputCenter.y - 100
|
|
||||||
}
|
|
||||||
|
|
||||||
await comfyMouse.move(vaeInputCenter)
|
|
||||||
await comfyMouse.drag(dragTarget)
|
|
||||||
await expect(comfyPage.canvas).toHaveScreenshot(
|
|
||||||
'vue-node-input-drag-reuses-origin.png'
|
|
||||||
)
|
|
||||||
await comfyMouse.drop()
|
|
||||||
})
|
|
||||||
|
|
||||||
test('ctrl+alt drag from an input starts a fresh link', async ({
|
|
||||||
comfyPage,
|
|
||||||
comfyMouse
|
|
||||||
}) => {
|
|
||||||
const samplerNode = (await comfyPage.getNodeRefsByType('KSampler'))[0]
|
|
||||||
const vaeNode = (await comfyPage.getNodeRefsByType('VAEDecode'))[0]
|
|
||||||
expect(samplerNode && vaeNode).toBeTruthy()
|
|
||||||
|
|
||||||
const samplerOutput = await samplerNode.getOutput(0)
|
|
||||||
const vaeInput = await vaeNode.getInput(0)
|
|
||||||
|
|
||||||
const samplerOutputCenter = await getSlotCenter(
|
|
||||||
comfyPage.page,
|
|
||||||
samplerNode.id,
|
|
||||||
0,
|
|
||||||
false
|
|
||||||
)
|
|
||||||
const vaeInputCenter = await getSlotCenter(
|
|
||||||
comfyPage.page,
|
|
||||||
vaeNode.id,
|
|
||||||
0,
|
|
||||||
true
|
|
||||||
)
|
|
||||||
|
|
||||||
await comfyMouse.move(samplerOutputCenter)
|
|
||||||
await comfyMouse.drag(vaeInputCenter)
|
|
||||||
await comfyMouse.drop()
|
|
||||||
|
|
||||||
await comfyPage.nextFrame()
|
|
||||||
|
|
||||||
const dragTarget = {
|
|
||||||
x: vaeInputCenter.x + 140,
|
|
||||||
y: vaeInputCenter.y - 110
|
|
||||||
}
|
|
||||||
|
|
||||||
await comfyMouse.move(vaeInputCenter)
|
|
||||||
await comfyPage.page.keyboard.down('Control')
|
|
||||||
await comfyPage.page.keyboard.down('Alt')
|
|
||||||
|
|
||||||
try {
|
|
||||||
await comfyMouse.drag(dragTarget)
|
|
||||||
await expect(comfyPage.canvas).toHaveScreenshot(
|
|
||||||
'vue-node-input-drag-ctrl-alt.png'
|
|
||||||
)
|
|
||||||
} finally {
|
|
||||||
await comfyMouse.drop().catch(() => {})
|
|
||||||
await comfyPage.page.keyboard.up('Alt').catch(() => {})
|
|
||||||
await comfyPage.page.keyboard.up('Control').catch(() => {})
|
|
||||||
}
|
|
||||||
|
|
||||||
await comfyPage.nextFrame()
|
|
||||||
|
|
||||||
// Tcehnically intended to disconnect existing as well
|
|
||||||
expect(await vaeInput.getLinkCount()).toBe(0)
|
|
||||||
expect(await samplerOutput.getLinkCount()).toBe(0)
|
|
||||||
})
|
|
||||||
|
|
||||||
test('dropping an input link back on its slot restores the original connection', async ({
|
|
||||||
comfyPage,
|
|
||||||
comfyMouse
|
|
||||||
}) => {
|
|
||||||
const samplerNode = (await comfyPage.getNodeRefsByType('KSampler'))[0]
|
|
||||||
const vaeNode = (await comfyPage.getNodeRefsByType('VAEDecode'))[0]
|
|
||||||
expect(samplerNode && vaeNode).toBeTruthy()
|
|
||||||
|
|
||||||
const samplerOutput = await samplerNode.getOutput(0)
|
|
||||||
const vaeInput = await vaeNode.getInput(0)
|
|
||||||
|
|
||||||
const samplerOutputCenter = await getSlotCenter(
|
|
||||||
comfyPage.page,
|
|
||||||
samplerNode.id,
|
|
||||||
0,
|
|
||||||
false
|
|
||||||
)
|
|
||||||
const vaeInputCenter = await getSlotCenter(
|
|
||||||
comfyPage.page,
|
|
||||||
vaeNode.id,
|
|
||||||
0,
|
|
||||||
true
|
|
||||||
)
|
|
||||||
|
|
||||||
await comfyMouse.move(samplerOutputCenter)
|
|
||||||
try {
|
|
||||||
await comfyMouse.drag(vaeInputCenter)
|
|
||||||
} finally {
|
|
||||||
await comfyMouse.drop()
|
|
||||||
}
|
|
||||||
|
|
||||||
await comfyPage.nextFrame()
|
|
||||||
|
|
||||||
const originalLink = await getInputLinkDetails(
|
|
||||||
comfyPage.page,
|
|
||||||
vaeNode.id,
|
|
||||||
0
|
|
||||||
)
|
|
||||||
expect(originalLink).not.toBeNull()
|
|
||||||
|
|
||||||
const dragTarget = {
|
|
||||||
x: vaeInputCenter.x + 150,
|
|
||||||
y: vaeInputCenter.y - 100
|
|
||||||
}
|
|
||||||
|
|
||||||
// To prevent needing a screenshot expectation for whether the link's off
|
|
||||||
const vaeInputLocator = slotLocator(comfyPage.page, vaeNode.id, 0, true)
|
|
||||||
const inputBox = await vaeInputLocator.boundingBox()
|
|
||||||
if (!inputBox) throw new Error('Input slot bounding box not available')
|
|
||||||
const isOutsideX =
|
|
||||||
dragTarget.x < inputBox.x || dragTarget.x > inputBox.x + inputBox.width
|
|
||||||
const isOutsideY =
|
|
||||||
dragTarget.y < inputBox.y || dragTarget.y > inputBox.y + inputBox.height
|
|
||||||
expect(isOutsideX || isOutsideY).toBe(true)
|
|
||||||
|
|
||||||
await comfyMouse.move(vaeInputCenter)
|
|
||||||
await comfyMouse.drag(dragTarget)
|
|
||||||
await comfyMouse.move(vaeInputCenter)
|
|
||||||
await comfyMouse.drop()
|
|
||||||
|
|
||||||
await comfyPage.nextFrame()
|
|
||||||
|
|
||||||
const restoredLink = await getInputLinkDetails(
|
|
||||||
comfyPage.page,
|
|
||||||
vaeNode.id,
|
|
||||||
0
|
|
||||||
)
|
|
||||||
|
|
||||||
expect(restoredLink).not.toBeNull()
|
|
||||||
if (!restoredLink || !originalLink) {
|
|
||||||
throw new Error('Expected both original and restored links to exist')
|
|
||||||
}
|
|
||||||
expect(restoredLink).toMatchObject({
|
|
||||||
originId: originalLink.originId,
|
|
||||||
originSlot: originalLink.originSlot,
|
|
||||||
targetId: originalLink.targetId,
|
|
||||||
targetSlot: originalLink.targetSlot,
|
|
||||||
parentId: originalLink.parentId
|
|
||||||
})
|
|
||||||
expect(await samplerOutput.getLinkCount()).toBe(1)
|
|
||||||
expect(await vaeInput.getLinkCount()).toBe(1)
|
|
||||||
})
|
|
||||||
|
|
||||||
test('rerouted input drag preview remains anchored to reroute', async ({
|
|
||||||
comfyPage,
|
|
||||||
comfyMouse
|
|
||||||
}) => {
|
|
||||||
const samplerNode = (await comfyPage.getNodeRefsByType('KSampler'))[0]
|
|
||||||
const vaeNode = (await comfyPage.getNodeRefsByType('VAEDecode'))[0]
|
|
||||||
|
|
||||||
const samplerOutput = await samplerNode.getOutput(0)
|
|
||||||
const vaeInput = await vaeNode.getInput(0)
|
|
||||||
|
|
||||||
await connectSlots(
|
|
||||||
comfyPage.page,
|
|
||||||
{ nodeId: samplerNode.id, index: 0 },
|
|
||||||
{ nodeId: vaeNode.id, index: 0 },
|
|
||||||
() => comfyPage.nextFrame()
|
|
||||||
)
|
|
||||||
|
|
||||||
const outputPosition = await samplerOutput.getPosition()
|
|
||||||
const inputPosition = await vaeInput.getPosition()
|
|
||||||
const reroutePoint = getMiddlePoint(outputPosition, inputPosition)
|
|
||||||
|
|
||||||
// Insert a reroute programmatically on the existing link between sampler output[0] and VAE input[0].
|
|
||||||
// This avoids relying on an exact path hit-test position.
|
|
||||||
await comfyPage.page.evaluate(
|
|
||||||
([targetNodeId, targetSlot, clientPoint]) => {
|
|
||||||
const app = (window as any)['app']
|
|
||||||
const graph = app?.canvas?.graph ?? app?.graph
|
|
||||||
if (!graph) throw new Error('Graph not available')
|
|
||||||
const node = graph.getNodeById(targetNodeId)
|
|
||||||
if (!node) throw new Error('Target node not found')
|
|
||||||
const input = node.inputs?.[targetSlot]
|
|
||||||
if (!input) throw new Error('Target input slot not found')
|
|
||||||
|
|
||||||
const linkId = input.link
|
|
||||||
if (linkId == null) throw new Error('Expected existing link on input')
|
|
||||||
const link = graph.getLink(linkId)
|
|
||||||
if (!link) throw new Error('Link not found')
|
|
||||||
|
|
||||||
// Convert the client/canvas pixel coordinates to graph space
|
|
||||||
const pos = app.canvas.ds.convertCanvasToOffset([
|
|
||||||
clientPoint.x,
|
|
||||||
clientPoint.y
|
|
||||||
])
|
|
||||||
graph.createReroute(pos, link)
|
|
||||||
},
|
|
||||||
[vaeNode.id, 0, reroutePoint] as const
|
|
||||||
)
|
|
||||||
|
|
||||||
await comfyPage.nextFrame()
|
|
||||||
|
|
||||||
const vaeInputCenter = await getSlotCenter(
|
|
||||||
comfyPage.page,
|
|
||||||
vaeNode.id,
|
|
||||||
0,
|
|
||||||
true
|
|
||||||
)
|
|
||||||
const dragTarget = {
|
|
||||||
x: vaeInputCenter.x + 160,
|
|
||||||
y: vaeInputCenter.y - 120
|
|
||||||
}
|
|
||||||
|
|
||||||
let dropped = false
|
|
||||||
try {
|
|
||||||
await comfyMouse.move(vaeInputCenter)
|
|
||||||
await comfyMouse.drag(dragTarget)
|
|
||||||
await expect(comfyPage.canvas).toHaveScreenshot(
|
|
||||||
'vue-node-reroute-input-drag.png'
|
|
||||||
)
|
|
||||||
await comfyMouse.move(vaeInputCenter)
|
|
||||||
await comfyMouse.drop()
|
|
||||||
dropped = true
|
|
||||||
} finally {
|
|
||||||
if (!dropped) {
|
|
||||||
await comfyMouse.drop().catch(() => {})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
await comfyPage.nextFrame()
|
|
||||||
|
|
||||||
const linkDetails = await getInputLinkDetails(comfyPage.page, vaeNode.id, 0)
|
|
||||||
expect(linkDetails).not.toBeNull()
|
|
||||||
expect(linkDetails?.originId).toBe(samplerNode.id)
|
|
||||||
expect(linkDetails?.parentId).not.toBeNull()
|
|
||||||
})
|
|
||||||
|
|
||||||
test('rerouted output shift-drag preview remains anchored to reroute', async ({
|
|
||||||
comfyPage,
|
|
||||||
comfyMouse
|
|
||||||
}) => {
|
|
||||||
const samplerNode = (await comfyPage.getNodeRefsByType('KSampler'))[0]
|
|
||||||
const vaeNode = (await comfyPage.getNodeRefsByType('VAEDecode'))[0]
|
|
||||||
expect(samplerNode && vaeNode).toBeTruthy()
|
|
||||||
|
|
||||||
const samplerOutput = await samplerNode.getOutput(0)
|
|
||||||
const vaeInput = await vaeNode.getInput(0)
|
|
||||||
|
|
||||||
await connectSlots(
|
|
||||||
comfyPage.page,
|
|
||||||
{ nodeId: samplerNode.id, index: 0 },
|
|
||||||
{ nodeId: vaeNode.id, index: 0 },
|
|
||||||
() => comfyPage.nextFrame()
|
|
||||||
)
|
|
||||||
|
|
||||||
const outputPosition = await samplerOutput.getPosition()
|
|
||||||
const inputPosition = await vaeInput.getPosition()
|
|
||||||
const reroutePoint = getMiddlePoint(outputPosition, inputPosition)
|
|
||||||
|
|
||||||
// Insert a reroute programmatically on the existing link between sampler output[0] and VAE input[0].
|
|
||||||
// This avoids relying on an exact path hit-test position.
|
|
||||||
await comfyPage.page.evaluate(
|
|
||||||
([targetNodeId, targetSlot, clientPoint]) => {
|
|
||||||
const app = (window as any)['app']
|
|
||||||
const graph = app?.canvas?.graph ?? app?.graph
|
|
||||||
if (!graph) throw new Error('Graph not available')
|
|
||||||
const node = graph.getNodeById(targetNodeId)
|
|
||||||
if (!node) throw new Error('Target node not found')
|
|
||||||
const input = node.inputs?.[targetSlot]
|
|
||||||
if (!input) throw new Error('Target input slot not found')
|
|
||||||
|
|
||||||
const linkId = input.link
|
|
||||||
if (linkId == null) throw new Error('Expected existing link on input')
|
|
||||||
const link = graph.getLink(linkId)
|
|
||||||
if (!link) throw new Error('Link not found')
|
|
||||||
|
|
||||||
// Convert the client/canvas pixel coordinates to graph space
|
|
||||||
const pos = app.canvas.ds.convertCanvasToOffset([
|
|
||||||
clientPoint.x,
|
|
||||||
clientPoint.y
|
|
||||||
])
|
|
||||||
graph.createReroute(pos, link)
|
|
||||||
},
|
|
||||||
[vaeNode.id, 0, reroutePoint] as const
|
|
||||||
)
|
|
||||||
|
|
||||||
await comfyPage.nextFrame()
|
|
||||||
|
|
||||||
const outputCenter = await getSlotCenter(
|
|
||||||
comfyPage.page,
|
|
||||||
samplerNode.id,
|
|
||||||
0,
|
|
||||||
false
|
|
||||||
)
|
|
||||||
const dragTarget = {
|
|
||||||
x: outputCenter.x + 150,
|
|
||||||
y: outputCenter.y - 140
|
|
||||||
}
|
|
||||||
|
|
||||||
let dropPending = false
|
|
||||||
let shiftHeld = false
|
|
||||||
try {
|
|
||||||
await comfyMouse.move(outputCenter)
|
|
||||||
await comfyPage.page.keyboard.down('Shift')
|
|
||||||
shiftHeld = true
|
|
||||||
dropPending = true
|
|
||||||
await comfyMouse.drag(dragTarget)
|
|
||||||
await expect(comfyPage.canvas).toHaveScreenshot(
|
|
||||||
'vue-node-reroute-output-shift-drag.png'
|
|
||||||
)
|
|
||||||
await comfyMouse.move(outputCenter)
|
|
||||||
await comfyMouse.drop()
|
|
||||||
dropPending = false
|
|
||||||
} finally {
|
|
||||||
if (dropPending) await comfyMouse.drop().catch(() => {})
|
|
||||||
if (shiftHeld) await comfyPage.page.keyboard.up('Shift').catch(() => {})
|
|
||||||
}
|
|
||||||
|
|
||||||
await comfyPage.nextFrame()
|
|
||||||
|
|
||||||
const linkDetails = await getInputLinkDetails(comfyPage.page, vaeNode.id, 0)
|
|
||||||
expect(linkDetails).not.toBeNull()
|
|
||||||
expect(linkDetails?.originId).toBe(samplerNode.id)
|
|
||||||
expect(linkDetails?.parentId).not.toBeNull()
|
|
||||||
})
|
|
||||||
|
|
||||||
test('dragging input to input drags existing link', async ({
|
|
||||||
comfyPage,
|
|
||||||
comfyMouse
|
|
||||||
}) => {
|
|
||||||
const clipNode = (await comfyPage.getNodeRefsByType('CLIPTextEncode'))[0]
|
|
||||||
const samplerNode = (await comfyPage.getNodeRefsByType('KSampler'))[0]
|
|
||||||
expect(clipNode && samplerNode).toBeTruthy()
|
|
||||||
|
|
||||||
// Step 1: Connect CLIP's only output (index 0) to KSampler's second input (index 1)
|
|
||||||
await connectSlots(
|
|
||||||
comfyPage.page,
|
|
||||||
{ nodeId: clipNode.id, index: 0 },
|
|
||||||
{ nodeId: samplerNode.id, index: 1 },
|
|
||||||
() => comfyPage.nextFrame()
|
|
||||||
)
|
|
||||||
|
|
||||||
// Verify initial link exists between CLIP -> KSampler input[1]
|
|
||||||
const initialLink = await getInputLinkDetails(
|
|
||||||
comfyPage.page,
|
|
||||||
samplerNode.id,
|
|
||||||
1
|
|
||||||
)
|
|
||||||
expect(initialLink).not.toBeNull()
|
|
||||||
expect(initialLink).toMatchObject({
|
|
||||||
originId: clipNode.id,
|
|
||||||
targetId: samplerNode.id,
|
|
||||||
targetSlot: 1
|
|
||||||
})
|
|
||||||
|
|
||||||
// Step 2: Drag from KSampler's second input to its third input (index 2)
|
|
||||||
const input2Center = await getSlotCenter(
|
|
||||||
comfyPage.page,
|
|
||||||
samplerNode.id,
|
|
||||||
1,
|
|
||||||
true
|
|
||||||
)
|
|
||||||
const input3Center = await getSlotCenter(
|
|
||||||
comfyPage.page,
|
|
||||||
samplerNode.id,
|
|
||||||
2,
|
|
||||||
true
|
|
||||||
)
|
|
||||||
|
|
||||||
await comfyMouse.move(input2Center)
|
|
||||||
await comfyMouse.drag(input3Center)
|
|
||||||
await comfyMouse.drop()
|
|
||||||
await comfyPage.nextFrame()
|
|
||||||
|
|
||||||
// Expect old link removed from input[1]
|
|
||||||
const afterSecondInput = await getInputLinkDetails(
|
|
||||||
comfyPage.page,
|
|
||||||
samplerNode.id,
|
|
||||||
1
|
|
||||||
)
|
|
||||||
expect(afterSecondInput).toBeNull()
|
|
||||||
|
|
||||||
// Expect new link exists at input[2] from CLIP
|
|
||||||
const afterThirdInput = await getInputLinkDetails(
|
|
||||||
comfyPage.page,
|
|
||||||
samplerNode.id,
|
|
||||||
2
|
|
||||||
)
|
|
||||||
expect(afterThirdInput).not.toBeNull()
|
|
||||||
expect(afterThirdInput).toMatchObject({
|
|
||||||
originId: clipNode.id,
|
|
||||||
targetId: samplerNode.id,
|
|
||||||
targetSlot: 2
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
test('shift-dragging an output with multiple links should drag all links', async ({
|
|
||||||
comfyPage,
|
|
||||||
comfyMouse
|
|
||||||
}) => {
|
|
||||||
const clipNode = (await comfyPage.getNodeRefsByType('CLIPTextEncode'))[0]
|
|
||||||
const samplerNode = (await comfyPage.getNodeRefsByType('KSampler'))[0]
|
|
||||||
expect(clipNode && samplerNode).toBeTruthy()
|
|
||||||
|
|
||||||
const clipOutput = await clipNode.getOutput(0)
|
|
||||||
|
|
||||||
// Connect output[0] -> inputs[1] and [2]
|
|
||||||
await connectSlots(
|
|
||||||
comfyPage.page,
|
|
||||||
{ nodeId: clipNode.id, index: 0 },
|
|
||||||
{ nodeId: samplerNode.id, index: 1 },
|
|
||||||
() => comfyPage.nextFrame()
|
|
||||||
)
|
|
||||||
await connectSlots(
|
|
||||||
comfyPage.page,
|
|
||||||
{ nodeId: clipNode.id, index: 0 },
|
|
||||||
{ nodeId: samplerNode.id, index: 2 },
|
|
||||||
() => comfyPage.nextFrame()
|
|
||||||
)
|
|
||||||
|
|
||||||
expect(await clipOutput.getLinkCount()).toBe(2)
|
|
||||||
|
|
||||||
const outputCenter = await getSlotCenter(
|
|
||||||
comfyPage.page,
|
|
||||||
clipNode.id,
|
|
||||||
0,
|
|
||||||
false
|
|
||||||
)
|
|
||||||
const dragTarget = {
|
|
||||||
x: outputCenter.x + 40,
|
|
||||||
y: outputCenter.y - 140
|
|
||||||
}
|
|
||||||
|
|
||||||
let dropPending = false
|
|
||||||
let shiftHeld = false
|
|
||||||
try {
|
|
||||||
await comfyMouse.move(outputCenter)
|
|
||||||
await comfyPage.page.keyboard.down('Shift')
|
|
||||||
shiftHeld = true
|
|
||||||
await comfyMouse.drag(dragTarget)
|
|
||||||
dropPending = true
|
|
||||||
|
|
||||||
await expect(comfyPage.canvas).toHaveScreenshot(
|
|
||||||
'vue-node-shift-output-multi-link.png'
|
|
||||||
)
|
|
||||||
} finally {
|
|
||||||
if (dropPending) await comfyMouse.drop().catch(() => {})
|
|
||||||
if (shiftHeld) await comfyPage.page.keyboard.up('Shift').catch(() => {})
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
Before Width: | Height: | Size: 51 KiB |
|
Before Width: | Height: | Size: 48 KiB |
|
Before Width: | Height: | Size: 49 KiB |