Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
a010330
test: cover subgraph UI lifecycle boundaries
christian-byrne Sep 12, 2026
7f551bb
[automated] Apply ESLint and Oxfmt fixes
actions-user Sep 12, 2026
bd706d6
test: address subgraph scenario review feedback
christian-byrne Sep 12, 2026
a1e87e5
test: correct subgraph lifecycle contracts
christian-byrne Sep 12, 2026
6b813db
test: fix subgraph deletion target
christian-byrne Sep 12, 2026
c9874ea
Merge branch 'main' into test/ecs-qa-subgraph-gaps
DrJKL Sep 12, 2026
d9aae63
test: strengthen subgraph host lifecycle scenarios
christian-byrne Sep 12, 2026
87bcf4d
Merge remote-tracking branch 'origin/main' into test/ecs-qa-subgraph-…
christian-byrne Sep 12, 2026
7b854c9
test: use canvas geometry helper for replacement
christian-byrne Sep 12, 2026
5e402eb
test: move promoted widget lookup to node reference
christian-byrne Sep 12, 2026
f17bd0c
test: copy subgraph hosts through node reference
christian-byrne Sep 12, 2026
c589644
test: delete selected host with focused keyboard helper
christian-byrne Sep 12, 2026
1de5e6d
test: isolate root undo from nested navigation
christian-byrne Sep 12, 2026
36d64c3
test: name subgraph user phases in traces
christian-byrne Sep 12, 2026
9ea823c
test: cover blank promoted widget save
christian-byrne Sep 12, 2026
ba24b55
Revert "test: cover blank promoted widget save"
christian-byrne Sep 12, 2026
8a3b7f3
test: preserve cleared promoted widget labels across reload
christian-byrne Sep 12, 2026
a32b72c
test: promote widget through UI before clearing its label
christian-byrne Sep 12, 2026
6a244e4
Merge branch 'main' into test/ecs-qa-subgraph-gaps
DrJKL Sep 14, 2026
e431e30
test: structure subgraph scenarios as user stories
ampagent Sep 14, 2026
4ea70f8
test: sort subgraph links explicitly
ampagent Sep 14, 2026
fd14fdb
test: harden subgraph workflow helpers
ampagent Sep 14, 2026
d1c2145
test: cover promoted advanced widget values
christian-byrne Sep 15, 2026
7599fe6
test: remove unresolved promoted widget contract
christian-byrne Sep 15, 2026
10f91e7
test: persist promoted values after duplicate deletion
christian-byrne Sep 17, 2026
6ec053b
test: reuse promoted widget lookup in survivor assertions
christian-byrne Sep 17, 2026
cf30662
test: assert independently specified survivor values
christian-byrne Sep 17, 2026
fb0e853
test: persist independent subgraph host values
christian-byrne Sep 17, 2026
9146041
test: cover remaining ECS widget contracts
christian-byrne Sep 17, 2026
722e255
test: strengthen ECS widget lifecycle contracts
christian-byrne Sep 17, 2026
7f8302c
test: isolate promoted widget persistence from default graph
christian-byrne Sep 17, 2026
86f1978
Merge remote-tracking branch 'origin/main' into amp/pr17516-merge-main
DrJKL Oct 9, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions browser_tests/fixtures/ComfyPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,43 @@ class ComfyPropertiesPanel {
name: 'Toggle properties panel'
})
}

async open(): Promise<void> {
if (!(await this.root.isVisible())) await this.toggleButton.click()
await comfyExpect(this.root).toBeVisible()
}

async renameParameterLabel(
currentLabel: string,
nextLabel: string
): Promise<void> {
await this.root
.getByRole('tab', { name: 'Parameters', exact: true })
.click()
await this.root.getByText(currentLabel, { exact: true }).click()
const labelInput = this.root.getByPlaceholder(currentLabel, { exact: true })
await labelInput.fill(nextLabel)
await labelInput.press('Enter')
await comfyExpect(
this.root.getByText(nextLabel, { exact: true })
).toBeVisible()
}

async clearParameterLabel(
currentLabel: string,
defaultLabel: string
): Promise<void> {
await this.root.getByText(currentLabel, { exact: true }).click()
const labelInput = this.root.getByPlaceholder(defaultLabel, { exact: true })
await labelInput.clear()
await labelInput.press('Enter')
await comfyExpect(
this.root.getByText(defaultLabel, { exact: true })
).toBeVisible()
await comfyExpect(
this.root.getByText(currentLabel, { exact: true })
).toHaveCount(0)
}
}

