I'm using detox with following config:
"react": "16.13.1", "react-native": "0.63.4" "detox": "^18.6.2", "jest": "^26.6.3", "jest-circus": "^26.6.3"
detox build command runs perfectly, but detox test fails with the following error:
detox[13327] INFO: [DetoxServer.js] server listening on localhost:59074...
detox[13327] INFO: Example is assigned to emulator-17544 (Pixel_API_28_AOSP)
detox[13327] INFO: Example: should have welcome screen
detox[13327] INFO: Example: should have welcome screen [FAIL]
detox[13327] WARN: [Client.js/PENDING_REQUESTS] App has not responded to the network requests below:
(id = -1000) isReady: {}
Unresponded network requests might result in timeout errors in Detox tests.
FAIL e2e/firstTest.e2e.js
Example
✕ should have welcome screen
● Example › should have welcome screen
DetoxRuntimeError: Failed to run application on the device
HINT: Most likely, your tests have timed out and called detox.cleanup() while it was waiting for "ready" message (over WebSocket) from the instrumentation process.
at MonitoredInstrumentation._getInstrumentationCrashError (../node_modules/detox/src/devices/drivers/android/tools/MonitoredInstrumentation.js:68:12)
at MonitoredInstrumentation._rejectPendingCrashPromise (../node_modules/detox/src/devices/drivers/android/tools/MonitoredInstrumentation.js:56:37)
at MonitoredInstrumentation._onInstrumentationTerminated (../node_modules/detox/src/devices/drivers/android/tools/MonitoredInstrumentation.js:51:10)
at Instrumentation._onTerminated (../node_modules/detox/src/devices/drivers/android/tools/Instrumentation.js:52:18)
detox[13326] ERROR: [cli.js] Error: Command failed: jest --config e2e/config.json --testNamePattern '^((?!:ios:).)*$' --maxWorkers 1 e2e
I think there is some issue with device.launchApp() as the app also doesn't gets launched!
My firstTest.e2e.js file:
describe('Example', () => {
beforeAll(async () => {
await device.launchApp();
});
beforeEach(async () => {
await device.reloadReactNative();
});
it('should have welcome screen', async () => {
await expect(element(by.id('EditTextId'))).toBeVisible();
});
});