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

[Bug] Some UI tests disable device's long press action #16317

Closed
codrut-topliceanu opened this issue Nov 2, 2020 · 1 comment · Fixed by #18029
Closed

[Bug] Some UI tests disable device's long press action #16317

codrut-topliceanu opened this issue Nov 2, 2020 · 1 comment · Fixed by #18029
Labels
🐞 bug Crashes, Something isn't working, .. eng:ui-test UI Tests

Comments

@codrut-topliceanu
Copy link
Contributor

codrut-topliceanu commented Nov 2, 2020

Steps to reproduce

  • Run UI test, on a device, that changes the device's long_press_timeout such as TabbedBrowsingTest.kt
  • After the test ends attempt to initiate a long press action such as long press on homescreen to add a widget.

Expected behavior

  • Long press action should execute as normal

Actual behavior

  • No long press action executes anymore

Device information

  • Android device: Pixel 3XL, Android 10
  • Fenix version:

It appears that UI tests use mDevice.executeShellCommand("settings put secure long_press_timeout 3000") to change long press timeout without changing it back on @After resulting in an unknown Touch & hold delay value (Accessibility options):

┆Issue is synchronized with this Jira Task

@codrut-topliceanu codrut-topliceanu added 🐞 bug Crashes, Something isn't working, .. eng:ui-test UI Tests labels Nov 2, 2020
@github-actions github-actions bot added the needs:triage Issue needs triage label Nov 2, 2020
@kbrosnan kbrosnan removed the needs:triage Issue needs triage label Nov 2, 2020
@sv-ohorvath sv-ohorvath linked a pull request Feb 17, 2021 that will close this issue
3 tasks
@Mugurell
Copy link
Contributor

@sv-ohorvath I see in the recent patch that we would still leave the device with a possibly different touch delay than before running the tests.
The user could have set medium/long delays and would prefer to keep them.
Maybe we could use something like android.view.ViewConfiguration.getLongPressTimeout() to cache the device's set delays before running the tests and set that same exact value in afterActivityFinished?

I see afterActivityFinished being called even if the test encounters an exception so this is great - cleanup is ensured without the need for a try-catch / our own Thread.setDefaultUncaughtExceptionHandler()

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🐞 bug Crashes, Something isn't working, .. eng:ui-test UI Tests
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants