mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-10 01:50:08 +00:00
Replace @trivago/prettier-plugin-sort-imports with @prettier/plugin-oxc and @ianvs/prettier-plugin-sort-imports for improved performance. Changes: - Add @prettier/plugin-oxc (Rust-based fast parser) - Add @ianvs/prettier-plugin-sort-imports (import sorting compatible with oxc) - Remove @trivago/prettier-plugin-sort-imports - Update .prettierrc to use new plugins and compatible import order config - Reformat all files with new plugin configuration 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
35 lines
852 B
TypeScript
35 lines
852 B
TypeScript
import path from 'path'
|
|
|
|
import type { Locator, Page } from '@playwright/test'
|
|
|
|
import type {
|
|
TemplateInfo,
|
|
WorkflowTemplates
|
|
} from '../../src/platform/workflow/templates/types/template'
|
|
|
|
export class ComfyTemplates {
|
|
readonly content: Locator
|
|
|
|
constructor(readonly page: Page) {
|
|
this.content = page.getByTestId('template-workflows-content')
|
|
}
|
|
|
|
async loadTemplate(id: string) {
|
|
await this.content
|
|
.getByTestId(`template-workflow-${id}`)
|
|
.getByRole('img')
|
|
.click()
|
|
}
|
|
|
|
async getAllTemplates(): Promise<TemplateInfo[]> {
|
|
const templates: WorkflowTemplates[] = await this.page.evaluate(() =>
|
|
window['app'].api.getCoreWorkflowTemplates()
|
|
)
|
|
return templates.flatMap((t) => t.templates)
|
|
}
|
|
|
|
getTemplatePath(filename: string): string {
|
|
return path.join('public', 'templates', filename)
|
|
}
|
|
}
|