test(web): wait for a painted frame before closing a video segment
Fixes the integration test that fails in CI with video/video.webm inked: expected 0 to be greater than 0.0005.
The failing test is "splits a running trace around a video started mid-attempt". Each segment stopped right after navigating, sometimes before the screencast delivered its first frame. Playwright writes a white frame for a segment with no frames, so the video ended blank. On Linux it failed 6 of 30 runs.
The test now waits for a painted frame before each stop, the same wait the per-page video test already had. Both tests share one paint observer. Since the mid-attempt test records two segments on the same page, the wait clears what the page painted earlier, so the second segment can't pass on the first one's frame.
Verified on Linux (node:22, 4 CPUs): mid-attempt test 0 of 40 failed, full lifecycle.test.ts 5 of 5 passed.