Skip to content

Conversation

hassoncs
Copy link
Contributor

@hassoncs hassoncs commented Oct 9, 2025

We've had screenshot tests using Chromatic for a while now, but we disabled them a couple weeks ago due to them being too flaky. This change should be 0 risk since these are just screenshots :)

With this pull request, I've addressed the three major sources of screenshot flakes:

  • our settings saving/restoring has a race condition
  • the notification bell in the corner
  • the "activating extensions" in the status bar
  • the animated gif logo in autocomplete settings

Fixes: #2621

Copy link

changeset-bot bot commented Oct 9, 2025

⚠️ No Changeset found

Latest commit: 6ac2db0

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@hassoncs hassoncs changed the title test(e2e): add helper to clear notifications in e2e tests test(e2e): Fix all known screenshot test flakes Oct 9, 2025
@hassoncs hassoncs force-pushed the fix-screenshot-flakes-3 branch 5 times, most recently from 9abdd7e to 19a782e Compare October 9, 2025 19:16

await page.waitForTimeout(1000) // Let the page settle to avoid flakes

await closeAllToastNotifications(page)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Notification closing is now built into takeScreenshot

@hassoncs hassoncs marked this pull request as ready for review October 9, 2025 20:45
@hassoncs hassoncs force-pushed the fix-screenshot-flakes-3 branch 2 times, most recently from 4877df9 to 454f524 Compare October 15, 2025 15:38
- Add DOM stability helper to wait for page changes before screenshots
- Replace notification helpers with DOM stability utilities
- Enhance test setup with extension activation and model selector waits
- Add GIF freezing and VSCode command execution for consistent screenshots
- Update test files to reduce flakes and improve reliability
- Add data-testid to model selector component for better test targeting

Fixes screenshot flakiness in Playwright E2E tests by implementing stability checks and removing unreliable notification clearing.
@hassoncs hassoncs force-pushed the fix-screenshot-flakes-3 branch from 454f524 to 94b2d3a Compare October 15, 2025 15:55
@hassoncs hassoncs force-pushed the fix-screenshot-flakes-3 branch from 94b2d3a to 6ac2db0 Compare October 15, 2025 15:59
@hassoncs hassoncs requested a review from chrarnoldus October 15, 2025 18:09
@hassoncs hassoncs merged commit 17f52f8 into main Oct 15, 2025
14 checks passed
@hassoncs hassoncs deleted the fix-screenshot-flakes-3 branch October 15, 2025 18:16
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.

Fix Chromatic Storybook Screenshot Flakes

2 participants