diff --git a/browser_tests/tests/featureFlags.spec.ts b/browser_tests/tests/featureFlags.spec.ts index 7079768291..b3cdecb947 100644 --- a/browser_tests/tests/featureFlags.spec.ts +++ b/browser_tests/tests/featureFlags.spec.ts @@ -274,7 +274,7 @@ test.describe('Feature Flags', () => { // Set up monitoring before navigation await newPage.addInitScript(() => { // Track when various app components are ready - ;(window as any).__appReadiness = { + ;(window as unknown as Record).__appReadiness = { featureFlagsReceived: false, apiInitialized: false, appInitialized: false @@ -286,7 +286,10 @@ test.describe('Feature Flags', () => { window['app']?.api?.serverFeatureFlags?.supports_preview_metadata !== undefined ) { - ;(window as any).__appReadiness.featureFlagsReceived = true + ;(window as unknown as Record).__appReadiness = { + ...(window as unknown as Record).__appReadiness, + featureFlagsReceived: true + } clearInterval(checkFeatureFlags) } }, 10) @@ -294,7 +297,10 @@ test.describe('Feature Flags', () => { // Monitor API initialization const checkApi = setInterval(() => { if (window['app']?.api) { - ;(window as any).__appReadiness.apiInitialized = true + ;(window as unknown as Record).__appReadiness = { + ...(window as unknown as Record).__appReadiness, + apiInitialized: true + } clearInterval(checkApi) } }, 10) @@ -302,7 +308,10 @@ test.describe('Feature Flags', () => { // Monitor app initialization const checkApp = setInterval(() => { if (window['app']?.graph) { - ;(window as any).__appReadiness.appInitialized = true + ;(window as unknown as Record).__appReadiness = { + ...(window as unknown as Record).__appReadiness, + appInitialized: true + } clearInterval(checkApp) } }, 10) @@ -331,7 +340,7 @@ test.describe('Feature Flags', () => { // Get readiness state const readiness = await newPage.evaluate(() => { return { - ...(window as any).__appReadiness, + ...(window as unknown as Record).__appReadiness, currentFlags: window['app'].api.serverFeatureFlags } }) diff --git a/browser_tests/tests/nodeHelp.spec.ts b/browser_tests/tests/nodeHelp.spec.ts index cfb04bc463..8bdada6bd7 100644 --- a/browser_tests/tests/nodeHelp.spec.ts +++ b/browser_tests/tests/nodeHelp.spec.ts @@ -1,12 +1,11 @@ -import { - comfyExpect as expect, - comfyPageFixture as test -} from '../fixtures/ComfyPage' +import { comfyExpect as expect, comfyPageFixture as test } from '../fixtures/ComfyPage'; +import type { ComfyPage } from '../fixtures/ComfyPage'; import { fitToViewInstant } from '../helpers/fitToView' +import type { NodeReference } from '../fixtures/utils/litegraphUtils' // TODO: there might be a better solution for this // Helper function to pan canvas and select node -async function selectNodeWithPan(comfyPage: any, nodeRef: any) { +async function selectNodeWithPan(comfyPage: ComfyPage, nodeRef: NodeReference) { const nodePos = await nodeRef.getPosition() await comfyPage.page.evaluate((pos) => { @@ -345,7 +344,9 @@ This is documentation for a custom node. // Find and select a custom/group node const nodeRefs = await comfyPage.page.evaluate(() => { - return window['app'].graph.nodes.map((n: any) => n.id) + return window['app'].graph.nodes.map( + (n: Record) => n.id + ) }) if (nodeRefs.length > 0) { const firstNode = await comfyPage.getNodeRefById(nodeRefs[0]) diff --git a/browser_tests/tests/selectionToolboxSubmenus.spec.ts b/browser_tests/tests/selectionToolboxSubmenus.spec.ts index f526b07e08..b4daedb955 100644 --- a/browser_tests/tests/selectionToolboxSubmenus.spec.ts +++ b/browser_tests/tests/selectionToolboxSubmenus.spec.ts @@ -1,6 +1,7 @@ import { expect } from '@playwright/test' -import { comfyPageFixture as test } from '../fixtures/ComfyPage' +import { comfyPageFixture as test } from '../fixtures/ComfyPage'; +import type { ComfyPage } from '../fixtures/ComfyPage'; test.beforeEach(async ({ comfyPage }) => { await comfyPage.setSetting('Comfy.UseNewMenu', 'Disabled') @@ -15,7 +16,7 @@ test.describe('Selection Toolbox - More Options Submenus', () => { await comfyPage.nextFrame() }) - const openMoreOptions = async (comfyPage: any) => { + const openMoreOptions = async (comfyPage: ComfyPage) => { const ksamplerNodes = await comfyPage.getNodeRefsByTitle('KSampler') if (ksamplerNodes.length === 0) { throw new Error('No KSampler nodes found') diff --git a/browser_tests/tests/vueNodes/interactions/links/linkInteraction.spec.ts b/browser_tests/tests/vueNodes/interactions/links/linkInteraction.spec.ts index 315758f5ce..c45f3cc51b 100644 --- a/browser_tests/tests/vueNodes/interactions/links/linkInteraction.spec.ts +++ b/browser_tests/tests/vueNodes/interactions/links/linkInteraction.spec.ts @@ -419,7 +419,7 @@ test.describe('Vue Node Link Interaction', () => { // This avoids relying on an exact path hit-test position. await comfyPage.page.evaluate( ([targetNodeId, targetSlot, clientPoint]) => { - const app = (window as any)['app'] + const app = (window as unknown as Record)['app'] const graph = app?.canvas?.graph ?? app?.graph if (!graph) throw new Error('Graph not available') const node = graph.getNodeById(targetNodeId) @@ -505,7 +505,7 @@ test.describe('Vue Node Link Interaction', () => { // This avoids relying on an exact path hit-test position. await comfyPage.page.evaluate( ([targetNodeId, targetSlot, clientPoint]) => { - const app = (window as any)['app'] + const app = (window as unknown as Record)['app'] const graph = app?.canvas?.graph ?? app?.graph if (!graph) throw new Error('Graph not available') const node = graph.getNodeById(targetNodeId)