wix / Detox

Gray box end-to-end testing and automation framework for mobile apps
https://wix.github.io/Detox/
MIT License
11.24k stars 1.92k forks source link

typeText do not work no android on react native 0.72.5 #4206

Open gomesbreno opened 1 year ago

gomesbreno commented 1 year ago

What happened?

When call typeText method, the app do not apply on input the provided text, however on iOS it works fine.

What was the expected behaviour?

text been prompt on input.

Was it tested on latest Detox?

Did your test throw out a timeout?

Help us reproduce this issue!

No response

In what environment did this happen?

Detox version: 20.12.1 React Native version: 0.72.5 Has Fabric (React Native's new rendering system) enabled: no Node version: v16.18.1 Device model: Pixel_3a_API_33_arm64-v8a Android version: 33 Test-runner (select one): jest

Detox logs

Detox logs ``` 13:17:01.436 detox[2255] B lifecycle node_modules/.bin/detox test --configuration android.emu.release --loglevel trace data: { "id": "20365f17-2028-eb11-f635-d13a7dded485", "detoxConfig": { "configurationName": "android.emu.release", "apps": { "default": { "type": "android.apk", "binaryPath": "android/app/build/outputs/apk/release/app-release.apk", "build": "cd android && ./gradlew assembleRelease assembleAndroidTest -DtestBuildType=release" } }, "artifacts": { "rootDir": "artifacts/android.emu.release.2023-10-03 16-17-01Z", "plugins": { "log": { "enabled": false, "keepOnlyFailedTestsArtifacts": false }, "screenshot": { "enabled": true, "shouldTakeAutomaticSnapshots": false, "keepOnlyFailedTestsArtifacts": false }, "video": { "enabled": false, "keepOnlyFailedTestsArtifacts": false }, "instruments": { "enabled": false, "keepOnlyFailedTestsArtifacts": false }, "uiHierarchy": { "enabled": false, "keepOnlyFailedTestsArtifacts": false } } }, "behavior": { "init": { "keepLockFile": false, "reinstallApp": true, "exposeGlobals": true }, "cleanup": { "shutdownDevice": false }, "launchApp": "auto" }, "cli": { "configuration": "android.emu.release", "loglevel": "trace", "start": true }, "device": { "type": "android.emulator", "device": { "avdName": "Pixel_3a_API_33_arm64-v8a" } }, "logger": { "level": "trace", "overrideConsole": true, "options": { "showLoggerName": true, "showPid": true, "showLevel": false, "showMetadata": false, "basepath": "/Users/breno.gomes/Desktop/git-novo/adv-mobile-app/node_modules/detox/src", "prefixers": {}, "stringifiers": {} } }, "testRunner": { "retries": 0, "forwardEnv": false, "bail": false, "jest": { "setupTimeout": 120000, "teardownTimeout": 30000, "retryAfterCircusRetries": false, "reportWorkerAssign": true }, "args": { "$0": "jest", "_": [], "config": "e2e/jest.config.js", "--": [] } }, "session": { "autoStart": true, "debugSynchronization": 10000 } }, "detoxIPCServer": "primary-2255", "testResults": [], "testSessionIndex": 0, "workersCount": 0 } 13:17:01.440 detox[2255] i ipc Server path not specified, so defaulting to ipc.config.socketRoot + ipc.config.appspace + ipc.config.id /tmp/detox.primary-2255 13:17:01.441 detox[2255] i ipc starting server on /tmp/detox.primary-2255 13:17:01.441 detox[2255] i ipc starting TLS server false 13:17:01.441 detox[2255] i ipc starting server as Unix || Windows Socket 13:17:01.444 detox[2255] i ws-server Detox server listening on localhost:58441... 13:17:01.447 detox[2255] i lifecycle Serialized the session state at: /private/var/folders/jk/r6mqvhr13dj1f6f5rjyg73jw0000gp/T/20365f17-2028-eb11-f635-d13a7dded485.detox.json 13:17:01.448 detox[2255] B lifecycle jest --config e2e/jest.config.js watchman warning: Recrawled this watch 77 times, most recently because: MustScanSubDirs UserDroppedTo resolve, please review the information on https://facebook.github.io/watchman/docs/troubleshooting.html#recrawl To clear this warning, run: `watchman watch-del '/Users/breno.gomes/Desktop/git-novo/adv-mobile-app' ; watchman watch-project '/Users/breno.gomes/Desktop/git-novo/adv-mobile-app'` Determining test suites to run...13:17:01.858 detox[2256] i ipc Service path not specified, so defaulting to ipc.config.socketRoot + ipc.config.appspace + id 13:17:01.859 detox[2256] i ipc requested connection to primary-2255 /tmp/detox.primary-2255 13:17:01.859 detox[2256] i ipc Connecting client on Unix Socket : /tmp/detox.primary-2255 13:17:01.860 detox[2255] i ipc ## socket connection to server detected ## 13:17:01.861 detox[2256] i ipc retrying reset 13:17:01.862 detox[2256] i ipc dispatching event to primary-2255 /tmp/detox.primary-2255 : registerContext , { id: 'secondary-2256' } 13:17:01.863 detox[2255] i ipc received event of : registerContext { id: 'secondary-2256' } 13:17:01.864 detox[2255] i ipc dispatching event to socket : registerContextDone { testResults: [], testSessionIndex: 0 } 13:17:01.864 detox[2256] i ipc ## received events ## 13:17:01.864 detox[2256] i ipc detected event registerContextDone { testResults: [], testSessionIndex: 0 } 13:17:01.895 detox[2256] B lifecycle e2e/E2E.test.js 13:17:01.903 detox[2256] B lifecycle set up environment 13:17:01.904 detox[2256] i ipc dispatching event to primary-2255 /tmp/detox.primary-2255 : registerWorker , { workerId: 'w1' } RUNS e2e/E2E.test.js 13:17:50.477 detox[2255] i ws-server@58519 send data: { "type": "invoke", "params": { "target": { "type": "Class", "value": "com.wix.detox.espresso.DetoxAssertion" }, "method": "assertMatcher", "args": [ { "type": "Invocation", "value": { "target": { "type": "Class", "value": "androidx.test.espresso.Espresso" }, "method": "onView", "args": [ { "type": "Invocation", "value": { "target": { "type": "Class", "value": "com.wix.detox.espresso.DetoxMatcher" }, "method": "matcherForText", "args": [ "Calendário", { "type": "boolean", "value": false } ] } } ] } }, { "type": "Invocation", "value": { "target": { "type": "Class", "value": "com.wix.detox.espresso.DetoxMatcher" }, "method": "matcherForSufficientlyVisible", "args": [ { "type": "Integer", "value": 75 } ] } } ] }, "messageId": 14 } 13:17:50.494 detox[2255] i ws-server@58519 get data: {"messageId":14,"type":"testFailed","params":{"details":"'(view has effective visibility and view.getGlobalVisibleRect() covers at least <75> percent of the view's area)' doesn't match the selected view.\nExpected: (view has effective visibility and view.getGlobalVisibleRect() covers at least <75> percent of the view's area)\n Got: was null\n"}} 13:17:50.495 detox[2255] i ws-server@58442 send data: { "messageId": 14, "type": "testFailed", "params": { "details": "'(view has effective visibility and view.getGlobalVisibleRect() covers at least <75> percent of the view's area)' doesn't match the selected view.\nExpected: (view has effective visibility and view.getGlobalVisibleRect() covers at least <75> percent of the view's area)\n Got: was null\n" 13:17:50.495 detox[2256] i ws-client get message data: {"messageId":14,"type":"testFailed","params":{"details":"'(view has effective visibility and view.getGlobalVisibleRect() covers at least <75> percent of the view's area)' doesn't match the selected view.\nExpected: (view has effective visibility and view.getGlobalVisibleRect() covers at least <75> percent of the view's area)\n Got: was null\n"}} 13:17:50.495 detox[2256] E ws-client expect element to be visible error: Test Failed: '(view has effective visibility and view.getGlobalVisibleRect() covers at least <75> percent of the view's area)' doesn't match the selected view. Expected: (view has effective visibility and view.getGlobalVisibleRect() covers at least <75> percent of the view's area) Got: was null 13:17:50.496 detox[2256] B artifacts-manager onTestFnFailure args: ({"error":{"name":"DetoxRuntimeError"}}) 13:17:50.496 detox[2256] E artifacts-manager onTestFnFailure 13:17:50.496 detox[2256] E lifecycle test_fn error: Test Failed: '(view has effective visibility and view.getGlobalVisibleRect() covers at least <75> percent of the view's area)' doesn't match the selected view. Expected: (view has effective visibility and view.getGlobalVisibleRect() covers at least <75> percent of the view's area) Got: was null 13:17:50.497 detox[2256] B artifacts-manager onTestDone args: ({"title":"Abre o app na home, logado com as credenciais","fullName":"Home Abre o app na home, logado com as credenciais","status":"failed","invocations":1,"timedOut":false}) 13:17:50.497 detox[2256] E artifacts-manager onTestDone 13:17:50.497 detox[2256] E lifecycle Abre o app na home, logado com as credenciais 13:17:50.497 detox[2256] i lifecycle Home: Abre o app na home, logado com as credenciais [FAIL] 13:17:50.497 detox[2256] B artifacts-manager onRunDescribeFinish args: ({"name":"Home"}) 13:17:50.498 detox[2256] E artifacts-manager onRunDescribeFinish 13:17:50.498 detox[2256] E lifecycle Home 13:17:50.498 detox[2256] B artifacts-manager onRunDescribeFinish args: ({"name":"ROOT_DESCRIBE_BLOCK"}) 13:17:50.498 detox[2256] E artifacts-manager onRunDescribeFinish 13:17:50.498 detox[2256] E lifecycle run the tests 13:17:50.520 detox[2256] B lifecycle tear down environment 13:17:50.520 detox[2256] B artifacts-manager onBeforeCleanup args: () 13:17:50.520 detox[2256] E artifacts-manager onBeforeCleanup 13:17:50.521 detox[2256] i ws-client send message data: {"type":"cleanup","params":{"stopRunner":false},"messageId":-49642} RUNS e2e/E2E.test.js 13:17:50.521 detox[2255] i ws-server@58442 get data: {"type":"cleanup","params":{"stopRunner":false},"messageId":-49642} 13:17:50.522 detox[2255] i ws-server@58519 send data: { "type": "cleanup", "params": { "stopRunner": false }, "messageId": -49642 } 13:17:50.523 detox[2255] i ws-server@58519 get data: {"messageId":-49642,"type":"cleanupDone","params":{}} 13:17:50.523 detox[2255] i ws-server@58442 send data: { "messageId": -49642, "type": "cleanupDone", 13:17:50.523 detox[2256] i ws-client get message data: {"messageId":-49642,"type":"cleanupDone","params":{}} RUNS e2e/E2E.test.js 13:17:50.525 detox[2255] i ws-server tester exited session 1d713e11-daa1-f111-5b8d-2431dee5b19f 13:17:50.525 detox[2255] i ws-server@58519 send data: { "type": "testerDisconnected", "messageId": -1 13:17:50.526 detox[2256] i child-process:SPAWN_KILL sending SIGINT to: /Users/breno.gomes/Library/Android/sdk/platform-tools/adb -s emulator-12270 shell am instrument -w -r -e detoxServer ws://localhost:58441 -e detoxSessionId 1d713e11-daa1-f111-5b8d-2431dee5b19f -e debug false br.com.softplan.sajadv.test/androidx.test.runner.AndroidJUnitRunner 13:17:50.527 detox[2256] i child-process:SPAWN_END /Users/breno.gomes/Library/Android/sdk/platform-tools/adb -s emulator-12270 shell am instrument -w -r -e detoxServer ws://localhost:58441 -e detoxSessionId 1d713e11-daa1-f111-5b8d-2431dee5b19f -e debug false br.com.softplan.sajadv.test/androidx.test.runner.AndroidJUnitRunner terminated with SIGINT 13:17:50.527 detox[2256] i child-process:EXEC_CMD "/Users/breno.gomes/Library/Android/sdk/platform-tools/adb" -s emulator-12270 reverse --remove tcp:58441 13:17:50.532 detox[2256] B device free args: ({"adbName":"emulator-12270"}, {"shutdown":false}) 13:17:50.533 detox[2256] E device free 13:17:50.534 detox[2256] E lifecycle tear down environment 13:17:50.534 detox[2256] E lifecycle e2e/E2E.test.js FAIL e2e/E2E.test.js (48.623 s) Autenticação ✓ Inicia na tela de login (24819 ms) ✕ Realiza o login com multiplos domínios (6221 ms) ✕ Apresenta o formuário de satisfação (8104 ms) Home ✕ Abre o app na home, logado com as credenciais (4026 ms) ● Autenticação › Realiza o login com multiplos domínios Test Failed: '(view has effective visibility and view.getGlobalVisibleRect() covers at least <75> percent of the view's area)' doesn't match the selected view. Expected: (view has effective visibility and view.getGlobalVisibleRect() covers at least <75> percent of the view's area) Got: was null 41 | // espera buscar os domínios 42 | await new Promise(r => setTimeout(r, 3000)); > 43 | await expect(element(by.id('domain.1'))).toBeVisible(); | ^ 44 | 45 | await element(by.id('domain.1')).tap(); 46 | await expect(element(by.id('dialog-login-button'))).toBeVisible(); at Object.toBeVisible (e2e/E2E.test.js:43:46) at asyncGeneratorStep (node_modules/@babel/runtime/helpers/asyncToGenerator.js:3:24) at _next (node_modules/@babel/runtime/helpers/asyncToGenerator.js:22:9) ● Autenticação › Apresenta o formuário de satisfação Test Failed: '(view has effective visibility and view.getGlobalVisibleRect() covers at least <75> percent of the view's area)' doesn't match the selected view. Expected: (view has effective visibility and view.getGlobalVisibleRect() covers at least <75> percent of the view's area) Got: was null 54 | await device.reloadReactNative(); 55 | await new Promise(r => setTimeout(r, 8000)); > 56 | await expect(element(by.id('respond-later-button'))).toBeVisible(); | ^ 57 | await element(by.id('respond-later-button')).tap(); 58 | await expect(element(by.text('Calendário'))).toBeVisible(); 59 | }); at Object.toBeVisible (e2e/E2E.test.js:56:58) at asyncGeneratorStep (node_modules/@babel/runtime/helpers/asyncToGenerator.js:3:24) at _next (node_modules/@babel/runtime/helpers/asyncToGenerator.js:22:9) ● Home › Abre o app na home, logado com as credenciais Test Failed: '(view has effective visibility and view.getGlobalVisibleRect() covers at least <75> percent of the view's area)' doesn't match the selected view. Expected: (view has effective visibility and view.getGlobalVisibleRect() covers at least <75> percent of the view's area) Got: was null 68 | // await device.enableSynchronization(); 69 | await new Promise(r => setTimeout(r, 4000)); > 70 | await expect(element(by.text('Calendário'))).toBeVisible(); | ^ 71 | }); 72 | }); 73 | at Object.toBeVisible (e2e/E2E.test.js:70:50) at asyncGeneratorStep (node_modules/@babel/runtime/helpers/asyncToGenerator.js:3:24) at _next (node_modules/@babel/runtime/helpers/asyncToGenerator.js:22:9) 13:17:50.538 detox[2256] i ipc dispatching event to primary-2255 /tmp/detox.primary-2255 : reportTestResults , { testResults: [ { success: false, testFilePath: '/Users/breno.gomes/Desktop/git-novo/adv-mobile-app/e2e/E2E.test.js', testExecError: undefined, isPermanentFailure: false } ] } 13:17:50.538 detox[2255] i ipc received event of : reportTestResults { testResults: [ { success: false, testFilePath: '/Users/breno.gomes/Desktop/git-novo/adv-mobile-app/e2e/E2E.test.js', isPermanentFailure: false } ] } 13:17:50.539 detox[2255] i ipc dispatching event to socket : reportTestResultsDone { testResults: [ { success: false, testFilePath: '/Users/breno.gomes/Desktop/git-novo/adv-mobile-app/e2e/E2E.test.js', isPermanentFailure: false } ] } 13:17:50.539 detox[2255] i ipc broadcasting event to all known sockets listening to /tmp/detox.primary-2255 : sessionStateUpdate { testResults: [ { success: false, testFilePath: '/Users/breno.gomes/Desktop/git-novo/adv-mobile-app/e2e/E2E.test.js', isPermanentFailure: false } ] } 13:17:50.539 detox[2256] i ipc ## received events ## 13:17:50.539 detox[2256] i ipc detected event reportTestResultsDone { testResults: [ { success: false, testFilePath: '/Users/breno.gomes/Desktop/git-novo/adv-mobile-app/e2e/E2E.test.js', isPermanentFailure: false } ] } 13:17:50.540 detox[2256] i ipc connection closed primary-2255 /tmp/detox.primary-2255 0 tries remaining of 0 13:17:50.540 detox[2256] i ipc secondary-2256 exceeded connection rety amount of or stopRetrying flag set. 13:17:50.541 detox[2255] i ipc socket disconnected secondary-2256 13:17:50.546 detox[2256] i child-process:EXEC_SUCCESS 13:17:50.641 detox[2255] E lifecycle Command failed with exit code = 1: jest --config e2e/jest.config.js 13:17:50.642 detox[2255] i ws-server Detox server has been closed gracefully 13:17:50.643 detox[2255] i ws-server app exited session 1d713e11-daa1-f111-5b8d-2431dee5b19f 13:17:50.643 detox[2255] E ws-server@58519 connection :58441<->:58519 13:17:50.643 detox[2255] E lifecycle node_modules/.bin/detox test --configuration android.emu.release --loglevel trace breno.gomes@SOFT009051 adv-mobile-app % ```

Device logs

Device logs ``` paste your device.log here! ```

More data, please!

No response

ericschaal commented 1 year ago

Hi @gomesbreno, this is most likely linked to https://github.com/wix/Detox/issues/3762.

markios commented 1 year ago

I can confirm this happens for me on API 33 & 34. Even with the latest patch for Detox@20.13.1. My only option has been to downgrade to API 32, which also has an issue of really slow keyboard entry.

Is anyone else experiencing this?

stale[bot] commented 11 months ago

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.

apurva-harvest commented 10 months ago

typeText is really slow on Android. Once done, I also see s_glBindAttribLocation: bind attrib 0 name position which I have no idea how to resolve. Also, once typing is done, the test doesn't proceed and shows The app is busy with the following tasks: • 1 network requests with URLs in the log.

SilverLinings89 commented 7 months ago

I also get this in a test: s_glBindAttribLocation: bind attrib 0 name position s_glBindAttribLocation: bind attrib 1 name color s_glBindAttribLocation: bind attrib 2 name localCoor

alex-vasylchenko commented 7 months ago

+1 RN: 0.72.6 detox: 20.20.2

meantgx commented 5 months ago

same to me RN : 0.72.3 detox : 20.21.0

eugenezhernakov commented 2 months ago

Also experiencing this RN: 0.74.5 Detox: 20.25.2

IgorGanapolsky commented 1 month ago

typeText is really slow on Android. Once done, I also see s_glBindAttribLocation: bind attrib 0 name position which I have no idea how to resolve. Also, once typing is done, the test doesn't proceed and shows The app is busy with the following tasks: • 1 network requests with URLs in the log.

Probably because Android is doing all kinds of AI/ML stuff for every text input typing.