Skip to content

checkout-check: walk no-grid shops via category archive or product link - #298

Merged
jasperf merged 1 commit into
mainfrom
fix/checkout-check-no-grid-fallbacks
Nov 17, 2026
Merged

jasperf merged 1 commit into
mainfrom
fix/checkout-check-no-grid-fallbacks

Conversation

@jasperf

@jasperf jasperf commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

checkout-check no longer aborts its walk on a store whose shop page shows no product grid, resolving #293. Some production stores make the shop landing a curated or order-form page (page-builder stores especially): step 1 failed with no products listed and every later step was skipped, even though the store was walkable via its category archives and product pages.

No-grid fallback chain (step 1):

  • When the grid selector finds nothing, the step now probes the first product-category archive the shop page links to. If that archive lists products, it acts as the shop for the remaining steps — step 2 loads it and step 3 takes a product from it, so the run goes fully green with no flags.
  • Otherwise it uses any a[href*="/product/"] link on the page as the product source.
  • --product and --category keep priority throughout and only become necessary when the page has neither; the existing SKIP behavior then applies unchanged.

Relative-href fix (steps 2 and 3):

  • Discovered category/product hrefs are now resolved against the base URL via the existing abs() helper. A relative href was passed straight to page.goto before, which failed with Cannot navigate to invalid URL — exposed by the fake-store test below.

Docs:

  • scripts/README.md and the script header no longer tell operators to pass --product for every order-form shop; the fallback handles it unless the page has no product or category links at all.

Verification (run on this branch):

  • node --check scripts/monitoring/checkout-check.js — clean; go test ./... passes.
  • End-to-end smoke test against a local static store with a no-grid landing page (welcome heading, one category link, one product link, grid only on the category archive):
    • Old behavior: FAIL 1. shop page — no products listed, everything else skipped.
    • New behavior: PASS 1. shop page — no product grid on the shop page; 3 products on a category archive, PASS 2. category page — 3 products listed; step 3 proceeded to the product URL as expected (the fake server has no product page, so the HTTP 404 there is the test fixture, not the tool).
    • Product-link-only variant (no category link): PASS 1. shop page — no product grid on the shop page; using a product link from it.
  • Read-only risk areas: none — the walk places no order without --place-order, unchanged.

Files changed (3):

  • scripts/monitoring/checkout-check.js
  • scripts/README.md
  • CHANGELOG.md

…link

A shop landing that is an order form or a curated page made step 1
fail with 'no products listed' and skip the whole walk. When the grid
selector finds nothing, fall back first to the product-category
archive the page links to - when it lists products it acts as the
shop - then to any product link on the page. --product and --category
keep priority and are only needed when the page has neither. Steps 2
and 3 now resolve the discovered hrefs against the base URL; relative
hrefs were invalid page.goto targets before.

Resolves #293.
@jasperf
jasperf merged commit 054ded6 into main Nov 17, 2026
2 checks passed
@jasperf
jasperf deleted the fix/checkout-check-no-grid-fallbacks branch November 17, 2026 04:49
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