Skip to content

fix: stabilize flaky checkout UI tests + quarantine geo Error Finishing test#202

Merged
fdaciuk merged 12 commits into
mainfrom
fix/scheduled-tests
Jun 9, 2026
Merged

fix: stabilize flaky checkout UI tests + quarantine geo Error Finishing test#202
fdaciuk merged 12 commits into
mainfrom
fix/scheduled-tests

Conversation

@jeffersontuc

@jeffersontuc jeffersontuc commented May 28, 2026

Copy link
Copy Markdown
Contributor

Summary

We had recent Localization changes on the checkout-confirmation-ui, so this PR updates the scheduled tests accordingly.

image

Test scenarios


Flaky / failing test stabilization

This branch also stabilizes the failing & flaky checkout UI tests. Each fix was validated individually against the stable env with --config retries=0, then the full suite was run in batches (255/255 specs → 254 green, 1 quarantined).

Highlights (each validated with repeated clean runs):

  • CHK-2201 — after toggling the shipping-preview to delivery with no delivery address set, the SRP renders a clickable address link (.srp-address-title, showing "null") instead of an open input; the test now clicks it to reveal #ship-addressQuery before typing.
  • Delivery_Scheduled Pickup — a race in the pickup modal could commit the wrong (default) store; added settle waits to the shared chooseFirstPickupPoint.
  • Delivery - Geolocation Input / Boleto — the post–force-shipping-fields re-entry relied on the live Google geocode (which intermittently dropped the house number, blocking the advance to payment); now stubs GetPlaceDetails for a deterministic address and conditionally fills #ship-number.
  • Earlier completePurchase / confirmPaymentApp / datepicker / Peru-cascade hardening.

⏸️ Quarantined test — why we're skipping it

Payment - Credit card - Error Finishing Transaction"should validate form fields after error", geolocation account (vtexgame1geo) only. Skipped via it.skip — the other accounts still run.

It is skipped because it fails due to a pre-existing app defect, not a test bug:

  • After a declined payment, closing the Bootstrap modal triggers an infinite focus recursionRangeError: Maximum call stack size exceeded (Bootstrap 2.3.2 enforceFocus ↔ jQuery 1.8.3). The checkout then gets stuck "finalizando sua compra" with the buy button display:none, so completePurchase never finds the submit button.
  • Measured pass rate on geo: ~20% isolated (1/5), and only ~49% even with CI's 3 retries (0/3 under full-suite load) — so retries don't mask it; it flaps the panel red ~half the time.
  • Only the geo variant is quarantined. vtexgame1 / clean pass; invoice / nolean are flaky-but-pass (same modal, same family).

Action item (Checkout team): fix the modal focus recursion, then remove the it.skip for vtexgame1geo to re-enable the test.

@jeffersontuc jeffersontuc requested a review from a team as a code owner May 28, 2026 14:31
fdaciuk added 5 commits June 9, 2026 13:15
Test-code fixes from PLANO_CORRECAO.md, each validated by running its spec(s)
individually against the stable env.

- completePurchase: assert `be.enabled` instead of the subject-changing
  `not.have.attr,'disabled'` (which yielded undefined to .click()); single
  chained get with a 30s timeout.
- confirmPaymentApp: wait for the confirm button to be visible, then force-click
  past the .modal-backdrop fade-in animation.
- chooseDate: locate the scheduled datepicker button by scoping to the toggle's
  .vtex-omnishipping-1-x-scheduledDeliveryList group instead of a name-based id
  substring filter that never matched the pickup button; click the first
  available day rather than the possibly-disabled --keyboard-selected one.
- Delivery - Peru: stabilize the async state>city>neighborhood>street>number
  cascade (no detaching assertion on the neighborhood select; commit street and
  number via blur without force; settle the shipping recompute before going to
  payment).
Continues PLANO_CORRECAO.md (B2 + C). Each spec validated individually
against the stable env with `--config retries=0`.

- Pickup Peru (nogeo): the orderPlaced page renders in Spanish, so the pickup
  label is "Recogida", not the Brazilian-Portuguese "Retirar". Add
  PICKUP_TEXT_ES and assert it. The order was always placed correctly as
  pickup; this was a locale assertion bug, not a pickup race.

