Two separate root causes:
1. category-management.e2e.ts: openWorkspaceSection('Live TV') was not
awaited — pickSidebarCategory ran before the route settled on the live
section, so it read VOD categories from the stale sidebar (e.g. 'Action'
instead of a live category). The manage-categories dialog opens for the
live section, so searching for a VOD name found nothing.
Fix: add waitForURL(/\/workspace\/xtreams\/[^/]+\/live/) after both
openWorkspaceSection('Live TV') calls.
2. recent.e2e.ts / favorites.e2e.ts: waitForFirstGridListCardTitle read
the first card's title, but clickGridListCardByTitle then did a fresh
DOM search by that title. Between those two calls the grid could
re-sort/paginate, making the card unfindable.
Fix: new clickFirstGridListCard helper atomically reads the title and
clicks the same card reference, replacing the two-step pattern.
https://claude.ai/code/session_01VU6ZZTG7YrhKhKBQvBfmpp
The dialog's 'Select All' button appears as soon as isLoading() flips,
but Angular still needs a change-detection cycle to paint the @for loop.
On slower CI runners (especially after a refreshSource cycle) the
.category-item rows were not yet in the DOM when toggleManagedCategory
tried to locate them, causing a spurious 5 s timeout.
Fix: add an explicit `toBeVisible` guard on the first .category-item
inside openManageCategoriesDialog, and raise the per-row timeout in
toggleManagedCategory from 5 s to 15 s.
https://claude.ai/code/session_01VU6ZZTG7YrhKhKBQvBfmpp
- category-management: replace filter({ has: dialog.locator(...) }) with
filter({ hasText }) on the .category-item row. Playwright cannot scope an
absolute locator (created via dialog.locator()) to each candidate element
when used inside filter({ has: }), so the query always returned empty.
Using hasText on the whole row correctly retries until Angular's @for loop
re-renders filteredCategories() after the search field is populated.
- recent.e2e.ts Xtream test: same pagination fix as favorites — derive
movieTitle and seriesTitle from waitForFirstGridListCardTitle() instead of
pickDistinctTitles(fixture.items)[0], which may be on page 2 of the
date-sorted grid and never visible.
https://claude.ai/code/session_01VU6ZZTG7YrhKhKBQvBfmpp
- toggleManagedCategory: replace manual count-loop with Playwright filter so
the locator retries internally until Angular re-renders the filtered list
after the search field is populated (previously called .count() before the
@for loop had reacted to the updated searchTerm signal)
- favorites Xtream test: pick movie/series titles from the first displayed
grid card instead of vodFixture.items[0]. The grid sorts by date-desc and
paginates at 25 items; the first API item may land on page 2 making
clickGridListCardByTitle time out with "element not found". Reading the
title from the DOM after navigation ensures we always target a visible card.
- electron-test-fixtures: export waitForFirstGridListCardTitle helper
https://claude.ai/code/session_01VU6ZZTG7YrhKhKBQvBfmpp
- dragSourceBefore: replace mat-list-item with .playlist-item as the
drag target; playlist-item.component has no mat-list-item element,
the inner container div carries the .playlist-item class
- toggleManagedCategory: match categories by name only instead of
name+itemCount; after an Xtream refresh the itemCounts Map passed to
the dialog may be empty (streams not yet counted), causing a false
mismatch even though the category is present and uniquely named
https://claude.ai/code/session_01VU6ZZTG7YrhKhKBQvBfmpp
- Fix getVisibleSourceTitles: use .playlist-title selector instead of
.mdc-list-item__primary-text which no longer matches playlist-item component
- Fix category-management test: re-navigate to sources page after
refreshSource since refresh navigates away from sources
- Fix recent.e2e test: remove switchUnifiedCollectionContent calls after
clearRecentItems since the content toggle disappears when all items cleared
- Fix stalker mock server: generate numeric episode IDs ("1","2",...) in
season.series array so toSeriesNumbers() can parse them; previously used
non-numeric IDs like "30000-s1-e1" which parsed to NaN, producing empty
episode arrays and causing playFirstSeriesEpisode to time out
https://claude.ai/code/session_01VU6ZZTG7YrhKhKBQvBfmpp
Replace menuitem selectors with mat-button-toggle[value] selectors in
all four playlist import helpers (file, url, xtream, stalker) and rename
openAddPlaylistMenu to openAddPlaylistDialog to reflect that clicking
"Add playlist" now opens a dialog directly instead of a dropdown menu.
https://claude.ai/code/session_01VU6ZZTG7YrhKhKBQvBfmpp
mat-button-toggle elements inside a group render their internal buttons
with role="radio", not role="button", so getByRole('button') selectors
fail. Switch to attribute selectors targeting the value attribute instead.
https://claude.ai/code/session_01VU6ZZTG7YrhKhKBQvBfmpp