-
Notifications
You must be signed in to change notification settings - Fork 0
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 tests for settings and sortingAndGrouping module #12
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #12 +/- ##
============================================
+ Coverage 0.51% 0.67% +0.16%
- Complexity 25 32 +7
============================================
Files 321 321
Lines 10456 10456
Branches 1821 1821
============================================
+ Hits 54 71 +17
+ Misses 10382 10364 -18
- Partials 20 21 +1
Continue to review full report at Codecov.
|
5a12f9b
to
ab3dcad
Compare
@@ -34,10 +34,10 @@ class MembersFragmentTest { | |||
@Before | |||
fun setUp() { | |||
try { | |||
login_if_user_is_logged_out() | |||
navigate_to_channel_details() | |||
loginIfUserIsLoggedOut() |
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.
Are you counting on this to throw an exception if the user is already logged in? Is that safe? Is it guaranteed that no other exception could be thrown? I just wonder if there is a more positive test whether the user is logged in...
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 logic here is that if the user is already logged in then there will be a NoMatchingViewException which will be caught and for which we have to do nothing just proceed further in this case navigateToChannelDetails but if the user is not logged in then we have to make the user login first then navigate further
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 to place this logic in some tests because the tests should be independent of each other (best practices) Also it saves tests from failing, there can be a case in which a test which tests a scenario after user authentication is performed before the actual login of the app as the there is no predefined order in which test run. So, in that case, it will perform login first and then test the required thing
Govind...... I tested the latest, and all tests passed except the two appStore tests. I'm pretty sure that is because the appStore does not recognize my emulator as a compatible device for the RocketChat app, so it does not offer the "rate" and "feedback" options. Have you seen this issue? I have tried to debug, but still have no idea what might be missing. I am inclined to approve this PR, but first, can you point me to the code you added that protected other tests from failing in the case of a test failure? I'm curious...... thanks. |
Thanks @ear-dev. Yes, the compatibility issue of the emulator seems to be the cause of the failure at first look. But when I dig into it I found that in some cases the intent to open the Gmail and play store is taking more time than expected. Since I am checking whether the Rocket.Chat text is present in the display screen when the play store opens up. It fails when it takes more time to open the play store app, same is with the Gmail app. I also have an incompatible emulator Still the tests are passing 8/10 times failing 2 times because of intent taking more time. As discussed I will unit test these two test cases. |
previously tests were failing because the instance of play store and Gmail already open causing UI hindrance to other tests. Earlier I was using |
This PR is specific to GSoC'19 project (Improve test automation in Rocket.Chat Android Repo)
Change Log
Current Code coverage: 35% by Instructions 19% by branch