feat: Add Screenshot Test for ProfileCardScreen#426
feat: Add Screenshot Test for ProfileCardScreen#426whitescent wants to merge 5 commits intoDroidKaigi:mainfrom
Conversation
b9221bd to
4b9ef3c
Compare
|
Hi @kitakkun 👋, Can you help me see why this test case is always failing? describe("click create card button when profile is empty") {
doIt {
clickCreateButton()
}
itShould("show error message") {
captureScreenWithChecks {
checkNameError()
}
}
}it seems like the supportText of |
...commonMain/kotlin/io/github/droidkaigi/confsched/testing/robot/profile/ProfileScreenRobot.kt
Show resolved
Hide resolved
bd0e563 to
337d991
Compare
cf5dc36 to
fcceca8
Compare
kitakkun
left a comment
There was a problem hiding this comment.
Sorry for taking so much time to review this PR! 🙏🏻
I’ve left a few comments—would you mind taking a look when you have a chance?
core/model/src/commonMain/kotlin/io/github/droidkaigi/confsched/model/profile/Profile.kt
Outdated
Show resolved
Hide resolved
...profile/src/commonMain/kotlin/io/github/confsched/profile/components/FlippableProfileCard.kt
Outdated
Show resolved
Hide resolved
...re/profile/src/commonTest/kotlin/io/github/droidkaigi/confsched/profile/ProfileScreenTest.kt
Outdated
Show resolved
Hide resolved
feature/profile/src/commonMain/kotlin/io/github/confsched/profile/ProfileEditScreen.kt
Outdated
Show resolved
Hide resolved
fcceca8 to
43145aa
Compare
f105c37 to
bc69f60
Compare
.../commonMain/kotlin/io/github/droidkaigi/confsched/data/profile/TestProfileSubscriptionKey.kt
Outdated
Show resolved
Hide resolved
7cd39e0 to
edd70c5
Compare
edd70c5 to
a2fb0d4
Compare
| describe("click create card button when profile is empty") { | ||
| doIt { | ||
| clickCreateButton() | ||
| } | ||
| itShould("show error text") { | ||
| captureScreenWithChecks { | ||
| checkNameError() | ||
| checkOccupationError() | ||
| checkLinkEmptyError() | ||
| checkImageEmptyError() | ||
| } | ||
| } | ||
| } | ||
| describe("check invalid link") { | ||
| doIt { | ||
| inputLink("あいうえお") | ||
| clickCreateButton() | ||
| } | ||
| itShould("show error text") { | ||
| captureScreenWithChecks { | ||
| checkLinkInvalidError() | ||
| } | ||
| } | ||
| } |
There was a problem hiding this comment.
The error message does need to be reflected in the screenshot test, I will fix it
There was a problem hiding this comment.
describe("when entering an invalid link") {
doIt {
inputLink("あいうえお")
scrollToNodeTagInEditScreen(ProfileCardEditCreateCardButtonTestTag)
clickCreateButton()
scrollToNodeTagInEditScreen(ProfileCardEditLinkFormLabelTestTag)
}
itShould("show an error message") {
captureScreenWithChecks {
checkLinkInvalidError()
}
}
}
context(composeUiTest: ComposeUiTest)
fun scrollToNodeTagInEditScreen(tag: String) {
composeUiTest
.onNodeWithTag(ProfileCardEditScreenColumnTestTag)
.performScrollToNode(hasTestTag(tag))
waitUntilIdle()
}
Even though I used the performScroll... API, it seems like the screenshot position isn't at the top of the form label, judging from the screen test screenshots? So it looks a bit strange... I wonder if I missed something? 👀
There was a problem hiding this comment.
It might be hidden under the TopAppBar. I recall a similar workaround being applied in the AboutScreen screenshot test as well.
There was a problem hiding this comment.
Not 100% perfect maybe, but we’re still seeing the error message we want, so I think this is fine as it is. 👍🏻
There was a problem hiding this comment.
Ahhh! I see, I did indeed forget that TopAppBar exists, thanks for the reminder! 👀
...re/profile/src/commonTest/kotlin/io/github/droidkaigi/confsched/profile/ProfileScreenTest.kt
Outdated
Show resolved
Hide resolved
89cd053 to
9dbed91
Compare
9dbed91 to
dc675ff
Compare











Issue
Overview (Required)