fix: bypass login in QA recordings with localStorage pre-seeding

The QA recordings were stuck on the user selection screen because CI
has no existing users. Fix by pre-seeding localStorage with userId,
userName, and TutorialCompleted before navigation, plus creating a
qa-ci user via API as a fallback.
This commit is contained in:
snomiao
2026-03-21 01:07:28 +00:00
parent 641aee03c0
commit 441263dc64
2 changed files with 56 additions and 29 deletions

View File

@@ -154,6 +154,22 @@ jobs:
done
echo "::error::Server timeout (main)"; exit 1
- name: Pre-seed settings (main)
if: needs.resolve-matrix.outputs.mode == 'focused'
shell: bash
run: |
# Create qa-ci user via API so login screen is bypassed
curl -sf -X POST http://127.0.0.1:8188/api/users \
-H 'Content-Type: application/json' \
-d '{"username":"qa-ci"}' || echo "User creation failed (may already exist)"
# Pre-seed settings to skip tutorial/template gallery
curl -sf -X POST http://127.0.0.1:8188/api/devtools/set_settings \
-H 'Content-Type: application/json' \
-d '{"Comfy.TutorialCompleted":true}' || \
curl -sf -X POST http://127.0.0.1:8188/api/settings \
-H 'Content-Type: application/json' \
-d '{"Comfy.TutorialCompleted":true}' || echo "Settings pre-seed skipped"
- name: Run BEFORE QA (main branch)
if: needs.resolve-matrix.outputs.mode == 'focused'
shell: bash
@@ -193,6 +209,19 @@ jobs:
done
echo "::error::Server timeout (PR)"; exit 1
- name: Pre-seed settings (PR)
shell: bash
run: |
curl -sf -X POST http://127.0.0.1:8188/api/users \
-H 'Content-Type: application/json' \
-d '{"username":"qa-ci"}' || echo "User creation failed (may already exist)"
curl -sf -X POST http://127.0.0.1:8188/api/devtools/set_settings \
-H 'Content-Type: application/json' \
-d '{"Comfy.TutorialCompleted":true}' || \
curl -sf -X POST http://127.0.0.1:8188/api/settings \
-H 'Content-Type: application/json' \
-d '{"Comfy.TutorialCompleted":true}' || echo "Settings pre-seed skipped"
- name: Run AFTER QA (PR branch)
shell: bash
env: