Refactor slotkey from bespoke string key

This commit is contained in:
Benjamin Lu
2025-10-10 12:58:25 -07:00
parent d7796fcda4
commit 799ab5e5aa
14 changed files with 430 additions and 231 deletions

View File

@@ -1,7 +1,6 @@
import type { Locator, Page } from '@playwright/test'
import type { NodeId } from '../../../../../src/platform/workflow/validation/schemas/workflowSchema'
import { getSlotKey } from '../../../../../src/renderer/core/layout/slots/slotIdentifier'
import {
comfyExpect as expect,
comfyPageFixture as test
@@ -67,8 +66,11 @@ function slotLocator(
slotIndex: number,
isInput: boolean
) {
const key = getSlotKey(String(nodeId), slotIndex, isInput)
return page.locator(`[data-slot-key="${key}"]`)
const type = isInput ? 'input' : 'output'
const id = String(nodeId)
return page.locator(
`[data-node-id="${id}"][data-slot-type="${type}"][data-slot-index="${slotIndex}"]`
)
}
async function expectVisibleAll(...locators: Locator[]) {