diff --git a/apps/electron-backend-e2e/src/dashboard-activation.e2e.ts b/apps/electron-backend-e2e/src/dashboard-activation.e2e.ts index 0b99de0f4..ed9ded21b 100644 --- a/apps/electron-backend-e2e/src/dashboard-activation.e2e.ts +++ b/apps/electron-backend-e2e/src/dashboard-activation.e2e.ts @@ -254,13 +254,18 @@ async function goBackFromDetail(page: Page): Promise { } } +// By accessible name, not class: the Xtream movie detail's favorite control is +// an icon-only button that carries its label in aria-label, while series and +// Stalker details still use the labeled variant. This matches both. async function addCurrentDetailToFavorites(page: Page): Promise { - const addButton = page.locator('button.favorite-btn').first(); + const addButton = page + .getByRole('button', { name: /add to favorites/i }) + .first(); await expect(addButton).toBeVisible({ timeout: 20000 }); await addButton.click(); await expect( - page.locator('button.favorite-btn--active').first() + page.getByRole('button', { name: /remove from favorites/i }).first() ).toBeVisible({ timeout: 20000, }); diff --git a/apps/electron-backend-e2e/src/favorites.e2e.ts b/apps/electron-backend-e2e/src/favorites.e2e.ts index 4db9c3edc..dcea53471 100644 --- a/apps/electron-backend-e2e/src/favorites.e2e.ts +++ b/apps/electron-backend-e2e/src/favorites.e2e.ts @@ -576,13 +576,18 @@ const xtreamCredentials = { password: defaultXtreamPassword, }; +// By accessible name, not class: the Xtream movie detail's favorite control is +// an icon-only button that carries its label in aria-label, while series and +// Stalker details still use the labeled variant. This matches both. async function addCurrentDetailToFavorites(page: Page): Promise { - const addButton = page.locator('button.favorite-btn').first(); + const addButton = page + .getByRole('button', { name: /add to favorites/i }) + .first(); await expect(addButton).toBeVisible({ timeout: 20000 }); await addButton.click(); await expect( - page.locator('button.favorite-btn--active').first() + page.getByRole('button', { name: /remove from favorites/i }).first() ).toBeVisible({ timeout: 20000, }); diff --git a/apps/electron-backend-e2e/src/search.e2e.ts b/apps/electron-backend-e2e/src/search.e2e.ts index dc96e4b45..974e7c17c 100644 --- a/apps/electron-backend-e2e/src/search.e2e.ts +++ b/apps/electron-backend-e2e/src/search.e2e.ts @@ -1524,19 +1524,18 @@ async function expectXtreamRootCatalogSearch( ); } +// By accessible name, not class plus visible text: the Xtream movie detail's +// favorite control is an icon-only button whose label lives in aria-label, +// while series and Stalker details still use the labeled variant. async function addCurrentDetailToFavorites(page: Page): Promise { const addButton = page - .locator('button.favorite-btn') - .filter({ hasText: /Add to favorites/i }) + .getByRole('button', { name: /add to favorites/i }) .first(); await expect(addButton).toBeVisible({ timeout: 20000 }); await addButton.click(); await expect( - page - .locator('button.favorite-btn.favorite-btn--active') - .filter({ hasText: /Remove from favorites/i }) - .first() + page.getByRole('button', { name: /remove from favorites/i }).first() ).toBeVisible({ timeout: 20000 }); } diff --git a/apps/electron-backend-e2e/src/xtream-vod-details.e2e.ts b/apps/electron-backend-e2e/src/xtream-vod-details.e2e.ts index b1565689c..cda0f7f52 100644 --- a/apps/electron-backend-e2e/src/xtream-vod-details.e2e.ts +++ b/apps/electron-backend-e2e/src/xtream-vod-details.e2e.ts @@ -93,11 +93,16 @@ test.describe('Xtream VOD Details', () => { .locator('button.play-btn') .first(); await expect(playButton).toBeVisible(); + // Both secondaries are icon-only on the movie detail now. await expect( - app.mainWindow.locator('button.favorite-btn').first() + app.mainWindow + .locator('[data-testid="vod-favorite-toggle"]') + .first() ).toBeVisible(); await expect( - app.mainWindow.locator('button.download-btn').first() + app.mainWindow + .locator('[data-testid="vod-download-start"]') + .first() ).toBeVisible(); const movieResponsePromise = app.mainWindow.waitForResponse(