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
I have a test which uses a WebView to login to the application (done in a hacky way by using a text input with a button + injectedJavaScript as WebView instrumentation is not supported).
The problem appears because the login operation inside the WebView happens asynchronously and breaks the Detox synchronisation, so I have to synchronise myself manually with disableSynchronization and enableSynchronization.
After the login I have a stack transition animation to a new screen (from react-navigation) and I need to press a button on that screen to go further. However Detox still fails to synchronise with that screen so I am using tap to press on the button with synchronisation disabled.
This is where the problem happens, the tap doesn't always work, and in 50% of the time just fails with a timeout for any action done after the disableSynchronization call.
Can anyone recommend a workaround or knows what the problem is?
The code of my login method:
export const loginAs = async (userID) => {
await element(by.id('introLoginBtn')).tap();
await expect(element(by.id('loginScreen'))).toBeVisible();
const userIdInput = element(by.id('testUserIdInput'));
await userIdInput.tap();
await userIdInput.typeText(userID);
await element(by.id('testLoginBtn')).tap();
// NOTE: WebView login breaks synchronization see
// https://github.com/wix/Detox/blob/master/docs/Troubleshooting.Synchronization.md
await device.disableSynchronization();
// Waiting for the element to be visible
await waitFor(element(by.id('acceptTermsBtn'))).toBeVisible().withTimeout(9000);
// This does not work consistently
await element(by.id('acceptTermsBtn')).tap();
await device.enableSynchronization();
};
We use the issue tracker exclusively for bug reports and feature requests. This issue appears to be a general usage or support question. Instead, please ask a question on Stack Overflow with the detox tag.
Feel free to post your Stack Overflow question here for more visility. We'll take a look at it.
For more information on bots in this reporsitory, read this discussion.
Hello everyone
I have a test which uses a
WebView
to login to the application (done in a hacky way by using a text input with a button +injectedJavaScript
as WebView instrumentation is not supported).The problem appears because the login operation inside the
WebView
happens asynchronously and breaks the Detox synchronisation, so I have to synchronise myself manually withdisableSynchronization
andenableSynchronization
.After the login I have a stack transition animation to a new screen (from
react-navigation
) and I need to press a button on that screen to go further. However Detox still fails to synchronise with that screen so I am usingtap
to press on the button with synchronisation disabled.This is where the problem happens, the tap doesn't always work, and in 50% of the time just fails with a timeout for any action done after the
disableSynchronization
call.Can anyone recommend a workaround or knows what the problem is?
The code of my login method:
Environment:
Detox: 12.10.3.
React Native: 0.59.8
Node: v11.7.0
Device: iOS Emulator (iPhone 8)
OS: iOS
The text was updated successfully, but these errors were encountered: