-
Notifications
You must be signed in to change notification settings - Fork 155
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
Add first tests on compose click interaction. #2175
Conversation
) | ||
} | ||
rule.onNode(hasContentDescription("Back")).performClick() | ||
callback.assertSuccess() |
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 would like to find a way to avoid having to write this line. Because if the developer forget it, the test will always pass.
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.
Maybe create a wrapper, like roboTest { ... }
that internally always calls this?
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 have added fun run
in 2c667a0, maybe not the best solution, but works for now I guess. But I'll think about it 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.
Improved a bit in 2a6a3de
📱 Scan the QR code below to install the build (arm64 only) for this PR. |
I do not see any test coverage report in this PR :/ |
class EventsRecorder<T>( | ||
private val expectEvents: Boolean = true | ||
) : (T) -> Unit { |
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.
Clever!
onSuccessLogout = EnsureNeverCalledWithParam(), | ||
) | ||
} | ||
rule.clickOn("Sign out") |
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.
Is there a way to use resources instead? It seems safer.
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.
Yes, I forgot this part. Thanks!
I re-run the test job just in case, but if it doesn't report any coverage we'll have to investigate this a bit further. Other than that, great job! I wasn't sure if this was actually feasible, and it's great to see it's not that much work and you found an elegant way to handle the success/failure problem in these special tests. |
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## develop #2175 +/- ##
===========================================
+ Coverage 66.98% 67.02% +0.03%
===========================================
Files 1376 1376
Lines 34201 34202 +1
Branches 7445 7445
===========================================
+ Hits 22911 22923 +12
+ Misses 7672 7661 -11
Partials 3618 3618 ☔ 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.
The coverage was reported now, so I'm approving it, thanks! Could you take a look at my previous comments, in case we can do those improvements?
… ensure that `assertSuccess` is always called.
Quality Gate passedKudos, no new issues were introduced! 0 New issues |
Type of change
Content
Add compose test to check eventSink and callback behavior. Should increase code coverage.
This PR introduce some utility classes, but there is lots of work to do to add tests on the project. This first PR add test on LogoutView as a POC.
Motivation and context
#813
Screenshots / GIFs
Tests
Tested devices
Checklist