From 8564c0b4bfa9352635b4d420900ab05740a20131 Mon Sep 17 00:00:00 2001 From: snomiao Date: Sat, 11 Oct 2025 08:52:49 +0000 Subject: [PATCH] fix: improve error handling in Playwright tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Remove unnecessary .catch(() => {}) in userSelectView test that was hiding potential failures - Add explanatory comments for legitimate .catch(() => {}) usage in cleanup blocks of linkInteraction tests 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- browser_tests/tests/userSelectView.spec.ts | 2 +- .../tests/vueNodes/interactions/links/linkInteraction.spec.ts | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/browser_tests/tests/userSelectView.spec.ts b/browser_tests/tests/userSelectView.spec.ts index a6887c5b2..c4464e7f2 100644 --- a/browser_tests/tests/userSelectView.spec.ts +++ b/browser_tests/tests/userSelectView.spec.ts @@ -43,7 +43,7 @@ test.describe('User Select View', () => { // Try to click first option if it exists const firstOption = page.locator('.p-select-list .p-select-option').first() - await firstOption.waitFor({ state: 'visible' }).catch(() => {}) + await firstOption.waitFor({ state: 'visible', timeout: 5000 }) if ((await firstOption.count()) > 0) { await firstOption.click() diff --git a/browser_tests/tests/vueNodes/interactions/links/linkInteraction.spec.ts b/browser_tests/tests/vueNodes/interactions/links/linkInteraction.spec.ts index ebc09cf2e..219831593 100644 --- a/browser_tests/tests/vueNodes/interactions/links/linkInteraction.spec.ts +++ b/browser_tests/tests/vueNodes/interactions/links/linkInteraction.spec.ts @@ -300,6 +300,7 @@ test.describe('Vue Node Link Interaction', () => { 'vue-node-input-drag-ctrl-alt.png' ) } finally { + // Cleanup operations: silently ignore errors if state is already clean await comfyMouse.drop().catch(() => {}) await comfyPage.page.keyboard.up('Alt').catch(() => {}) await comfyPage.page.keyboard.up('Control').catch(() => {}) @@ -467,6 +468,7 @@ test.describe('Vue Node Link Interaction', () => { await comfyMouse.drop() dropped = true } finally { + // Cleanup: ensure mouse is released if drop failed if (!dropped) { await comfyMouse.drop().catch(() => {}) } @@ -557,6 +559,7 @@ test.describe('Vue Node Link Interaction', () => { await comfyMouse.drop() dropPending = false } finally { + // Cleanup: ensure mouse and keyboard are released if test fails if (dropPending) await comfyMouse.drop().catch(() => {}) if (shiftHeld) await comfyPage.page.keyboard.up('Shift').catch(() => {}) } @@ -689,6 +692,7 @@ test.describe('Vue Node Link Interaction', () => { 'vue-node-shift-output-multi-link.png' ) } finally { + // Cleanup: ensure mouse and keyboard are released if test fails if (dropPending) await comfyMouse.drop().catch(() => {}) if (shiftHeld) await comfyPage.page.keyboard.up('Shift').catch(() => {}) }