test: guard against clicking disabled slideshow button (DHIS2-21933) - #3337
Merged
Conversation
Contributor
|
🚀 Deployed on https://pr-3337.dashboard.netlify.dhis2.org |
karolinelien
marked this pull request as ready for review
August 3, 2026 15:29
karolinelien
added a commit
that referenced
this pull request
Aug 4, 2026
Dumps a failed test's request log, console errors/warnings, and cookie/localStorage state via cy.task so it's visible in CI logs, to investigate the description.cy.js/slideshow.cy.js cross-spec flake (see PR #3337). Not for merging. AI Assisted
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
karolinelien
force-pushed
the
test/deflake-slideshow-cypress
branch
from
August 31, 2026 12:58
a2d47b7 to
20f001f
Compare
|
HendrikThePendric
approved these changes
Aug 31, 2026
HendrikThePendric
left a comment
Contributor
There was a problem hiding this comment.
As discussed with @karolinelien, while I do not expect this to help "de-flaking" very much, this is still a valid improvement. It's better to wait for the button to be enabled before clicking.
Perhaps it would be good to go with a slightly less ambitious PR title ;-)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



https://dhis2.atlassian.net/browse/DHIS2-21933
Description
Small hardening fix for
cypress/integration/slideshow.cy.js:Swaps the text-based
cy.get('button').contains('Slideshow')selector for the button'sexisting
data-test="enter-slideshow-button"hook, and adds a.should('not.be.disabled')guard before clicking it. The button can be legitimately disabled offline/embedded/before
items load, and
.should('not.be.disabled')makes Cypress retry until it's enabled insteadof risking
realClick()silently no-op'ing on a disabled button.The two
cy.wait(11000)calls in the autoplay test are kept as-is: they assert the slide hasnot yet changed before the real 10s autoplay timer fires, which a retrying assertion
wouldn't correctly verify, so a fixed wait is the right tool there.
No production code (
src/) changed. Not a fix for the broader Cypress suite flakiness —just a small, targeted improvement to this one selector.
Quality checklist
ToDos
Known issues
Screenshots
supporting text
AI Assisted