-
Notifications
You must be signed in to change notification settings - Fork 200
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
♻️ Enhanced ContributorsScreen testing. #503
♻️ Enhanced ContributorsScreen testing. #503
Conversation
… Staff data class and Contributor data class.
modified to check if the elements of individual items are visible.
itShould("show contributor 1 to 5") { | ||
captureScreenWithChecks { | ||
checkExistsContributorItem( | ||
fromTo = 0 to 5, | ||
) | ||
} | ||
} | ||
describe("when scroll to contributor 9") { | ||
run { | ||
scrollToTestTag(ContributorsItemTestTag.plus(9)) | ||
} | ||
itShould("show contributor 6 to 10") { | ||
captureScreenWithChecks { | ||
checkExistsContributorItem( | ||
fromTo = 5 to 10, | ||
) | ||
} | ||
} |
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. However, I think this test is highly dependent on screen size and can easily break. I believe it would be better to check if we have two or more items.
…ther two or more contributors are displayed.
Maybe |
run { | ||
setupScreenContent() | ||
} | ||
itShould("does not show contributor, and show snackbar") { |
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.
The ,
is here 👀
…nshots not displaying if there is a comma in them.
Let me push some changes for this 🙏 |
Detekt check failed. Please run |
@Corvus400 I've pushed some changes. Do you have any thoughts on them? |
@@ -34,6 +34,8 @@ import kotlinx.collections.immutable.PersistentList | |||
|
|||
const val contributorsScreenRoute = "contributors" | |||
const val ContributorsScreenTestTag = "ContributorsScreenTestTag" | |||
const val ContributorsTestTag = "ContributorsTestTag" | |||
const val ContributorsItemTestTagPrefix = "ContributorsItemTestTag:" |
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.
Surely this is a prefix.
I think this name is better! 👍
const val ContributorsItemImageTestTagPrefix = "ContributorsItemImageTestTag:" | ||
const val ContributorsUserNameTextTestTagPrefix = "ContributorsUserNameTextTestTag:" |
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.
@takahirom
I have modified the name of this test tag since it is used as a Prefix as well. 👍
fun scrollToIndex10() { | ||
composeTestRule | ||
.onNode(hasTestTag(ContributorsTestTag)) | ||
.performScrollToIndex(10) | ||
} |
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.
I see, in this case the scrolling method using Index was better. ✍️
@@ -0,0 +1,60 @@ | |||
package io.github.droidkaigi.confsched.testing.utils |
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.
These Utils are very helpful as I am sure they will be used frequently in other test cases! 🙇♂️
…enhancement/contributors_screen_test_enhancement # Conflicts: # feature/contributors/src/commonMain/kotlin/io/github/droidkaigi/confsched/contributors/ContributorsScreen.kt
@takahirom |
I've changed some test names. Thank you for your collaboration! |
Issue
xxxxScreenTest
tests #464Overview (Required)