-
-
Notifications
You must be signed in to change notification settings - Fork 742
Add a test to introduce compose screenshot testing #4835
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
Merged
dshokouhi
merged 21 commits into
home-assistant:master
from
dshokouhi:add_compose_screenshot_test
Mar 27, 2025
Merged
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
211cce5
Add a test to introduce compose screenshot testing
dshokouhi 62e6142
Fix action syntax
dshokouhi 073c004
Upload report as its needed if the task fails to spot the differences
dshokouhi e7d14b7
Update
dshokouhi 84b9ec4
Correct merge mistake
dshokouhi 768d506
Lint
dshokouhi 92675ba
Fix bad merge
dshokouhi d5349bd
Update reference image
dshokouhi 653c933
Fix bad merge again
dshokouhi 71d87fa
Fix bad merge again (yaml)
dshokouhi ae78609
Commit after running gradle dependency command
dshokouhi a5e25d4
Merge
dshokouhi ea75f89
Merge
dshokouhi 69d722c
Switch to kotlin folder structure
dshokouhi 47a9387
Apply all suggestions
dshokouhi 3db7a60
Merge remote-tracking branch 'upstream/master' into add_compose_scree…
dshokouhi 88191a0
fix yaml
dshokouhi 89a3700
update locks
dshokouhi e0ffd01
add threshold for platform differences
dshokouhi 3d240ba
Merge branch 'master' into add_compose_screenshot_test
TimoPtr 1ef0583
bump threshold
dshokouhi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file added
BIN
+13.3 KB
...mpanion/android/EntityListViewPreviewsTest/PreviewEntityListView_85f0dd27_0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
27 changes: 27 additions & 0 deletions
27
...rc/screenshotTest/kotlin/io/homeassistant/companion/android/EntityListViewPreviewsTest.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package io.homeassistant.companion.android | ||
|
||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.res.stringResource | ||
import androidx.compose.ui.tooling.preview.Preview | ||
import androidx.wear.tooling.preview.devices.WearDevices | ||
import io.homeassistant.companion.android.common.R | ||
import io.homeassistant.companion.android.home.views.EntityViewList | ||
import io.homeassistant.companion.android.util.previewEntity1 | ||
import io.homeassistant.companion.android.util.previewEntity2 | ||
|
||
class EntityListViewPreviewsTest { | ||
|
||
@Preview(device = WearDevices.LARGE_ROUND) | ||
@Composable | ||
private fun PreviewEntityListView() { | ||
EntityViewList( | ||
entityLists = mapOf(stringResource(R.string.lights) to listOf(previewEntity1, previewEntity2)), | ||
entityListsOrder = listOf(stringResource(R.string.lights)), | ||
entityListFilter = { true }, | ||
onEntityClicked = { _, _ -> }, | ||
onEntityLongClicked = { }, | ||
isHapticEnabled = false, | ||
isToastEnabled = false | ||
) | ||
} | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Looking at the flow diagram on #5158: wouldn't it make more sense to run this after lint/basic build has completed? So
needs: [lint, lockfiles, ktlint]
like the other tests?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.
yea grouped next to unit tests maybe?
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.
next to = running at the same time? That's what I was thinking, so basically as 'stage 3'.
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.
yup let me submit a PR to add that, thanks for the suggestion :)