You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Our end-to-end test has some intermittent issues with downloads failing due to temporary network outages. We want to add mitigation to the E2E test which checks for the download failure and retries it a couple of times, to reduce manual intervention for transient errors. We tried to do the following:
awaitPromise.race([waitFor(element(by.id('retry-download-button'))).toBeVisible().withTimeout(10*1000),waitFor(element(by.id('home-screen'))).toBeVisible().withTimeout(10*1000),])if(downloadbutton is visible){retry}
The goal being to handle the success and failure cases cleanly. But this triggers the following error introduced in #3003:
Detox has detected multiple interactions taking place simultaneously. Have you forgotten to apply an await over one of the Detox actions in your test code?
What was the expected behaviour?
First waitFor call to timeout settles the Promise.race call, mitigation only gets applied if needed. Maybe the error message should only be checking for actual interactions, and not expectations such as waitFor().toBeVisible().
Was it tested on latest Detox?
I have tested this issue on the latest Detox release and it still reproduces.
Help us reproduce this issue!
No response
In what environment did this happen?
Detox version: 20.22.2
React Native version: 0.69.4
Has Fabric (React Native's new rendering system) enabled: no
Node version: v18
Test-runner (select one): jest
Detox logs
No response
Device logs
No response
More data, please!
No response
The text was updated successfully, but these errors were encountered:
This is expected behavior and I doubt Detox will change to support parallel assertions like this.
There's other approaches you can take, though. Due to Detox network synchronization you probably don't need the wait(...) - you could instead check if the retry download button is visible in a try/catch and loop accordingly:
async function homeLoaded() {
try {
await expect(element(by.id('home-screen'))).toBeVisible()
return true
}
catch {
await expect(element(by.id('retry-download-button'))).toBeVisible()
return false
}
}
// somewhere in a test or utility function
let count = 0;
let result = await homeLoaded()
while (!result && count < 3) {
await element(by.id('retry-download-button')).tap()
result = await homeLoaded()
count++;
}
What happened?
Our end-to-end test has some intermittent issues with downloads failing due to temporary network outages. We want to add mitigation to the E2E test which checks for the download failure and retries it a couple of times, to reduce manual intervention for transient errors. We tried to do the following:
The goal being to handle the success and failure cases cleanly. But this triggers the following error introduced in #3003:
What was the expected behaviour?
First waitFor call to timeout settles the Promise.race call, mitigation only gets applied if needed. Maybe the error message should only be checking for actual interactions, and not expectations such as waitFor().toBeVisible().
Was it tested on latest Detox?
Help us reproduce this issue!
No response
In what environment did this happen?
Detox version: 20.22.2
React Native version: 0.69.4
Has Fabric (React Native's new rendering system) enabled: no
Node version: v18
Test-runner (select one): jest
Detox logs
No response
Device logs
No response
More data, please!
No response
The text was updated successfully, but these errors were encountered: