Skip to content

fix(e2e): decouple smoke home test from featured collection image#3797

Merged
lucyxiang merged 1 commit into
mainfrom
fix-e2e-smoke-home-featured-collection
Jun 10, 2026
Merged

fix(e2e): decouple smoke home test from featured collection image#3797
lucyxiang merged 1 commit into
mainfrom
fix-e2e-smoke-home-featured-collection

Conversation

@lucyxiang

@lucyxiang lucyxiang commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Problem

[smoke] home.spec.ts was failing on main because it asserted the home hero's collection image. The hero is the most-recently-updated collection (sortKey: UPDATED_AT) and its image is optional. A bulk collection update in the preview store left every collection tied on updatedAt, so the tie now surfaces Freeride, which has no image — the hero renders only its heading and the test times out.

Fix

Assert the collection heading (always present) instead of the optional image, per the "Dynamic Store Data" guidance in e2e/CLAUDE.md. The product-grid image assertion still covers Image rendering.

Test-only; no changeset.

@lucyxiang lucyxiang requested a review from a team as a code owner June 10, 2026 17:49
@shopify

shopify Bot commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Oxygen deployed a preview of your fix-e2e-smoke-home-featured-collection branch. Details:

Storefront Status Preview link Deployment details Last update (UTC)
Skeleton (skeleton.hydrogen.shop) ✅ Successful (Logs) Preview deployment Inspect deployment June 10, 2026 6:10 PM

Learn more about Hydrogen's GitHub integration.

Comment thread e2e/specs/smoke/home.spec.ts Outdated
.getByRole('img');

await expect(heroImage).toBeVisible();
await expect(featuredCollection).toBeVisible();

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.

Should we test the actual content of this? I'm not sure how valuable testing that an h1 is present on the page is.

@lucyxiang lucyxiang Jun 10, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

changing the e2e to assert on featured collection presence (via collection title) rather than collection image as image is optional (flakey)

The smoke home test asserted that the featured collection hero rendered an
`<img>`. The featured collection is the most-recently-updated collection in
the preview store (`sortKey: UPDATED_AT`), and its image is optional in the
template (`{image && ...}` in _index.tsx). When the newest collection has no
image (currently "Freeride"), the hero renders only its heading and the test
times out waiting for an image that is never present.

Assert the featured collection heading (`h1`, the collection title, which is
always present) instead, per the "Dynamic Store Data" guidance in
e2e/CLAUDE.md. The product grid image assertion still verifies Image rendering
against reliable product data.
@lucyxiang lucyxiang force-pushed the fix-e2e-smoke-home-featured-collection branch from 21cced7 to 3b5aad5 Compare June 10, 2026 18:08
@lucyxiang lucyxiang merged commit 7a293ff into main Jun 10, 2026
32 of 33 checks passed
@lucyxiang lucyxiang deleted the fix-e2e-smoke-home-featured-collection branch June 10, 2026 19:00
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.

2 participants