diff --git a/browser_tests/tests/aboutPanel.spec.ts b/browser_tests/tests/aboutPanel.spec.ts deleted file mode 100644 index 3d27f4a9df..0000000000 --- a/browser_tests/tests/aboutPanel.spec.ts +++ /dev/null @@ -1,51 +0,0 @@ -import { expect } from '@playwright/test' - -import { comfyPageFixture as test } from '../fixtures/ComfyPage' - -/** - * This file contains End-to-End (E2E) tests for the About Panel. - * - * It tests the real integration between the frontend and the live backend API. - * - * Pre-requisites for running these tests: - * 1. The ComfyUI backend server must be running. - * 2. The custom API endpoint '/templates_version' must be active on the backend - * (e.g., via `custom_nodes/templates_version.py`). - */ -test.describe('About Panel - E2E', () => { - test('should display templates_version version from the real API', async ({ - comfyPage - }) => { - // 1. Fetch the expected version directly from the REAL API endpoint. - // This makes the test adaptable to changes in the backend's response. - const response = await comfyPage.request.get( - `${comfyPage.url}/templates_version` - ) - expect( - response.ok(), - 'The real /templates_version API endpoint must be available and return a 200 OK status.' - ).toBeTruthy() - - const { version: expectedVersion } = await response.json() - expect( - expectedVersion, - 'The real /templates_version API response should contain a "version" field.' - ).toBeDefined() - - // 2. Open the Settings dialog and navigate to the About tab. - await comfyPage.page.getByRole('button', { name: '⚙' }).click() - await comfyPage.page.getByLabel('About').click() - - // 3. Find the link element that contains the core text "Workflows_Templates". - const linkLocator = comfyPage.page.getByRole('link', { - name: /Workflows_Templates/ - }) - - // 4. Assert that the base link element is visible. - // We give it a slightly longer timeout to account for real network latency. - await expect(linkLocator).toBeVisible({ timeout: 10000 }) - - // 5. Assert that the element's text contains the version fetched from the real API. - await expect(linkLocator).toHaveText(new RegExp(expectedVersion)) - }) -}) diff --git a/src/schemas/apiSchema.ts b/src/schemas/apiSchema.ts index a6d8eee27d..cffc0eeddf 100644 --- a/src/schemas/apiSchema.ts +++ b/src/schemas/apiSchema.ts @@ -313,6 +313,7 @@ export const zSystemStats = z.object({ python_version: z.string(), embedded_python: z.boolean(), comfyui_version: z.string(), + workflows_templates_version: z.string(), pytorch_version: z.string(), argv: z.array(z.string()), ram_total: z.number(), diff --git a/src/scripts/api.ts b/src/scripts/api.ts index f08ae7506f..85316a74a7 100644 --- a/src/scripts/api.ts +++ b/src/scripts/api.ts @@ -733,14 +733,6 @@ export class ComfyApi extends EventTarget { return await res.json() } - async getTemplatesVersion(): Promise<{ version: string }> { - const res = await this.fetchApi('/templates_version') - if (!res.ok) { - throw new Error(`Failed to fetch /templates_version: ${res.statusText}`) - } - return res.json() - } - /** * Sends a POST request to the API * @param {*} type The endpoint to post to diff --git a/src/stores/aboutPanelStore.ts b/src/stores/aboutPanelStore.ts index 0ab245882c..2f5c04916d 100644 --- a/src/stores/aboutPanelStore.ts +++ b/src/stores/aboutPanelStore.ts @@ -1,30 +1,25 @@ import { defineStore } from 'pinia' -import { computed, onMounted } from 'vue' +import { computed } from 'vue' import { AboutPageBadge } from '@/types/comfy' import { electronAPI, isElectron } from '@/utils/envUtil' import { useExtensionStore } from './extensionStore' import { useSystemStatsStore } from './systemStatsStore' -import { useTemplateVersionStore } from './templateVersionStore' export const useAboutPanelStore = defineStore('aboutPanel', () => { const frontendVersion = __COMFYUI_FRONTEND_VERSION__ const extensionStore = useExtensionStore() const systemStatsStore = useSystemStatsStore() - const templateVersionStore = useTemplateVersionStore() const coreVersion = computed( () => systemStatsStore?.systemStats?.system?.comfyui_version ?? '' ) const workflowsTemplatesVersion = computed( - () => templateVersionStore?.workflowsTemplatesVersion + () => + systemStatsStore?.systemStats?.system?.workflows_templates_version ?? '' ) - onMounted(async () => { - await templateVersionStore.fetchTemplateVersion() - }) - const coreBadges = computed(() => [ // In electron, the ComfyUI is packaged without the git repo, // so the python server's API doesn't have the version info. diff --git a/src/stores/templateVersionStore.ts b/src/stores/templateVersionStore.ts deleted file mode 100644 index 7f1533d05f..0000000000 --- a/src/stores/templateVersionStore.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { defineStore } from 'pinia' -import { ref } from 'vue' - -import { api } from '@/scripts/api' - -export const useTemplateVersionStore = defineStore('templateVersion', () => { - const workflowsTemplatesVersion = ref('') - const isLoading = ref(false) - const error = ref(null) - - async function fetchTemplateVersion() { - isLoading.value = true - error.value = null - - try { - const response = await api.getTemplatesVersion() - workflowsTemplatesVersion.value = response.version - } catch (err) { - error.value = - err instanceof Error ? err.message : 'Failed to fetch template version' - console.error('Error fetching template version:', err) - workflowsTemplatesVersion.value = '' - } finally { - isLoading.value = false - } - } - - return { - workflowsTemplatesVersion, - isLoading, - error, - fetchTemplateVersion - } -})