Skip to content

Resolving delete payment flakiness - #8859

Open
RubenGeo with Copilot wants to merge 4 commits into
mainfrom
copilot/fix-flaky-test-issue
Open

RubenGeo with Copilot wants to merge 4 commits into
mainfrom
copilot/fix-flaky-test-issue

Conversation

Copilot AI commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

AB#44671

Describe your changes

  • Stabilized PaymentPage action menu operations (deletePayment, renamePayment, isDeletePaymentButtonVisible) by introducing an idempotent openActionsMenu() helper that retries until the menu is open.
  • Wrapped isDeletePaymentButtonVisible() in expect(...).toPass({ timeout: 15_000 }) to eliminate race conditions between menu toggle animations and DOM visibility assertions.
  • Removed brittle validateBadgeIsPresentByLabel({ badgeName: 'Approved', count: 1 }) assertion in DeletePayment.spec.ts which was susceptible to transient timing issues, relying on the toast confirmation and 'start' button visibility instead.

Checklist before requesting a code review

  • I have performed a self-review of my code
  • I have addressed all Copilot comments
  • I have asked the design team to review these changes, or: The changes do not touch the UI/UX
  • I have added tests for my changes, or: Adding tests is unnecessary/irrelevant
  • I have made sure that all automated checks pass before requesting a review
  • I have updated all documentation where necessary
  • I have checked the list of integrations with the 121 API for changed endpoints
  • I do not need any deviation from our PR guidelines

Portal preview-deployment

This PR does not have any preview deployments yet.

Copilot AI and others added 3 commits September 16, 2026 17:04
Co-authored-by: RubenGeo <34537157+RubenGeo@users.noreply.github.com>
Co-authored-by: RubenGeo <34537157+RubenGeo@users.noreply.github.com>
Co-authored-by: RubenGeo <34537157+RubenGeo@users.noreply.github.com>
Copilot AI requested a review from RubenGeo September 17, 2026 09:40
@RubenGeo RubenGeo changed the title Resolving flakiness in end-to-end tests Resolving delete payment flakiness Sep 17, 2026
@RubenGeo
RubenGeo marked this pull request as ready for review September 17, 2026 11:03
Copilot AI lite review requested due to automatic review settings September 17, 2026 11:03
@RubenGeo RubenGeo added the chore Something that does not affect the end user label Sep 17, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

Scope the action-menu locator to the payment menu before approval.

Pull request overview

Improves portal payment E2E stability by retrying action-menu interactions and removing a flaky approval-badge assertion.

Changes:

  • Adds retryable payment action-menu opening.
  • Reuses the helper for delete and rename flows.
  • Removes the flaky approval-badge check.
  • The payment menu locator needs scoping to the correct menu.
File summaries
File Description
e2e/portal/tests/ViewPayment/DeletePayment.spec.ts Removes the flaky badge check.
e2e/portal/pages/PaymentPage.ts Adds resilient action-menu handling.
Review details

Suppressed comments (1)

e2e/portal/pages/PaymentPage.ts:125

  • last() is not tied to the payment actions menu. The transaction-list page also renders QueryTable's extraOptionsMenu after the payment layout, so this locator can resolve to that table menu; the retry may then return because an unrelated menu is visible or wait for a menu that the ellipsis button never opened. Scope this locator to a menu containing the payment action items (or otherwise anchor it to the ellipsis component) before using it for delete/rename checks.
      const actionsMenu = this.page.getByRole('menu').last();
  • Files reviewed: 2/2 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

Scope the menu locator to payment action items to avoid selecting the export menu.

Review details

Suppressed comments (1)

e2e/portal/pages/PaymentPage.ts:125

  • This page also renders the export p-menu, so this page-wide locator can resolve to an already-open export menu. In that case isVisible() returns true and the helper skips clicking the ellipsis button, after which the Delete/Rename lookup fails. Scope the locator to a menu containing the payment action items rather than selecting the last generic menu.
      const actionsMenu = this.page.getByRole('menu').last();
  • Files reviewed: 2/2 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

@RubenGeo
RubenGeo requested a lite review from Copilot September 17, 2026 15:57
@RubenGeo RubenGeo added the ignore-for-release PRs marked with this label will be ignored from auto-generated release notes label Sep 17, 2026
@RubenGeo
RubenGeo enabled auto-merge September 17, 2026 15:58

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Scope the action-menu locator to support roles without the rename permission.

Get a fresh assessment by requesting another Copilot review.

Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 1
  • Review effort level: Lite

Comment on lines +125 to +127
const actionsMenu = this.page.getByRole('menu').filter({
has: this.page.getByRole('menuitem', { name: 'Rename payment' }),
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore Something that does not affect the end user ignore-for-release PRs marked with this label will be ignored from auto-generated release notes

Development

Successfully merging this pull request may close these issues.

3 participants