test(e2e): update player close button references and enhance visibility checks

Entire-Checkpoint: c2cea9c530e6
This commit is contained in:
4gray committed 2026-04-30 19:49:18 +02:00
1 parent 4b2076fa53
commit e9a36b55ff
3 files changed
+30 -13

No files matched your search

@@ -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$/);
+20 -11
View File
@@ -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<void> {
await page.getByRole('button', { name: 'Yes' }).click();
}
async function closeUnifiedLiveDetail(page: Page): Promise<void> {
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<void> {
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<void> {
@@ -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(