Closed GittyAjay closed 1 year ago
Hi @GittyAjay, it seems like there's a network request that doesn't end and your test reaches timeout. The test cannot continue until the app is idle, which is part of our synchronization mechanism.
You can exclude this network request from being synchronized using device.setURLBlacklist([urls])
API. See our documentation for that.
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.
The issue has been closed for inactivity.
hi @GittyAjay are you able to fix this issue?
Any updates on a fix for this? @asafkorem I tried to do as you said but since the execution is stuck on the launchApp I can't blacklist the urls.
@asafkorem Can I please ask to reopen this issue? Many people still have the same problem! Even after trying what you suggested.
It's definitely an onging issue, we have it with the following specs:
"react-native": "0.72.6",
"detox": "^20.13.1",
EDIT Forgot to mentions that this only happens on iOS
The issue that OP raised is usually fixed by ignoring certain regexps, e.g.:
Your app may be busy with any tasks, not necessarily network requests. Specifically for the always-running network requests like socket connections, see the example above.
I actually found the fix @grenos try this solution (replace url link to your actual network call link): describe('Check for Login Screen', () => { beforeAll(async () => { await device.launchApp({ newInstance: true, launchArgs: { detoxURLBlacklistRegex: '\("https://typeYourNetworkCallHere.com/*")' }, permissions: { notifications: 'YES', userTracking: 'YES' }, }) })
Sometimes the problem comes from a front-end process like endless animation. I was able to bypass it by disabling the device synchronization temporarily.
await device.disableSynchronization()
// action you want to execute
// ex.
await button.tap()
await device.enableSynchronization()
Description
Code
`import { device } from 'detox'; describe('App Test', () => {
beforeAll(async () => { await device.launchApp(); });
beforeEach(async () => { await device.reloadReactNative(); });
it('should have login screen', async () => {
}); });`
and it ends with error
● App Test › should have login screen
thrown: "Exceeded timeout of 120000 ms for a hook. Add a timeout value to this test to increase the timeout, if this is a long-running test. See https://jestjs.io/docs/api#testname-fn-timeout."
2 | describe('App Test', () => { 3 |
at beforeAll (e2e/starter.test.js:4:5) at Object.describe (e2e/starter.test.js:2:1)
Your environment
Detox version: 20.5.0 React Native version: 0.64.1 Node version: 19.7.0 Device model: Iphone-12 OS: macos 11.6.7 Test-runner: jest