Skip to content
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

Conversation

Corvus400
Copy link
Contributor

Issue

Overview (Required)

  • modified to check if the elements of individual items are visible.

@Corvus400 Corvus400 changed the title ♻️ Enhanced Contributors testing. ♻️ Enhanced ContributorsScreen testing. Aug 15, 2024
@github-actions github-actions bot temporarily deployed to deploygate-distribution August 15, 2024 21:14 Inactive
@Corvus400 Corvus400 marked this pull request as ready for review August 15, 2024 21:37
@mikanIchinose
Copy link
Contributor

mikanIchinose commented Aug 16, 2024

Comment on lines 48 to 65
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,
)
}
}
Copy link
Member

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.

@takahirom
Copy link
Member

Maybe , is not supported by our CI currently.

@github-actions github-actions bot temporarily deployed to deploygate-distribution August 16, 2024 03:58 Inactive
run {
setupScreenContent()
}
itShould("does not show contributor, and show snackbar") {
Copy link
Member

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.
@github-actions github-actions bot temporarily deployed to deploygate-distribution August 16, 2024 04:09 Inactive
@takahirom
Copy link
Member

Let me push some changes for this 🙏

Copy link

Detekt check failed. Please run ./gradlew detekt --auto-correct to fix the issues.

@github-actions github-actions bot temporarily deployed to deploygate-distribution August 16, 2024 12:39 Inactive
@takahirom
Copy link
Member

@Corvus400 I've pushed some changes. Do you have any thoughts on them?

@github-actions github-actions bot temporarily deployed to deploygate-distribution August 16, 2024 16:20 Inactive
@@ -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:"
Copy link
Contributor Author

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! 👍

Comment on lines +27 to +28
const val ContributorsItemImageTestTagPrefix = "ContributorsItemImageTestTag:"
const val ContributorsUserNameTextTestTagPrefix = "ContributorsUserNameTextTestTag:"
Copy link
Contributor Author

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. 👍

Comment on lines +34 to +38
fun scrollToIndex10() {
composeTestRule
.onNode(hasTestTag(ContributorsTestTag))
.performScrollToIndex(10)
}
Copy link
Contributor Author

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
Copy link
Contributor Author

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
@Corvus400
Copy link
Contributor Author

@takahirom
I looked at the code after refactoring.
I think this one is better! 👍

@github-actions github-actions bot temporarily deployed to deploygate-distribution August 16, 2024 18:42 Inactive
@github-actions github-actions bot temporarily deployed to deploygate-distribution August 17, 2024 03:12 Inactive
@takahirom
Copy link
Member

takahirom commented Aug 17, 2024

I've changed some test names. Thank you for your collaboration!
2178993

@takahirom takahirom merged commit 4bebcb6 into DroidKaigi:main Aug 17, 2024
6 checks passed
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.

3 participants