Skip to content

fix ism e2e: dismissToast and failOnStatusCode for managed service - #2105

Merged
wanglam merged 1 commit into
opensearch-project:2.17from
aditi-1601:fix-ism-e2e-2.17
Jul 27, 2026
Merged

fix ism e2e: dismissToast and failOnStatusCode for managed service#2105
wanglam merged 1 commit into
opensearch-project:2.17from
aditi-1601:fix-ism-e2e-2.17

Conversation

@aditi-1601

@aditi-1601 aditi-1601 commented Jul 20, 2026

Copy link
Copy Markdown

Description

[Describe what this change achieves]
Fix ISM E2E Cypress tests. Toast notifications from ISM job interval/jitter updates block UI interactions in managed_indices_spec.js, causing subsequent tests to fail when trying to click elements behind the toast.

###Testing
Ran managed_indices_spec.js locally against OpenSearch 2.17.0 with ISM plugin:

Managed indices
can have policies removed
✓ successfully (21028ms)
can have policies retried
✓ successfully (37008ms)
can edit rollover_alias
✓ successfully (7946ms)
can change policies
✓ successfully (20119ms)
can manage data stream indices
✓ successfully (8832ms)

5 passing (2m)

Issues Resolved

[List any issues this PR will resolve]

Check List

  • Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Signed-off-by: Aditi Chaudhry <aditiac@amazon.com>
@github-actions

Copy link
Copy Markdown

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

🧪 No relevant tests
🔒 No security concerns identified
✅ No TODO sections
🔀 No multiple PR themes
⚡ No major issues detected

@github-actions

Copy link
Copy Markdown

PR Code Suggestions ✨

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Impact
General
Dismiss all toasts, not just first

When multiple toasts are shown simultaneously, only the first close button is
clicked, leaving other toasts visible which may cover elements needed by subsequent
assertions. Iterate over all matched close buttons to dismiss every toast.

cypress/utils/plugins/index-management-dashboards-plugin/commands.js [175-181]

 Cypress.Commands.add('dismissToast', () => {
   cy.get('body').then(($body) => {
-    if ($body.find(`[data-test-subj="toastCloseButton"]`).length) {
-      cy.get(`[data-test-subj="toastCloseButton"]`).click({ force: true });
+    const closeButtons = $body.find(`[data-test-subj="toastCloseButton"]`);
+    if (closeButtons.length) {
+      cy.get(`[data-test-subj="toastCloseButton"]`).each(($el) => {
+        cy.wrap($el).click({ force: true });
+      });
     }
   });
 });
Suggestion importance[1-10]: 5

__

Why: Valid improvement: iterating over all matched toast close buttons is more robust when multiple toasts appear simultaneously, though the original single-click approach may often be sufficient in practice.

Low

@wanglam
wanglam merged commit ab021db into opensearch-project:2.17 Jul 27, 2026
22 of 37 checks passed
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