mirror of
https://github.com/4gray/iptvnator.git
synced 2026-10-11 02:46:16 -08:00
fix(e2e): resolve 4 remaining test failures in electron e2e suite
- 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
This commit is contained in:
4 files changed
+5
-6
No files matched your search
@@ -68,6 +68,7 @@ test.describe('Electron Xtream Category Management', () => {
|
||||
|
||||
await openSources(app.mainWindow);
|
||||
await refreshSource(app.mainWindow, portalName, { confirm: true });
|
||||
await openSources(app.mainWindow);
|
||||
await waitForSourceRowIdle(app.mainWindow, portalName);
|
||||
await sourceRowByTitle(app.mainWindow, portalName).first().click();
|
||||
await waitForXtreamWorkspaceReady(app.mainWindow);
|
||||
|
||||
@@ -675,9 +675,7 @@ export async function getVisibleSourceTitles(page: Page): Promise<string[]> {
|
||||
return page.locator('app-playlist-item').evaluateAll((elements) =>
|
||||
elements
|
||||
.map((element) => {
|
||||
const titleElement = element.querySelector(
|
||||
'[matlistitemtitle], [matListItemTitle], .mdc-list-item__primary-text'
|
||||
);
|
||||
const titleElement = element.querySelector('.playlist-title');
|
||||
return titleElement?.textContent?.trim() ?? '';
|
||||
})
|
||||
.filter((title) => title.length > 0)
|
||||
|
||||
@@ -186,10 +186,10 @@ test.describe('Electron Recently Viewed', () => {
|
||||
|
||||
await switchUnifiedCollectionContent(app.mainWindow, 'Live TV');
|
||||
await clearRecentItems(app.mainWindow);
|
||||
// After clearing all items, the content toggle disappears.
|
||||
// All content types are cleared simultaneously, so no toggle switch needed.
|
||||
await expect(channelItemByTitle(app.mainWindow, liveTitle)).toHaveCount(0);
|
||||
await switchUnifiedCollectionContent(app.mainWindow, 'Movies');
|
||||
await expect(contentCardByTitle(app.mainWindow, movieTitle)).toHaveCount(0);
|
||||
await switchUnifiedCollectionContent(app.mainWindow, 'Series');
|
||||
await expect(contentCardByTitle(app.mainWindow, seriesTitle)).toHaveCount(0);
|
||||
} finally {
|
||||
await closeElectronApp(app);
|
||||
|
||||
@@ -365,7 +365,7 @@ export function generateSeasons(
|
||||
return Array.from({ length: seasonCount }, (_, s) => {
|
||||
const seasonId = `${series.id}-s${s + 1}`;
|
||||
const episodes = Array.from({ length: episodesPerSeason }, (_, e) =>
|
||||
`${series.id}-s${s + 1}-e${e + 1}`
|
||||
String(e + 1)
|
||||
);
|
||||
return {
|
||||
id: seasonId,
|
||||
|
||||
Reference in new issue
Block a user