Skip to content
This repository has been archived by the owner on Feb 20, 2023. It is now read-only.

Closes #13219: Fixing long-tap delay for UI tests #13502

Merged
merged 1 commit into from
Aug 19, 2020
Merged

Conversation

sv-ohorvath
Copy link
Contributor

@sv-ohorvath sv-ohorvath commented Aug 11, 2020

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.

@sv-ohorvath sv-ohorvath self-assigned this Aug 11, 2020
@sv-ohorvath sv-ohorvath added eng:intermittent-test Evil test failures that only happen now-and-then and are a productivity killer eng:ui-test UI Tests labels Aug 11, 2020
@codecov-commenter
Copy link

codecov-commenter commented Aug 11, 2020

Codecov Report

Merging #13502 into master will increase coverage by 0.02%.
The diff coverage is 0.00%.

Impacted file tree graph

@@             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     
Impacted Files Coverage Δ Complexity Δ
...pp/src/main/java/org/mozilla/fenix/FeatureFlags.kt 100.00% <ø> (ø) 3.00 <0.00> (ø)
...a/org/mozilla/fenix/browser/BaseBrowserFragment.kt 0.00% <0.00%> (ø) 0.00 <0.00> (ø)
.../java/org/mozilla/fenix/browser/BrowserFragment.kt 0.00% <0.00%> (ø) 0.00 <0.00> (ø)
...zilla/fenix/components/metrics/MetricController.kt 35.51% <0.00%> (-0.68%) 0.00 <0.00> (ø)
...mponents/searchengine/FenixSearchEngineProvider.kt 63.96% <0.00%> (+1.80%) 14.00% <0.00%> (+1.00%)
...in/java/org/mozilla/fenix/settings/SupportUtils.kt 77.55% <0.00%> (+6.12%) 13.00% <0.00%> (+2.00%)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 35f63f8...efba9aa. Read the comment docs.

@sv-ohorvath
Copy link
Contributor Author

@AaronMT @isabelrios Do you think I should add this to all test classes to be safe?

@sv-ohorvath sv-ohorvath force-pushed the longTapDelay branch 2 times, most recently from 53c2575 to 19c84ad Compare August 13, 2020 14:13
@sv-ohorvath sv-ohorvath linked an issue Aug 13, 2020 that may be closed by this pull request
Copy link
Contributor

@AaronMT AaronMT left a 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.

@sv-ohorvath sv-ohorvath changed the title [UI tests] Closes #13219: Fixing long-tap delay for openTabDrawer() [UI tests] Closes #13219: Fixing long-tap delay for UI tests Aug 19, 2020
@sv-ohorvath
Copy link
Contributor Author

sv-ohorvath commented Aug 19, 2020

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.

@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".

@sv-ohorvath sv-ohorvath changed the title [UI tests] Closes #13219: Fixing long-tap delay for UI tests Closes #13219: Fixing long-tap delay for UI tests Aug 19, 2020
Copy link
Contributor

@AaronMT AaronMT left a 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

@AaronMT AaronMT merged commit 0b2e629 into master Aug 19, 2020
@sv-ohorvath sv-ohorvath deleted the longTapDelay branch August 19, 2020 15:08
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
eng:intermittent-test Evil test failures that only happen now-and-then and are a productivity killer eng:ui-test UI Tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Intermittent UI test failure - verifyAboutFirefoxPreview
3 participants