- pac-item: add waitForPacItems()/selectPacItem(matchText?) and replace the
  blind `cy.get('.pac-item').first()` calls. They wait for the Places dropdown
  to render and stabilize before selecting, re-query between hover and click,
  and (with text) pick a specific prediction. Text-match only where the string
  is ASCII-stable (Saint Roman, Javier Prado, Irigoyen); first-item elsewhere
  and in stub tests (GetPlaceDetails is stubbed, so any item works) — there the
  interceptAutoCompleteResponse call now precedes the selection. chk-2201 keeps
  .eq(1)/.first() intentionally and just gains waitForPacItems.

- Unblocking pac-item let several specs progress into later timing layers,
  fixed with the same pattern as Delivery - Peru:
  - goToPayment: re-assert visibility immediately before the click so a late
    shippingData recompute that re-renders/detaches the button is retried
    instead of throwing "detached from the DOM".
  - Delivery - No number / Delivery - Peru (geo) / Paraguay: commit the last
    field with .blur() + cy.wait(3000) so the recompute settles before
    advancing; Paraguay also waits for #ship-receiverName to be enabled, since
    it is transiently disabled mid-recompute.
chooseFirstPickupPoint clicked .first() and confirmed without waiting for
the modal's click -> confirm -> commit cycle to settle, so the confirm
intermittently committed the modal's default point (the free Botafogo) instead
of the clicked closest point (Copacabana). This placed orders at the wrong
pickup store and failed the 'Loja em Copacabana' assertions in the pickup
tests (Delivery_Scheduled Pickup and siblings).

Add settles after the point click and after confirm in the shared helper.
Validated 5/5 clean runs of 'Delivery_Scheduled Pickup - vtexgame1'.

Also gitignore .playwright-mcp (browser MCP artifacts).
Closes the last two residuals from PLANO_CORRECAO.md. Each validated
individually against the stable env 5x with `--config retries=0`.

- CHK-2201: after toggling the shipping-preview to delivery with no
  delivery address set, the SRP renders a clickable address link
  ("null"), not an open input. Click `.srp-address-title` to open the
  editor before typing into #ship-addressQuery. The test had assumed the
  input appeared directly after the toggle (older SRP behavior); it was
  failing 2/2, not flaky.

- Delivery - Geolocation Input: the second address entry (after
  #force-shipping-fields) relied on the live Google geocode to fill the
  house number, but it intermittently resolved to a street-level result
  with no number, leaving #ship-number empty so shipping validation
  blocked the advance to payment and the Boleto group never appeared.
  Stub GetPlaceDetails (deterministic city/state matching the existing
  "La Capital, Santa Fe" assertion) and fill #ship-number explicitly when
  the editable input is present (the number's binding to the field is
  flaky: when it binds the form collapses to a summary, when it doesn't
  the input stays empty). Extracted the shared entry into a helper.
… app bug)

The geolocation variant of "should validate form fields after error"
fails ~half the time even with CI retries due to a pre-existing app
defect (not a test bug): closing the declined-payment Bootstrap modal in
this flow triggers an infinite focus recursion — RangeError: Maximum
call stack size exceeded (Bootstrap 2.3.2 enforceFocus + jQuery 1.8.3) —
that leaves the checkout stuck "finalizing" with the buy button hidden,
so completePurchase can't find the submit button.

Measured geo pass rate: ~20% isolated (1/5), ~49% even with 3 retries,
0/3 under full-suite load. Other accounts are unaffected (vtexgame1/clean
pass; invoice/nolean flaky-but-pass, same root cause).

Skip only the geo `it` via it.skip; re-enable once the Checkout app bug
is fixed.
@fdaciuk fdaciuk changed the title fix: update SCHEDULED_TEXT constant value fix: stabilize flaky checkout UI tests + quarantine geo Error Finishing test Jun 9, 2026
@fdaciuk fdaciuk requested review from a team and fdaciuk and removed request for fdaciuk June 9, 2026 18:29
Comment thread CHANGELOG.md

## [Unreleased]

## [0.19.17] - 2026-05-29

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.

Acho que falta adicionar um Changelog aqui para lançar uma versão com as novas mudanças.

@fdaciuk fdaciuk requested a review from carolkrroo June 9, 2026 20:13

@carolkrroo carolkrroo 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.

:shipit:

@fdaciuk fdaciuk removed their request for review June 9, 2026 20:16
@fdaciuk fdaciuk merged commit 0906d0b into main Jun 9, 2026
3 of 5 checks passed
@fdaciuk fdaciuk deleted the fix/scheduled-tests branch June 9, 2026 20: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.

3 participants