-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Closes #13219: Fixing long-tap delay for UI tests #13502
Conversation
fb1502c
to
05ec13f
Compare
Codecov Report
@@ Coverage Diff @@
## master #13502 +/- ##
============================================
+ Coverage 29.81% 29.83% +0.02%
- Complexity 1115 1118 +3
============================================
Files 422 422
Lines 17172 17170 -2
Branches 2229 2227 -2
============================================
+ Hits 5119 5123 +4
+ Misses 11678 11673 -5
+ Partials 375 374 -1
Continue to review full report at Codecov.
|
@AaronMT @isabelrios Do you think I should add this to all test classes to be safe? |
53c2575
to
19c84ad
Compare
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.
We should move this into a spot where this setting can be inherited into tests like into the ActivityTestRule. E.g, can use the apply method and write an override in https://github.com/mozilla-mobile/fenix/blob/master/app/src/androidTest/java/org/mozilla/fenix/helpers/HomeActivityTestRule.kt e.g, https://github.com/timrijckaert/BetterActivityTestRule/blob/61ad0802859218d67cbb4907df35f78bd05b3220/app/src/androidTest/java/be/rijckaert/tim/disableanimations/BetterActivityTestRule.kt#L36 – doesn't have to be as convoluted but see where they use executeShellCommand and where the functions are called there.
19c84ad
to
819d17d
Compare
819d17d
to
efba9aa
Compare
@AaronMT Done, please review: Adding this to the apply method would stop the automatic launch of the activity for reasons I couldn't explain. So, I used a different method from ActivityTestRule, beforeActivityLaunched() which according to the documentation does what we want: "Override this method to execute any code that should run before your {@link Activity} is created and launched. This method is called before each test method, including any method annotated with Before". |
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.
Awesome. Good to know about beforeActivityLaunched
Changes the long-tap delay before starting the activity so it applies to all tests.
Fixed the Libraries menu toolbar resource ID because it has changed.