From 01a7c6ee5483c29827d1337c08649e2a6baa5feb Mon Sep 17 00:00:00 2001 From: Alexander Brown Date: Fri, 19 Dec 2025 13:12:37 -0800 Subject: [PATCH] Test: Fix templates Spec, scroll card into view (#7643) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Summary - Scroll the target card into view before clicking - Hopefully stabilize the locale check by enqueuing the check earlier in the process ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-7643-Test-Fix-templates-Spec-scroll-card-into-view-2ce6d73d36508175a009f81502f0fe16) by [Unito](https://www.unito.io) --- browser_tests/helpers/templates.ts | 7 +++---- browser_tests/tests/templates.spec.ts | 6 +++--- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/browser_tests/helpers/templates.ts b/browser_tests/helpers/templates.ts index 829837bd1..ca74096ad 100644 --- a/browser_tests/helpers/templates.ts +++ b/browser_tests/helpers/templates.ts @@ -26,10 +26,9 @@ export class ComfyTemplates { } async loadTemplate(id: string) { - await this.content - .getByTestId(`template-workflow-${id}`) - .getByRole('img') - .click() + const templateCard = this.content.getByTestId(`template-workflow-${id}`) + await templateCard.scrollIntoViewIfNeeded() + await templateCard.getByRole('img').click() } async getAllTemplates(): Promise { diff --git a/browser_tests/tests/templates.spec.ts b/browser_tests/tests/templates.spec.ts index 0e2837906..730acc749 100644 --- a/browser_tests/tests/templates.spec.ts +++ b/browser_tests/tests/templates.spec.ts @@ -109,14 +109,14 @@ test.describe('Templates', () => { }) test('Uses proper locale files for templates', async ({ comfyPage }) => { - // 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' ) + // Set locale to French before opening templates + await comfyPage.setSetting('Comfy.Locale', 'fr') + await comfyPage.executeCommand('Comfy.BrowseTemplates') const request = await requestPromise