Skip to content

Commit 2daa514

Browse files
Remove fetch-templates script (#3500)
1 parent 0f175c3 commit 2daa514

File tree

4 files changed

+28
-42
lines changed

4 files changed

+28
-42
lines changed

.github/workflows/test-ui.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ jobs:
3939
- name: Build ComfyUI_frontend
4040
run: |
4141
npm ci
42-
npm run fetch-templates
4342
npm run build
4443
working-directory: ComfyUI_frontend
4544

browser_tests/tests/templates.spec.ts

Lines changed: 27 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,17 @@
1-
import { expect } from '@playwright/test'
2-
import fs from 'fs'
1+
import { Page, expect } from '@playwright/test'
32

43
import { comfyPageFixture as test } from '../fixtures/ComfyPage'
54

5+
async function checkTemplateFileExists(
6+
page: Page,
7+
filename: string
8+
): Promise<boolean> {
9+
const response = await page.request.head(
10+
new URL(`/templates/${filename}`, page.url()).toString()
11+
)
12+
return response.ok()
13+
}
14+
615
test.describe('Templates', () => {
716
test.beforeEach(async ({ comfyPage }) => {
817
await comfyPage.setSetting('Comfy.UseNewMenu', 'Top')
@@ -12,42 +21,45 @@ test.describe('Templates', () => {
1221
test('should have a JSON workflow file for each template', async ({
1322
comfyPage
1423
}) => {
24+
test.slow()
1525
const templates = await comfyPage.templates.getAllTemplates()
1626
for (const template of templates) {
17-
const workflowPath = comfyPage.templates.getTemplatePath(
27+
const exists = await checkTemplateFileExists(
28+
comfyPage.page,
1829
`${template.name}.json`
1930
)
20-
expect(
21-
fs.existsSync(workflowPath),
22-
`Missing workflow: ${template.name}`
23-
).toBe(true)
31+
expect(exists, `Missing workflow: ${template.name}`).toBe(true)
2432
}
2533
})
2634

27-
test.skip('should have all required thumbnail media for each template', async ({
35+
test('should have all required thumbnail media for each template', async ({
2836
comfyPage
2937
}) => {
38+
test.slow()
3039
const templates = await comfyPage.templates.getAllTemplates()
3140
for (const template of templates) {
3241
const { name, mediaSubtype, thumbnailVariant } = template
3342
const baseMedia = `${name}-1.${mediaSubtype}`
34-
const basePath = comfyPage.templates.getTemplatePath(baseMedia)
3543

3644
// Check base thumbnail
37-
expect(
38-
fs.existsSync(basePath),
39-
`Missing base thumbnail: ${baseMedia}`
40-
).toBe(true)
45+
const baseExists = await checkTemplateFileExists(
46+
comfyPage.page,
47+
baseMedia
48+
)
49+
expect(baseExists, `Missing base thumbnail: ${baseMedia}`).toBe(true)
4150

4251
// Check second thumbnail for variants that need it
4352
if (
4453
thumbnailVariant === 'compareSlider' ||
4554
thumbnailVariant === 'hoverDissolve'
4655
) {
4756
const secondMedia = `${name}-2.${mediaSubtype}`
48-
const secondPath = comfyPage.templates.getTemplatePath(secondMedia)
57+
const secondExists = await checkTemplateFileExists(
58+
comfyPage.page,
59+
secondMedia
60+
)
4961
expect(
50-
fs.existsSync(secondPath),
62+
secondExists,
5163
`Missing second thumbnail: ${secondMedia} required for ${thumbnailVariant}`
5264
).toBe(true)
5365
}

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@
2525
"lint:fix": "eslint src --fix",
2626
"locale": "lobe-i18n locale",
2727
"collect-i18n": "playwright test --config=playwright.i18n.config.ts",
28-
"json-schema": "tsx scripts/generate-json-schema.ts",
29-
"fetch-templates": "tsx scripts/fetch-templates.ts"
28+
"json-schema": "tsx scripts/generate-json-schema.ts"
3029
},
3130
"devDependencies": {
3231
"@eslint/js": "^9.8.0",

scripts/fetch-templates.ts

Lines changed: 0 additions & 24 deletions
This file was deleted.

0 commit comments

Comments
 (0)