Skip to content

Verify add-only requested quantity - #4313

Open
Ji-One1 wants to merge 2 commits into
jb/storefront-e2e-v2-04-standard-eventsfrom
jb/storefront-e2e-v2-06-add-assertion
Open

Ji-One1 wants to merge 2 commits into
jb/storefront-e2e-v2-04-standard-eventsfrom
jb/storefront-e2e-v2-06-add-assertion

Conversation

@Ji-One1

@Ji-One1 Ji-One1 commented Nov 5, 2026 •

Copy link
Copy Markdown
Collaborator

An agent's completion claim cannot prove that an item reached the cart. The add-only scenario needs a code assertion that separates a wrong cart from an unconfirmed agent attempt.

What this changes

  • Prepare the scenario with catalog discovery and a product URL under the supplied storefront base path.
  • Ask the buyer to select the pinned options, add exactly one unit, and stop without opening the cart or checkout. Store strings are quoted as data.
  • Pass when the pinned variant's quantity across all session-cart lines is exactly one. Report other lines without rejecting them.
  • Fail a wrong cart only after a confirmed attempt: buyer completion or a settled matching Standard Event add. Otherwise return indeterminate. A captured checkout handoff is diagnostic only; it does not confirm an add or prove cart state.
  • Report an add rejection only when at least one pinned add settled and every matching settled response has cart userErrors. A response without those errors prevents a rejection-only failure, regardless of settlement order. Valid cart proof still passes; cart read errors remain inconclusive.

Developer impact

Internal tooling only; no published Hydrogen changes or changeset. This adds the scenario and registry, not the concrete cart reader or CLI.

Out of scope

No cart ID, getCart(), Storefront API cart query, DOM assertion, or analytics. Standard Events are attempt evidence, never cart references.

Risk

The cart reader must represent the same browser session. Browser market and cart country are not checked; the scenario records configured-only context.

Stack: 05/15. Previous: #4311. Next: #4314.

@Ji-One1
Ji-One1 force-pushed the jb/storefront-e2e-v2-05-cart-identity branch from f66f9b3 to e4c1268 Compare November 5, 2026 16:23
@Ji-One1
Ji-One1 force-pushed the jb/storefront-e2e-v2-06-add-assertion branch 2 times, most recently from 96d33e8 to 8993b83 Compare November 5, 2026 18:42
@Ji-One1
Ji-One1 force-pushed the jb/storefront-e2e-v2-05-cart-identity branch from 3726d9d to f7e0005 Compare November 6, 2026 00:01
@Ji-One1
Ji-One1 force-pushed the jb/storefront-e2e-v2-06-add-assertion branch 2 times, most recently from ef675fd to e5297a7 Compare November 6, 2026 01:36
@Ji-One1
Ji-One1 force-pushed the jb/storefront-e2e-v2-05-cart-identity branch from f7e0005 to a6b1a4f Compare November 6, 2026 01:36
@Ji-One1
Ji-One1 force-pushed the jb/storefront-e2e-v2-06-add-assertion branch from e5297a7 to 757c15b Compare November 6, 2026 01:45
@Ji-One1
Ji-One1 force-pushed the jb/storefront-e2e-v2-05-cart-identity branch 2 times, most recently from 22fa039 to 7a6ae96 Compare November 6, 2026 14:27
@Ji-One1
Ji-One1 force-pushed the jb/storefront-e2e-v2-06-add-assertion branch 2 times, most recently from 1b63035 to 3a5d4ff Compare November 6, 2026 15:08
@Ji-One1
Ji-One1 force-pushed the jb/storefront-e2e-v2-05-cart-identity branch from 7a6ae96 to 13e6688 Compare November 6, 2026 15:08
@Ji-One1
Ji-One1 force-pushed the jb/storefront-e2e-v2-06-add-assertion branch from 3a5d4ff to 9f63be1 Compare November 6, 2026 16:20
@Ji-One1
Ji-One1 force-pushed the jb/storefront-e2e-v2-05-cart-identity branch from 13e6688 to 1f1749c Compare November 6, 2026 16:20
@Ji-One1
Ji-One1 force-pushed the jb/storefront-e2e-v2-05-cart-identity branch from 1f1749c to a31003c Compare November 6, 2026 19:01
@Ji-One1
Ji-One1 force-pushed the jb/storefront-e2e-v2-06-add-assertion branch from 9f63be1 to 194738f Compare November 6, 2026 19:01
@Ji-One1
Ji-One1 force-pushed the jb/storefront-e2e-v2-05-cart-identity branch from a31003c to bd47b2e Compare November 6, 2026 20:01
@Ji-One1
Ji-One1 force-pushed the jb/storefront-e2e-v2-06-add-assertion branch from 194738f to 0caec02 Compare November 6, 2026 20:01
@Ji-One1
Ji-One1 force-pushed the jb/storefront-e2e-v2-05-cart-identity branch from bd47b2e to d94d8f0 Compare November 6, 2026 20:32
@Ji-One1
Ji-One1 force-pushed the jb/storefront-e2e-v2-06-add-assertion branch from 0caec02 to 82d9bf1 Compare November 6, 2026 20:32
@Ji-One1
Ji-One1 force-pushed the jb/storefront-e2e-v2-05-cart-identity branch from d94d8f0 to a6cd510 Compare November 9, 2026 00:01
@Ji-One1
Ji-One1 force-pushed the jb/storefront-e2e-v2-06-add-assertion branch 2 times, most recently from 1de4e2c to 6958252 Compare November 9, 2026 00:37
@Ji-One1
Ji-One1 force-pushed the jb/storefront-e2e-v2-05-cart-identity branch from 4daf6f6 to 975536f Compare November 9, 2026 04:23
@Ji-One1
Ji-One1 force-pushed the jb/storefront-e2e-v2-06-add-assertion branch from 6958252 to 4626db0 Compare November 9, 2026 04:23
@Ji-One1
Ji-One1 force-pushed the jb/storefront-e2e-v2-06-add-assertion branch from 4626db0 to c348e93 Compare November 9, 2026 06:55
@Ji-One1
Ji-One1 changed the base branch from jb/storefront-e2e-v2-05-cart-identity to jb/storefront-e2e-v2-04-standard-events November 9, 2026 06:55
@Ji-One1
Ji-One1 marked this pull request as ready for review November 9, 2026 07:11
@Ji-One1
Ji-One1 requested a review from a team as a code owner November 9, 2026 07:12

This branch has not been deployed

No deployments
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.

1 participant