class ComfyMenu {
Expand Down
26 changes: 26 additions & 0 deletions browser_tests/fixtures/components/SubgraphEditor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import { comfyExpect as expect } from '@e2e/fixtures/ComfyPage'
import type { ComfyPage } from '@e2e/fixtures/ComfyPage'
import { TestIds } from '@e2e/fixtures/selectors'
import { dragByIndex } from '@e2e/fixtures/utils/dragAndDrop'
import { fitToViewInstant } from '@e2e/fixtures/utils/fitToView'
import type { NodeReference } from '@e2e/fixtures/utils/litegraphUtils'
import { VueNodeFixture } from '@e2e/fixtures/utils/vueNodeFixtures'

export class SubgraphEditor {
Expand Down Expand Up @@ -86,6 +88,30 @@ export class SubgraphEditor {
const item = this.resolveItem(options)
await this.togglePromotionOnItem(item, options.toState)
}

async promoteWidget(
host: NodeReference,
options: {
nodeName?: string
nodeId?: string
widgetName: string
}
): Promise<void> {
await fitToViewInstant(this.comfyPage, { zoom: 1 })
if (this.comfyPage.isVueNodes) {
await this.ensureOpen(
this.comfyPage.vueNodes.getNodeLocator(String(host.id))
)
} else {
await host.clickContextMenuOption('Edit Subgraph Widgets')
await expect(this.root).toBeVisible()
}
await this.togglePromotionOnItem(this.resolveItem(options), true)
await this.comfyPage.menu.propertiesPanel.toggleButton.click()
await expect(this.root).toBeHidden()
await fitToViewInstant(this.comfyPage, { zoom: 1 })
}

async dragItem(fromIndex: number, toIndex: number) {
await dragByIndex(this.promotionItems, fromIndex, toIndex)
await this.comfyPage.nextFrame()
Expand Down
38 changes: 38 additions & 0 deletions browser_tests/fixtures/data/subgraphTopologies.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import type { GraphTopology } from '@e2e/fixtures/helpers/SubgraphHelper'

export const nestedSubgraphTopologies = {
root: {
nodes: ['10', '8', '9'],
links: [
['10', 0, '8', 0],
['10', 1, '8', 1],
['8', 0, '9', 0]
]
},
outer: {
nodes: ['11', '3', '6'],
links: [
['11', 0, '3', 2],
['11', 1, '3', 3],
['11', 2, '3', 0],
['11', 3, '6', 0],
['11', 4, '-20', 1],
['3', 0, '-20', 0],
['6', 0, '3', 1]
]
},
inner: {
nodes: ['4', '5', '7'],
links: [
['4', 0, '-20', 2],
['4', 1, '-20', 3],
['4', 1, '7', 0],
['4', 2, '-20', 4],
['5', 0, '-20', 1],
['7', 0, '-20', 0]
]
}
} satisfies Record<'root' | 'outer' | 'inner', GraphTopology>

export const outerSubgraphBreadcrumbId =
'subgraph-8beb610f-ddd1-4489-ae0d-2f732a4042ae'
107 changes: 107 additions & 0 deletions browser_tests/fixtures/helpers/SubgraphHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,16 @@ import { SubgraphSlotReference } from '@e2e/fixtures/utils/litegraphUtils'
import { getAllHostPromotedWidgets } from '@e2e/fixtures/utils/promotedWidgets'
import type { PromotedWidgetEntry } from '@e2e/fixtures/utils/promotedWidgets'

export interface GraphTopology {
nodes: string[]
links: [string, number, string, number][]
}

export interface SubgraphHostIdentity {
type: string
subgraphId: string
}

interface SubgraphDefinitionRow {
name: string
nodes: number
Expand Down Expand Up @@ -462,6 +472,24 @@ export class SubgraphHelper {
}
}

async enterSubgraph(node: NodeReference): Promise<void> {
const subgraphId = await this.page.evaluate((id) => {
const host = window.app!.canvas.graph?.getNodeById(id)
if (!host?.isSubgraphNode()) {
throw new Error(`Expected visible subgraph node ${id}`)
}
return host.subgraph.id
}, node.id)

if (this.comfyPage.isVueNodes) {
await this.comfyPage.vueNodes.enterSubgraph(String(node.id))
await this.comfyPage.vueNodes.waitForNodes()
} else {
await node.navigateIntoSubgraph()
}
await expect.poll(() => this.getActiveGraphId()).toBe(subgraphId)
}

async isInSubgraph(): Promise<boolean> {
return this.page.evaluate(() => {
const graph = window.app!.canvas.graph
Expand Down Expand Up @@ -529,6 +557,85 @@ export class SubgraphHelper {
return getAllHostPromotedWidgets(this.comfyPage)
}

async getHostIdentity(node: NodeReference): Promise<SubgraphHostIdentity> {
return this.page.evaluate((id) => {
const host = window.app!.rootGraph.getNodeById(id)
if (!host?.isSubgraphNode()) {
throw new Error(`Subgraph host ${id} not found`)
}
return { type: host.type, subgraphId: host.subgraph.id }
}, node.id)
}

async expectPromotedWidget(
node: NodeReference,
name: string,
expected: SubgraphHostIdentity & { label: string | null; value: unknown }
): Promise<void> {
await expect
.poll(() =>
this.page.evaluate(
([id, widgetName]) => {
const host = window.app!.rootGraph.getNodeById(id)
if (!host?.isSubgraphNode()) return null
const widget = host.widgets.find(
(candidate) => candidate.name === widgetName
)
return {
type: host.type,
subgraphId: host.subgraph.id,
label: widget?.label ?? null,
value: widget?.value
}
},
[node.id, name] as const
)
)
.toEqual(expected)
}

async expectPersistedHostIds(
workflowName: string,
expectedIds: string[]
): Promise<void> {
const workflow =
await this.comfyPage.workflow.getPersistedWorkflow(workflowName)
this.expectHostIds(workflow, expectedIds)
}

expectHostIds(workflow: ComfyWorkflowJSON, expectedIds: string[]): void {
const hostIds = workflow.nodes
.filter((node) =>
workflow.definitions?.subgraphs.some(
(subgraph) => subgraph.id === node.type
)
)
.map((node) => String(node.id))
expect(hostIds).toEqual(expectedIds)
}

async getActiveTopology(): Promise<GraphTopology> {
return this.page.evaluate(() => {
const graph = window.app!.canvas.graph
if (!graph) throw new Error('Canvas graph was not loaded')
return {
nodes: graph.nodes.map((node) => String(node.id)).sort(),
links: [...graph.links.values()]
.map<[string, number, string, number]>((link) => [
String(link.origin_id),
link.origin_slot,
String(link.target_id),
link.target_slot
])
.sort((a, b) => a.join(':').localeCompare(b.join(':')))
}
})
}

async expectActiveTopology(expected: GraphTopology): Promise<void> {
await expect.poll(() => this.getActiveTopology()).toEqual(expected)
}

/** Reads from `window.app.canvas.graph` (viewed root or nested subgraph). */
async getNodeCount(): Promise<number> {
return this.page.evaluate(() => {
Expand Down
34 changes: 34 additions & 0 deletions browser_tests/fixtures/helpers/WorkflowHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import type {
ComfyApiWorkflow,
ComfyWorkflowJSON
} from '@/platform/workflow/validation/schemas/workflowSchema'
import { zComfyWorkflow } from '@/platform/workflow/validation/schemas/workflowSchema'
import type { WorkspaceStore } from '@e2e/types/globals'
import type { ComfyPage } from '@e2e/fixtures/ComfyPage'
import { assetPath } from '@e2e/fixtures/utils/paths'
Expand Down Expand Up @@ -132,6 +133,39 @@ export class WorkflowHelper {
}
}

async getPersistedWorkflow(workflowName: string): Promise<ComfyWorkflowJSON> {
const workflowPath = `/api/userdata/${encodeURIComponent(`workflows/${workflowName}.json`)}`
const response = await this.comfyPage.request.get(
`${this.comfyPage.apiUrl}${workflowPath}`,
{ headers: { 'Comfy-User': this.comfyPage.id } }
)
expect(response.ok()).toBe(true)
return zComfyWorkflow.parse(await response.json())
}

async saveWorkflow(workflowName: string): Promise<ComfyWorkflowJSON> {
const workflowPath = `/api/userdata/${encodeURIComponent(`workflows/${workflowName}.json`)}`
const saveResponse = this.comfyPage.page.waitForResponse(
(response) =>
new URL(response.url()).pathname === workflowPath &&
response.request().method() === 'POST'
)
await this.comfyPage.menu.topbar.saveWorkflow(workflowName)
const response = await saveResponse
expect(response.status()).toBe(200)
expect(response.request().headers()['comfy-user']).toBe(this.comfyPage.id)
return zComfyWorkflow.parse(response.request().postDataJSON())
}

async reloadAndOpenPersistedWorkflow(workflowName: string): Promise<void> {
await this.reloadAndWaitForApp()
const { workflowsTab } = this.comfyPage.menu
await workflowsTab.open()
await workflowsTab.getPersistedItem(workflowName).click()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P2][non-blocking] Wait for the selected workflow to finish loading. reloadAndWaitForApp() deliberately restores the graph the user left, so the following survivor and promoted-value assertions can observe that restored graph before this click has finished opening the saved item. The existing sidebar-open helper and switchToTab() both wait for workflow idle at this boundary.

Suggested change
await workflowsTab.getPersistedItem(workflowName).click()
await workflowsTab.getPersistedItem(workflowName).click()
await this.waitForWorkflowIdle()

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed: persisted workflow opening waits for workflow idle.

Full context for agent readers

The current commit adds await this.waitForWorkflowIdle() after the persisted-item click, before the workflows tab closes.

await this.waitForWorkflowIdle()
await workflowsTab.close()
}

async deleteWorkflow(
workflowName: string,
whenMissing: 'ignoreMissing' | 'throwIfMissing' = 'ignoreMissing'
Expand Down
Loading
Loading