Detox icon indicating copy to clipboard operation
Detox copied to clipboard

Android typing slow

Open joe-yeomans opened this issue 3 years ago • 10 comments

Description

When running detox tests on android the typing seems to be really slow, and it's even slower on my CI. iOS is fine and types quiet fast. What could be causing this?

https://user-images.githubusercontent.com/90803159/191717576-6813f77b-e600-45bc-a440-b8d68f434b1c.mp4

Your environment

Detox version: 19.12.1 React Native version: 0.69.5 Node version: Device model: Pixel 5 Android 12 API 31 OS: MacOS Test-runner (select one): jest-circus

joe-yeomans avatar Sep 22 '22 10:09 joe-yeomans

I ran into the same problem. For us, it seemed related to synchronization. From my understanding, because Detox is a gray box testing framework, it knows when the system is doing something (like IO) and will pause to let the system "settle". I think it's typing slow because it's waiting for things to "settle" after each character is typed.

https://github.com/wix/Detox/blob/master/docs/Troubleshooting.Synchronization.md

I used

await device.disableSynchronization();

to disable synchronization and used

await device.enableSynchronization();

after typing to turn it back on.

I don't know if it was the correct solution but it helped.

timkomip avatar Sep 22 '22 19:09 timkomip

I have tried doing that before typing and it seems to just be as slow:

    await device.disableSynchronization();
    await element(by.id('input-login-email')).typeText(
        '[email protected]'
    );
    await element(by.id('input-login-password')).typeText('Password123');
    await element(by.id('input-login-orgid')).typeText('XXXXX\n');
    await device.enableSynchronization();

When typing all I can see this in the logs:

09:17:33.129 detox[26516] INFO:  [APP_STATUS] The app seems to be idle
09:17:43.133 detox[26516] INFO:  [APP_STATUS] The app seems to be idle
09:17:53.136 detox[26516] INFO:  [APP_STATUS] The app seems to be idle
09:18:05.219 detox[26516] INFO:  [APP_STATUS] The app seems to be idle
09:18:23.175 detox[26516] INFO:  [APP_STATUS] The app seems to be idle
09:18:36.210 detox[26516] INFO:  [APP_STATUS] The app is busy with the following tasks:
• "LooperIdlingResource-135-mqt_js" (JS Thread) is executing (JavaScript code).
• UI elements are busy:
  - Reason: UI rendering activity.
• Activity on the React-Native bridge.
09:18:56.656 detox[26516] INFO:  [APP_STATUS] The app is busy with the following tasks:
• "LooperIdlingResource-135-mqt_js" (JS Thread) is executing (JavaScript code).
• UI elements are busy:
  - Reason: UI rendering activity.
• Activity on the React-Native bridge.

joe-yeomans avatar Sep 23 '22 08:09 joe-yeomans

This issue appears to be a general usage or support question. In order to get help, please either ask a question on Stack Overflow with the detox tag, or simply join our Discord. Feel free to post your Stack Overflow question here for more visibility! We'll take a look at it ASAP. For more information about our policy on issues, refer to this discussion.

github-actions[bot] avatar Sep 29 '22 14:09 github-actions[bot]

Same, it's excruciatingly slow on Android.

See

The app is busy with the following tasks:
• "LooperIdlingResource-114-mqt_js" (JS Thread) is executing (JavaScript code).

And

The app is busy with the following tasks:
• Activity on the React-Native bridge.

repeated multiple times.

raldred avatar Jan 24 '23 10:01 raldred

Facing the same issue

agestaun avatar Jan 26 '23 16:01 agestaun

Same, it's excruciatingly slow on Android.

See

The app is busy with the following tasks:
• "LooperIdlingResource-114-mqt_js" (JS Thread) is executing (JavaScript code).

And

The app is busy with the following tasks:
• Activity on the React-Native bridge.

repeated multiple times.

Well to be reading it out loud, it looks like Detox is alerting you with the fact that typing somehow overloads your system. Do you happen to be using some sort of a fancy input component? Does typing manually (regradless of Detox) work smoothly, at all?

In any case, sharing a video would help a great deal.

d4vidi avatar Jan 30 '23 21:01 d4vidi

I'm in the same situation. Works very quickly on iOS but takes forever (and even fails due to not finding the typed element) on Android.

ShanaSkydancer avatar Jun 16 '23 14:06 ShanaSkydancer

I'm in the same situation.

tupikvtypike avatar Oct 20 '23 12:10 tupikvtypike

Is there any update on this, I can't use typeText on API 33+ and now on 32 it's just so slow?!

markios avatar Oct 25 '23 14:10 markios

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you believe the issue is still relevant, please test on the latest Detox and report back.

Thank you for your contributions!

For more information on bots in this repository, read this discussion.

stale[bot] avatar Dec 15 '23 04:12 stale[bot]