From e9a36b55ff34c10bd4d213505f1d95a0870c5bc2 Mon Sep 17 00:00:00 2001 From: 4gray Date: Thu, 30 Apr 2026 19:49:18 +0200 Subject: [PATCH] test(e2e): update player close button references and enhance visibility checks Entire-Checkpoint: c2cea9c530e6 --- .../src/dashboard-activation.e2e.ts | 10 +++++- apps/electron-backend-e2e/src/recent.e2e.ts | 31 ++++++++++++------- .../src/xtream-epg.e2e.ts | 2 +- 3 files changed, 30 insertions(+), 13 deletions(-) diff --git a/apps/electron-backend-e2e/src/dashboard-activation.e2e.ts b/apps/electron-backend-e2e/src/dashboard-activation.e2e.ts index 007a473f7..f1d23c113 100644 --- a/apps/electron-backend-e2e/src/dashboard-activation.e2e.ts +++ b/apps/electron-backend-e2e/src/dashboard-activation.e2e.ts @@ -1,6 +1,7 @@ import { Page } from '@playwright/test'; import { addXtreamPortal, + channelItemByTitle, clickCategoryByNameExact, clickFirstGridListCard, closeElectronApp, @@ -94,8 +95,15 @@ test.describe('Dashboard Activation', () => { /\/workspace\/xtreams\/[^/]+\/favorites$/ ); await expect( - app.mainWindow.locator('.player-toolbar .close-btn').first() + app.mainWindow + .locator( + 'app-unified-live-tab .content-container .video-player' + ) + .first() ).toBeVisible({ timeout: 20000 }); + await expect( + channelItemByTitle(app.mainWindow, liveTitle).first() + ).toHaveClass(/(^|\s)active(\s|$)/); await app.mainWindow.goBack(); await app.mainWindow.waitForURL(/\/workspace\/dashboard$/); diff --git a/apps/electron-backend-e2e/src/recent.e2e.ts b/apps/electron-backend-e2e/src/recent.e2e.ts index b277325c8..57d7c768a 100644 --- a/apps/electron-backend-e2e/src/recent.e2e.ts +++ b/apps/electron-backend-e2e/src/recent.e2e.ts @@ -73,15 +73,17 @@ test.describe('Electron Recently Viewed', () => { app.mainWindow, 'Stable Recent Channel' ).first(); - const closeButton = app.mainWindow - .locator('.player-toolbar .close-btn') + const livePlayer = app.mainWindow + .locator('app-unified-live-tab .content-container .video-player') .first(); await item.click(); - await expect(closeButton).toBeVisible({ timeout: 20000 }); + await expect(livePlayer).toBeVisible({ timeout: 20000 }); + await expect(item).toHaveClass(/(^|\s)active(\s|$)/); await item.click(); - await expect(closeButton).toBeVisible({ timeout: 20000 }); + await expect(livePlayer).toBeVisible({ timeout: 20000 }); + await expect(item).toHaveClass(/(^|\s)active(\s|$)/); } finally { await closeElectronApp(app); } @@ -189,7 +191,7 @@ test.describe('Electron Recently Viewed', () => { await toggleFavoriteForChannel(app.mainWindow, liveTitle); await openPlaylistFavorites(app.mainWindow); await channelItemByTitle(app.mainWindow, liveTitle).first().click(); - await closeUnifiedLiveDetail(app.mainWindow); + await expectUnifiedLiveDetailOpen(app.mainWindow, liveTitle); await app.mainWindow .getByRole('link', { name: 'Movies', exact: true }) @@ -396,7 +398,7 @@ test.describe('Electron Recently Viewed', () => { await toggleFavoriteForChannel(app.mainWindow, liveTitle); await openPlaylistFavorites(app.mainWindow); await channelItemByTitle(app.mainWindow, liveTitle).first().click(); - await closeUnifiedLiveDetail(app.mainWindow); + await expectUnifiedLiveDetailOpen(app.mainWindow, liveTitle); await app.mainWindow .getByRole('link', { name: 'Movies', exact: true }) @@ -561,11 +563,18 @@ async function clearRecentItems(page: Page, typeLabel: string): Promise { await page.getByRole('button', { name: 'Yes' }).click(); } -async function closeUnifiedLiveDetail(page: Page): Promise { - const closeButton = page.locator('.player-toolbar .close-btn').first(); - - await expect(closeButton).toBeVisible({ timeout: 20000 }); - await closeButton.click(); +async function expectUnifiedLiveDetailOpen( + page: Page, + title: string +): Promise { + await expect( + page + .locator('app-unified-live-tab .content-container .video-player') + .first() + ).toBeVisible({ timeout: 20000 }); + await expect(channelItemByTitle(page, title).first()).toHaveClass( + /(^|\s)active(\s|$)/ + ); } async function goBackFromDetail(page: Page): Promise { diff --git a/apps/electron-backend-e2e/src/xtream-epg.e2e.ts b/apps/electron-backend-e2e/src/xtream-epg.e2e.ts index 25b6f139d..e3e83b706 100644 --- a/apps/electron-backend-e2e/src/xtream-epg.e2e.ts +++ b/apps/electron-backend-e2e/src/xtream-epg.e2e.ts @@ -108,7 +108,7 @@ for (const timeZone of ['UTC', 'Europe/Berlin'] as const) { `${formatTimeInZone( currentProgram.startTimestamp, timeZone - )} - ${formatTimeInZone(currentProgram.stopTimestamp, timeZone)}` + )}–${formatTimeInZone(currentProgram.stopTimestamp, timeZone)}` ); const firstFutureDateKey = getFirstFutureDateKey(