Skip to content

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

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

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

Conversation

@aditi-1601

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

Copy link
Copy Markdown

Description

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.13.0 with ISM plugin:
Managed indices
can have policies removed
✓ successfully (15014ms)
can have policies retried
✓ successfully (33231ms)
can edit rollover_alias
✓ successfully (6461ms)
can change policies
✓ successfully (15843ms)
can manage data stream indices
✓ successfully (8214ms)

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
Handle multiple toasts in dismiss command

When multiple toasts are visible, cy.get with a single selector will fail because it
matches multiple elements. Iterate over all close buttons to dismiss every toast
reliably, avoiding flaky test failures.

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 $buttons = $body.find(`[data-test-subj="toastCloseButton"]`);
+    if ($buttons.length) {
+      cy.get(`[data-test-subj="toastCloseButton"]`).each(($el) => {
+        cy.wrap($el).click({ force: true });
+      });
     }
   });
 });
Suggestion importance[1-10]: 7

__

Why: Valid improvement: cy.get on a selector matching multiple elements can fail in Cypress when clicking, so iterating with .each() makes the dismissToast command more robust when multiple toasts are visible.

Medium

@wanglam
wanglam merged commit a40cd18 into opensearch-project:2.13 Jul 27, 2026
21 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.

3 participants