-
Notifications
You must be signed in to change notification settings - Fork 160
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve screenshot testing with ComposablePreviewScanner #3125
Conversation
82baa39
to
e8cc654
Compare
83a2307
to
8118aed
Compare
📱 Scan the QR code below to install the build (arm64 only) for this PR. |
I also hope Showkase/KSP somehow had something to do with the OOM issues we were having in the CI and this might fix it. Although it's quite hard to test it. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #3125 +/- ##
========================================
Coverage 76.01% 76.01%
========================================
Files 1635 1635
Lines 38578 38578
Branches 7460 7460
========================================
+ Hits 29325 29326 +1
Misses 5361 5361
+ Partials 3892 3891 -1 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for working on this! I have spot some strange things in the recorded screenshots, but I did not check every single ones.
Also there are some formatting issue on build.gradle.kts
files (I have commented them all).
Can you ensure that generating Element Gallery is still working as expected?
tests/uitests/src/test/snapshots/images/appnav.loggedin_LoggedInView_Day0_en.png
Outdated
Show resolved
Hide resolved
tests/uitests/src/test/snapshots/images/compound.previews_IconsCompoundDark__en.png
Outdated
Show resolved
Hide resolved
tests/uitests/src/test/snapshots/images/libraries.designsystem.components_Badge_Day_en.png
Outdated
Show resolved
Hide resolved
...ests/src/test/snapshots/images/libraries.designsystem.components_BloomInitials_Night6_en.png
Outdated
Show resolved
Hide resolved
...ibraries.designsystem.theme.components.previews_TimePickerHorizontal_DateTime_pickers_en.png
Outdated
Show resolved
Hide resolved
(changing the label to |
Also the doc will have to be updated: https://github.com/element-hq/element-x-android/blob/develop/docs/screenshot_testing.md |
8bfbe8a
to
ed9249a
Compare
ed9249a
to
e417bec
Compare
I believe with the latest changes everything should work. @bmarty can you also test the gallery locally? It seems to work for me, but having a fresh pair of eyes on it is probably a good idea. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ideally the file data.js should be updated by this PR, so that the index.html is not broken.
Also I have noticed that the Preview are not sorted by name. It should start by AboutView
like here:
This was done here: https://github.com/element-hq/element-x-android/blob/develop/tools/test/generateAllScreenshots.py#L120. See more details in the comment.
...ibraries.designsystem.theme.components.previews_TimePickerHorizontal_DateTime_pickers_en.png
Outdated
Show resolved
Hide resolved
I think for that we need the 'Sync Localazy' flow to run since any screenshot I record in my computer will later be overridden. Maybe I should just trigger a sync as soon as this PR is merged? The latest changes should fix the issues. |
Well, there goes my theory about the OOM errors maybe being caused by KSP/Showkase 🫤 : https://github.com/element-hq/element-x-android/actions/runs/9772948574/attempts/1 |
Let me check! I'll commit the change on |
Html is empty because DE screenshots will need to be generated again.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, I have updated the file data.js.
I think we can merge the PR and trigger a Localazy sync just after to ensure that DE screenshots will be correctly recorded and the Gallery correctly rendered.
Thanks for all the updates!
Quality Gate passedIssues Measures |
Type of change
Content
Showkase
for screenshot tests with ComposablePreviewScanner. Showkase is only used now for the browser in:libraries:designsystem
._null_1_2_
suffixes in the screenshot filenames.Motivation and context
Improve DevX. It should also fix the case where adding/removing a single preview in a module renamed every single other one.
Screenshots / GIFs
There are a few in this PR 😇 .
Tests
We should test this against the Element Gallery.
Tested devices
Checklist