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