From 96fba73840e3b81b37cf521efadc597fdb824147 Mon Sep 17 00:00:00 2001 From: 4gray Date: Fri, 31 Jul 2026 18:03:08 +0200 Subject: [PATCH] test(downloads): stabilize offline detail selectors --- .../electron-backend-e2e/src/downloads.e2e.ts | 23 ++++++++++++++----- 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/apps/electron-backend-e2e/src/downloads.e2e.ts b/apps/electron-backend-e2e/src/downloads.e2e.ts index 43168535c..c08bd56f6 100644 --- a/apps/electron-backend-e2e/src/downloads.e2e.ts +++ b/apps/electron-backend-e2e/src/downloads.e2e.ts @@ -310,7 +310,12 @@ test.describe('Electron Downloads', () => { // Removing the finalized file must move the persisted completed // row out of Ready to watch when offline-detail playback refreshes // the authoritative list, then return to Needs attention. - await card.locator('.download-library__artwork-button').click(); + await card + .getByRole('button', { + name: 'Open details: E2E Movie', + exact: true, + }) + .click(); await app.mainWindow.waitForURL((url) => url.pathname.endsWith(`/workspace/downloads/${startResult?.id}`) ); @@ -334,9 +339,9 @@ test.describe('Electron Downloads', () => { }) ).toBeVisible(); await expect(missingRow).toBeVisible({ timeout: 20000 }); - await expect( - missingRow.locator('.download-queue__status') - ).toContainText('File missing'); + await expect(missingRow.getByRole('status')).toContainText( + 'File missing' + ); await expect(card).toHaveCount(0); await expect( missingRow.getByRole('button', { name: 'Play: E2E Movie' }) @@ -568,7 +573,10 @@ test.describe('Electron Downloads', () => { ); await installDownloadPlayCapture(app); await alphaMovieCard - .locator('.download-library__artwork-button') + .getByRole('button', { + name: 'Open details: Alpha Movie', + exact: true, + }) .click(); const expectedOfflinePath = `/workspace/xtreams/${sourceA}/downloads/${alphaMovieId}`; await app.mainWindow.waitForURL((url) => @@ -869,7 +877,10 @@ test.describe('Electron Downloads', () => { await expect(seriesCard).toBeVisible({ timeout: 30000 }); await expect(seriesCard).toContainText('2 episodes'); await seriesCard - .locator('.download-library__artwork-button') + .getByRole('button', { + name: `Open details: ${providerTitle}`, + exact: true, + }) .click(); await app.mainWindow.waitForURL((url) => url.pathname.endsWith(`/workspace/downloads/${thirdEpisodeId}`)