How to make premium Golden tests
summary
Practical steps to make golden tests render like real devices using golden_toolkit: load fonts with a font loader to avoid square glyphs, pre-cache images, flip on debug painting values to get shadows and platform-specific rendering, and set the test window’s physical size and devicePixelRatio. Run tests as variants (example iPhone 13 and Pixel 5) or with device objects that include safe areas, notches and bezel overlays. Simulate an open keyboard by rendering a keyboard image with focus listener and stacking it above the app.
AI-written summary · about
chapters (6)
- 0:00Introduction to golden tests
- 1:23Understanding golden files
- 2:55Enhancing visual accuracy
- 4:28Implementing adaptive tests
- 6:28Handling keyboard rendering
- 7:51Benefits and conclusion
related talks
35mHitting a Gold Mine:How to Set the Gold Standard With Golden Tests
14mTest Semantics with Golden Tests
41mThe art of Flutter testing
35mFlutter's Golden Age
19mTesting Beyond Unit
46mFive Lessons from Implementing Pixel-Perfect Testing of a Design System on Android
28mAdvanced Techniques in iOS UI Testing
35mEasy screenshot testing with Compose
