mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-20 06:20:11 +00:00
## Summary Adds tests that simulate the execution flow and output feed ## Changes - **What**: - Add ExecutionHelper for mocking network activity - Refactor ws fixture to use Playwright websocket helper instead of patching window - ## Review Focus <!-- Critical design decisions or edge cases that need attention --> <!-- If this PR fixes an issue, uncomment and update the line below --> <!-- Fixes #ISSUE_NUMBER --> ## Screenshots (if applicable) <!-- Add screenshots or video recording to help explain your changes --> ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-10801-test-App-mode-Execution-tests-3356d73d365081e4acf0c34378600031) by [Unito](https://www.unito.io)
98 lines
2.5 KiB
TypeScript
98 lines
2.5 KiB
TypeScript
import type { Locator, Page } from '@playwright/test'
|
|
|
|
import { TestIds } from '../selectors'
|
|
|
|
const ids = TestIds.outputHistory
|
|
|
|
export class OutputHistoryComponent {
|
|
constructor(private readonly page: Page) {}
|
|
|
|
get outputs(): Locator {
|
|
return this.page.getByTestId(ids.outputs)
|
|
}
|
|
|
|
get welcome(): Locator {
|
|
return this.page.getByTestId(ids.welcome)
|
|
}
|
|
|
|
get outputInfo(): Locator {
|
|
return this.page.getByTestId(ids.outputInfo)
|
|
}
|
|
|
|
get activeQueue(): Locator {
|
|
return this.page.getByTestId(ids.activeQueue)
|
|
}
|
|
|
|
get queueBadge(): Locator {
|
|
return this.page.getByTestId(ids.queueBadge)
|
|
}
|
|
|
|
get inProgressItems(): Locator {
|
|
return this.page.getByTestId(ids.inProgressItem)
|
|
}
|
|
|
|
get historyItems(): Locator {
|
|
return this.page.getByTestId(ids.historyItem)
|
|
}
|
|
|
|
get skeletons(): Locator {
|
|
return this.page.getByTestId(ids.skeleton)
|
|
}
|
|
|
|
get latentPreviews(): Locator {
|
|
return this.page.getByTestId(ids.latentPreview)
|
|
}
|
|
|
|
get imageOutputs(): Locator {
|
|
return this.page.getByTestId(ids.imageOutput)
|
|
}
|
|
|
|
get videoOutputs(): Locator {
|
|
return this.page.getByTestId(ids.videoOutput)
|
|
}
|
|
|
|
/** The currently selected (checked) in-progress item. */
|
|
get selectedInProgressItem(): Locator {
|
|
return this.page.locator(
|
|
`[data-testid="${ids.inProgressItem}"][data-state="checked"]`
|
|
)
|
|
}
|
|
|
|
/** The currently selected (checked) history item. */
|
|
get selectedHistoryItem(): Locator {
|
|
return this.page.locator(
|
|
`[data-testid="${ids.historyItem}"][data-state="checked"]`
|
|
)
|
|
}
|
|
|
|
/** The header-level progress bar. */
|
|
get headerProgressBar(): Locator {
|
|
return this.page.getByTestId(ids.headerProgressBar)
|
|
}
|
|
|
|
/** The in-progress item's progress bar (inside the thumbnail). */
|
|
get itemProgressBar(): Locator {
|
|
return this.inProgressItems.first().getByTestId(ids.itemProgressBar)
|
|
}
|
|
|
|
/** Overall progress in the header bar. */
|
|
get headerOverallProgress(): Locator {
|
|
return this.headerProgressBar.getByTestId(ids.progressOverall)
|
|
}
|
|
|
|
/** Node progress in the header bar. */
|
|
get headerNodeProgress(): Locator {
|
|
return this.headerProgressBar.getByTestId(ids.progressNode)
|
|
}
|
|
|
|
/** Overall progress in the in-progress item bar. */
|
|
get itemOverallProgress(): Locator {
|
|
return this.itemProgressBar.getByTestId(ids.progressOverall)
|
|
}
|
|
|
|
/** Node progress in the in-progress item bar. */
|
|
get itemNodeProgress(): Locator {
|
|
return this.itemProgressBar.getByTestId(ids.progressNode)
|
|
}
|
|
}
|