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:
dante01yoon
2026-04-01 09:16:30 +09:00
parent 515f234143
commit 834872ebec
2 changed files with 130 additions and 0 deletions

View File

@@ -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' })