Skip to content

INSTUI-4542 Improve Cypress test stability for low-resource environments#1979

Merged
git-nandor merged 1 commit intomasterfrom
fix_flaky_cypress_tests
May 29, 2025
Merged

INSTUI-4542 Improve Cypress test stability for low-resource environments#1979
git-nandor merged 1 commit intomasterfrom
fix_flaky_cypress_tests

Conversation

@git-nandor
Copy link
Contributor

…environments

@git-nandor git-nandor self-assigned this May 16, 2025
@github-actions
Copy link

github-actions bot commented May 16, 2025

PR Preview Action v1.6.1
Preview removed because the pull request was closed.
2025-05-29 11:16 UTC

@git-nandor git-nandor requested review from ToMESSKa, balzss and Copilot May 16, 2025 12:47
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR aims to improve the stability of Cypress tests in low-resource environments by introducing explicit waiting periods and updating test configurations. Key changes include:

  • Adding explicit cy.wait() calls in component tests (TextArea, Popover, Dialog, and DateInput2) to mitigate flakiness.
  • Commenting out one Popover test with a TODO note to convert it to an end-to-end regression test.
  • Updating Cypress configuration to include adjusted timeouts and test memory settings.

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
cypress/component/TextArea.cy.tsx Added a cy.wait(500) after triggering input to allow the textarea to update its height.
cypress/component/Popover.cy.tsx Commented out an outdated test and added wait periods between actions to improve focus testing.
cypress/component/Modal-test-2.cy.tsx Introduced new Modal tests with explicit waits to verify behavior on key events.
cypress/component/Modal-test-1.cy.tsx Removed duplicate Modal tests now present in Modal-test-2.
cypress/component/Dialog.cy.tsx Added waits after element clicks and tab presses to ensure correct focus management.
cypress/component/DateInput2.cy.tsx Added short waits after button clicks and popover actions to ensure stability.
cypress.config.ts Updated various timeout configurations and memory settings to better support low-resource environments.
Comments suppressed due to low confidence (1)

cypress/component/Popover.cy.tsx:189

  • [nitpick] Instead of a fixed wait after focusing, consider asserting the expected focus state to drive more reliable test behavior.
cy.contains('button', 'trigger btn initial focus me').focus().wait(200)

Copy link
Contributor

@balzss balzss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you try what copilot is suggesting?

@git-nandor git-nandor force-pushed the fix_flaky_cypress_tests branch from de9be40 to 59051e4 Compare May 26, 2025 11:41
@git-nandor git-nandor force-pushed the fix_flaky_cypress_tests branch from 59051e4 to bb6a517 Compare May 26, 2025 12:39
@git-nandor
Copy link
Contributor Author

can you try what copilot is suggesting?

Yes, the suggestions helped improve the tests for both DateInput2 and TextArea, but didn’t produce better results in all cases.

@git-nandor git-nandor requested a review from balzss May 26, 2025 12:49
@matyasf matyasf changed the title test(cypress tests): improve Cypress test stability for low-resource … INSTUI-4542 Improve Cypress test stability for low-resource environments May 28, 2025
@git-nandor git-nandor merged commit ef9dbcb into master May 29, 2025
8 checks passed
@git-nandor git-nandor deleted the fix_flaky_cypress_tests branch May 29, 2025 11:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants