From 20f001f31b183f30e4acf43cdf1e97d92bfdd1c3 Mon Sep 17 00:00:00 2001 From: Karoline Tufte Lien Date: Mon, 31 Aug 2026 14:58:02 +0200 Subject: [PATCH] test: de-flake slideshow Cypress spec Swap the text-based "Slideshow" button selector for the existing data-test="enter-slideshow-button" hook, and add a .should('not.be.disabled') guard before clicking it, since the button can be legitimately disabled offline/embedded/before items load and realClick() can silently no-op on a disabled button. The cy.wait(11000) calls in the autoplay test are kept as-is: they assert the slide has NOT yet changed before the real 10s autoplay timer fires, which a retrying assertion would not correctly verify. AI Assisted --- cypress/integration/slideshow.cy.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/cypress/integration/slideshow.cy.js b/cypress/integration/slideshow.cy.js index f239e2254..03cd1b01e 100644 --- a/cypress/integration/slideshow.cy.js +++ b/cypress/integration/slideshow.cy.js @@ -116,7 +116,9 @@ describe('Slideshow functionality', () => { assertNormalViewIsShown() // Click the slideshow button - cy.get('button').contains('Slideshow').realClick() + cy.getByDataTest('enter-slideshow-button') + .should('not.be.disabled') + .realClick() // Assert fullscreen mode is shown assertSlideshowControlbar() @@ -211,7 +213,9 @@ describe('Slideshow functionality', () => { assertNormalViewIsShown() // Click the slideshow button - cy.get('button').contains('Slideshow').realClick() + cy.getByDataTest('enter-slideshow-button') + .should('not.be.disabled') + .realClick() // Assert fullscreen mode is shown assertSlideshowControlbar() @@ -240,7 +244,7 @@ describe('Slideshow functionality', () => { // eslint-disable-next-line cypress/no-unnecessary-waiting cy.wait(11000) // Wait for the autoplay to switch to the next item - // // Assert item 2 is shown after autoplay starts + // Assert item 2 is shown after autoplay starts assertOnlyItem2IsVisible() // eslint-disable-next-line cypress/no-unnecessary-waiting