'I wrote below e2e test cases for react-native app, its working fine for iOS, not working fine with android

I am using Appium with Webdriver IO, Mocha and Chai for end-to-end testing of the react-native app.

Error: element ("~dashboard") still not existing after 15000ms...

Note: THIS TEST IS WORKING IN iOS PLATFORM BUT NOT IN ANDROID

it.only('Login test: valid case', async () => {
        await $('~email').setValue('[email protected]');
        await $('~password').setValue('Test@123');
        await $('~login').click().then(
            async () => {
                let status = await $("~dashboard").waitForExist({ timeout: 15000 })
                console.log(status);
                expect(status).to.equal(true);
            }
        )
    });

Login Screen

<View>
  <Input accessibilityLabel="email" testID="email"/>
  <Input accessibilityLabel="password" testID="password"/>
 <Button  accessibilityLabel="login" testID="login" onPress={() => onSubmit()}> Sign In</Button>
</View>

Dashboard Screen

 <ScrollView accessible={true} accessibilityLabel="dashboard" testID="dashboard" >
<ScreenContent/> //custom component
<ScrollView>


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source