Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test runs fine on iOS, but tails on Android #716

Closed
compojoom opened this issue May 6, 2018 · 6 comments
Closed

test runs fine on iOS, but tails on Android #716

compojoom opened this issue May 6, 2018 · 6 comments

Comments

@compojoom
Copy link

I have a simple login test:


  it('should be able to login', async () => {
    await element(by.id('login')).tap()
    await expect(element(by.id('LoginScreen'))).toBeVisible()
    await element(by.id('email')).typeText('[email protected]')
    await element(by.id('password')).replaceText('xxx')
    await element(by.id('loginButton')).tap()
    await expect(element(by.id('companiesScreen'))).toBeVisible()
  })

This works fine on iOS. The user is logged in and sees the companiesScreen. The test fails on Android at the last line:
await expect(element(by.id('companiesScreen'))).toBeVisible()

If I change this to:
await waitFor(element(by.id('companiesScreen'))).toBeVisible().withTimeout(4000)

Then it works on android as well. The navigation in our app is done by react-native-router-flux, which users react-navigation.
WaitFor works, but it defeats the purpose of all this. I have another tests that also fail with the same conditions... Is this expected behavior or a bug?

@LeoNatan
Copy link
Contributor

LeoNatan commented May 6, 2018

Doesn't look like an expected behavior to me.

Please provide the all the logs and information as requested in the issue template.

Also, since we don't use JS navigation solutions, could you please recreate this in a minimal demo project and upload it for us? Thanks

@rotemmiz
Copy link
Member

rotemmiz commented May 7, 2018

What version of react native do you use?
Is there any setTimeout in your code which is set to run with delay smaller than 1500ms?

@compojoom
Copy link
Author

thanks for the replies guys! So I tried to recreate the issue in a simple example, but it turns out that it's not react-native-router-flux... I took their example and added detox to it, but there I can run the tests on iOS and android. It must be something else in my code. I have redux and firebase - so it might be related to the network requests. Will try to add them to the sample project and see if I'll manage to recreate the issue. Please leave the issue open a little longer.

@LeoNatan
Copy link
Contributor

LeoNatan commented May 7, 2018

Sure. The bot might close it, but we can always reopen.

@markhu
Copy link

markhu commented May 11, 2018

It is important to note which version of react-native your project uses, as there have been known-incompatibilities with wix-detox from time to time. Last time I was able to use them together was RN 49.

@no-response no-response bot closed this as completed May 14, 2018
@no-response
Copy link

no-response bot commented May 14, 2018

This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don't have enough information to take action. Please reach out if you have or find the answers we need so that we can investigate further.

@wix wix locked and limited conversation to collaborators Jul 23, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants