test(webkit): wait for the settled copy after a streamed reload

Merged
BI
1mo ago
+16-12

User description

Summary

Before: main's Safari release matrix after #3497 (run 38268232173) still failed in three jobs. The DSM compare, On Call anchor and phone hidden-tabs checks from #3497 all passed. Two different reads failed instead, both because the test looked while a streamed page was still swapping its content in.

After: both tests wait for the settled page before reading it.

  • Phone assessments (tests/ui-phone-scroll-assessments.spec.ts, phone Safari and installed layout): straight after the reload the assessments hero existed twice, once still held in React's hidden reveal container. A strict locator rejects that immediately, with no retry. The test now waits for exactly one copy (toHaveCount(1)) and then checks it is visible. The first visit already waits for the page to settle, which is why it never failed there.
  • Forms home hero (tests/ui-tools.spec.ts, desktop Safari): the icon passed its visibility check, then a single bounding-box read came back empty because the subtree was replaced in between. The box read now retries until it has a value.

Areas touched: App experience

No test skipped, quarantined or loosened, and no app code changed.

Verification

  • Checks run: prettier, eslint on both specs and tsc --noEmit all came back clean.
  • The release browser matrix never runs on pull requests, and WebKit can't be installed in the cloud container, so the Safari proof comes from main's next matrix run after merge. The Chromium and Firefox legs run in this PR's CI.

Risk and rollout

  • Risk: test-only.
  • Rollback: revert the commit.
  • Provider or production effects: None

πŸ€– Generated with Claude Code

https://claude.ai/code/session_01DCghuougzFFXRF3dQQEcYr


Generated by Claude Code


Summary by cubic

Stabilizes two Safari tests that read a streamed page before it finishes swapping its content after a reload.

  • Phone assessments: waits for exactly one hero copy before its visibility check, since the reload briefly holds a second copy in React's hidden reveal container, which a strict locator rejects at once.
  • Forms home hero: polls for the settled icon and asserts its exact 48Γ—48 tap size inside one fresh read, so the subtree can't swap between the visibility check and the box read.

No app code changed, and no test was skipped or loosened.


CodeAnt-AI Description

Wait for streamed pages to settle before checking hero content

What Changed

  • Phone Safari checks wait for the assessments hero to appear once before checking visibility.
  • Forms home checks retry the hero icon’s size read if the page is still replacing its content.

Impact

βœ… Fewer intermittent Safari test failures
βœ… Hero checks remain strict

πŸ’‘ Usage Guide

Checking Your Pull Request

Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.

Talking to CodeAnt AI

Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:

@codeant-ai ask: Your question here

This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.

Example

@codeant-ai ask: Can you suggest a safer alternative to storing this secret?

Preserve Org Learnings with CodeAnt

You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:

@codeant-ai: Your feedback here

This helps CodeAnt AI learn and adapt to your team's coding style and standards.

Example

@codeant-ai: Do not flag unused imports.

Retrigger review

Ask CodeAnt AI to review the PR again, by typing:

@codeant-ai: review

Check Your Repository Health

To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.