Skip to content

Keep Cypress E2E running past a storefront SyntaxError - #12

Open
chrsmutti wants to merge 6 commits into
mainfrom
fix/ignore-storefront-syntaxerror
Open

Keep Cypress E2E running past a storefront SyntaxError#12
chrsmutti wants to merge 6 commits into
mainfrom
fix/ignore-storefront-syntaxerror

Conversation

@chrsmutti

Copy link
Copy Markdown
Contributor

What problem is this solving?

The biggy storefront HTML injects a recsys snippet whose API key is interpolated away. That leaves an unterminated string and Cypress 8 fails every spec in before():

SyntaxError: Unexpected identifier

That happens with VTEX_WORKSPACE=chrs, master, and no workspace, so it is not a linked-app issue. After ignoring only that exception, the specs still failed on 2022 catalog counts, stale selectors, and visitPath() building http:// URLs against an HTTPS baseUrl.

How to test it?

yarn cypress run --env VTEX_WORKSPACE=master
yarn cypress run --env VTEX_WORKSPACE=chrs

Both suites passed locally at 29/29 after these changes (Electron).

Daily E2E (after merge to main): Actions → Daily Cypress E2E → Run workflow. Failures post to #search-personalization-alerts via the SLACK_WEBHOOK repo secret (Slack workflow trigger). A test event was already delivered to that channel.

Workspace

Screenshots or example usage:

Ignored storefront exception (narrow match only):

if (
  err.name === 'SyntaxError' &&
  err.message.includes('Unexpected identifier')
) {
  return false
}

Full-text search used to require exactly 3 gallery items; the page now shows 8 organic products plus sponsored tiles. The spec now checks that results exist and the reported total is > 0.

Describe alternatives you've considered, if any.

Fixing the recsys snippet on the storefront would be the real root-cause fix. This repo can only keep E2E from aborting on that app exception.

Related to / Depends on

Repo secret SLACK_WEBHOOK is already set on vtex/search-tests. The daily workflow Slack variables are status, text, and run_url.

How does this PR make you feel? 🔗

Made with Cursor

Cypress 8 was aborting every spec on a malformed recsys snippet in the biggy HTML, and the remaining assertions were tied to 2022 product and facet numbers. Daily E2E now posts failures to Slack via the repo webhook secret.

Co-authored-by: Cursor <cursoragent@cursor.com>
@vtex-pr-sentinel

vtex-pr-sentinel Bot commented Aug 25, 2026

Copy link
Copy Markdown

🛡️ SDD Check — action required

I couldn't detect an SDD in this PR. Please check one option below (requires write access to the repo):

  • SDD lives in another PR — paste the SDD PR URL here:
  • This PR doesn't need an SDD
  • SDD applies, but I'm not adopting it in this PR

chrsmutti and others added 3 commits August 25, 2026 20:32
GitHub now fails workflows that still use cache v1/v2, which blocked lint and IO app test on this PR.

Co-authored-by: Cursor <cursoragent@cursor.com>
The missing-application-id gate needs referenceId on the deployment file, and Danger requires an Unreleased changelog entry.

Co-authored-by: Cursor <cursoragent@cursor.com>
chrsmutti and others added 2 commits August 25, 2026 20:47
Co-authored-by: Cursor <cursoragent@cursor.com>
…deps.

Self-hosted images do not ship yarn or Cypress' system libraries, unlike
the GitHub-hosted ones.

Co-authored-by: Cursor <cursoragent@cursor.com>
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