Skip to content

fix(cli): improve smoke test image validation with 404 checks and filepath detection#15666

Open
thesandlord wants to merge 2 commits intomainfrom
devin/1777898739-fix-smoke-test-image-assertions
Open

fix(cli): improve smoke test image validation with 404 checks and filepath detection#15666
thesandlord wants to merge 2 commits intomainfrom
devin/1777898739-fix-smoke-test-image-assertions

Conversation

@thesandlord
Copy link
Copy Markdown
Contributor

Description

Replaces the unreliable naturalWidth > 0 check in the docs preview smoke test with more robust image validation that will actually catch broken images on Windows.

Changes Made

  • Network-level 404 detection: Intercepts all HTTP responses and requestfailed events during page load to catch image requests that return 4xx/5xx or fail at the network level
  • Filesystem path pattern detection: Extracts looksLikeFilesystemPath() helper that checks for:
    • file:/// protocol leaks
    • Windows drive letters (C:/, D:\)
    • URL-encoded backslashes (%5C)
    • Raw backslashes
    • Unresolved file:<uuid> references (frontend failed to map to a URL)
  • Removed naturalWidth check which could pass even when images fail to render correctly (e.g., browser placeholder icons have non-zero dimensions)
  • Changed waitUntil from "domcontentloaded" to "load" to ensure images have had time to start loading before we check network responses

Testing

  • Manual review of test logic
  • The smoke test CI workflow runs on ubuntu-latest, macos-latest, and windows-latest — the improved assertions will surface any image resolution failures that the old naturalWidth check was masking

Link to Devin session: https://app.devin.ai/sessions/33e519fd68c24507b26161112fbb6d74
Requested by: @thesandlord

…epath detection

Replace unreliable naturalWidth checks with:
- Network-level interception to catch 404s and failed image requests
- Filesystem path pattern detection (drive letters, backslashes, file:// protocol, unresolved file:<uuid> references)

Co-Authored-By: Sandeep Dinesh <sandeep@buildwithfern.com>
Copy link
Copy Markdown

@claude claude Bot left a comment

Choose a reason for hiding this comment

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

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review to trigger a review and subscribe this PR to future pushes, or @claude review once for a one-time review.

Tip: disable this comment in your organization's Code Review settings.

@devin-ai-integration
Copy link
Copy Markdown
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

Co-Authored-By: Sandeep Dinesh <sandeep@buildwithfern.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant