mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-05-03 20:51:58 +00:00
test(assets): add E2E tests for media type filter
Add cloud-only (@cloud) Playwright tests for the media type filter checkboxes in the assets sidebar. Tests cover: filter menu visibility with all four media type options, filtering to show only one type, and re-enabling a filter to restore all assets. Fixes #10780
This commit is contained in:
@@ -207,6 +207,14 @@ export class AssetsSidebarTab extends SidebarTab {
|
||||
return this.page.getByRole('button', { name: 'View settings' })
|
||||
}
|
||||
|
||||
get filterButton() {
|
||||
return this.page.getByRole('button', { name: 'Filter by' })
|
||||
}
|
||||
|
||||
filterCheckbox(label: string) {
|
||||
return this.page.getByRole('checkbox', { name: label })
|
||||
}
|
||||
|
||||
// --- View mode ---
|
||||
|
||||
get listViewOption() {
|
||||
@@ -347,6 +355,16 @@ export class AssetsSidebarTab extends SidebarTab {
|
||||
.waitFor({ state: 'visible', timeout: 3000 })
|
||||
}
|
||||
|
||||
async openFilterMenu() {
|
||||
await this.dismissToasts()
|
||||
await this.filterButton.click()
|
||||
// Wait for popover content with checkboxes to render
|
||||
await this.filterCheckbox('Image').waitFor({
|
||||
state: 'visible',
|
||||
timeout: 3000
|
||||
})
|
||||
}
|
||||
|
||||
async rightClickAsset(name: string) {
|
||||
const card = this.getAssetCardByName(name)
|
||||
await card.click({ button: 'right' })
|
||||
|
||||
Reference in New Issue
Block a user