mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-19 13:59:28 +00:00
## Summary Adds Playwright E2E tests for the QueueClearHistoryDialog component. ## Tests added - Dialog opens from queue panel history actions menu - Dialog shows confirmation message with title, description, and assets note - Cancel button closes dialog without clearing history - Close (X) button closes dialog without clearing history - Confirm clear action triggers queue history clear API call - Dialog state resets properly after close/reopen ## Task Part of Test Coverage Q2 Overhaul (DLG-02). ## Conventions - Uses Vue nodes with new menu enabled (`Comfy.UseNewMenu: 'Top'`) - Tests read as user stories - No full-page screenshots - Proper waits, no sleeps ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-10586-test-add-QueueClearHistoryDialog-E2E-tests-DLG-02-3306d73d36508174a07bd9782340a0f7) by [Unito](https://www.unito.io) --------- Co-authored-by: GitHub Action <action@github.com>
25 lines
700 B
TypeScript
25 lines
700 B
TypeScript
import type { Locator, Page } from '@playwright/test'
|
|
|
|
import { comfyExpect as expect } from '../ComfyPage'
|
|
import { TestIds } from '../selectors'
|
|
|
|
export class QueuePanel {
|
|
readonly overlayToggle: Locator
|
|
readonly moreOptionsButton: Locator
|
|
|
|
constructor(readonly page: Page) {
|
|
this.overlayToggle = page.getByTestId(TestIds.queue.overlayToggle)
|
|
this.moreOptionsButton = page.getByLabel(/More options/i).first()
|
|
}
|
|
|
|
async openClearHistoryDialog() {
|
|
await this.moreOptionsButton.click()
|
|
|
|
const clearHistoryAction = this.page.getByTestId(
|
|
TestIds.queue.clearHistoryAction
|
|
)
|
|
await expect(clearHistoryAction).toBeVisible()
|
|
await clearHistoryAction.click()
|
|
}
|
|
}
|