Co-authored-by: bymyself <cbyrne@comfy.org>
Co-authored-by: github-actions <github-actions@github.com>
This commit is contained in:
Chenlei Hu
2025-02-28 14:11:14 -05:00
committed by GitHub
parent e106fded37
commit 24e560bb2d
82 changed files with 1662 additions and 106 deletions

View File

@@ -1,4 +1,8 @@
import { Locator, Page } from '@playwright/test'
import path from 'path'
import { CORE_TEMPLATES } from '../../src/constants/coreTemplates'
import { TemplateInfo } from '../../src/types/workflowTemplateTypes'
export class ComfyTemplates {
readonly content: Locator
@@ -8,6 +12,17 @@ export class ComfyTemplates {
}
async loadTemplate(id: string) {
await this.content.getByTestId(`template-workflow-${id}`).click()
await this.content
.getByTestId(`template-workflow-${id}`)
.getByRole('img')
.click()
}
getAllTemplates(): TemplateInfo[] {
return CORE_TEMPLATES.flatMap((category) => category.templates)
}
getTemplatePath(filename: string): string {
return path.join('public', 'templates', filename)
}
}