Working on writing a login detox test for react-native. Basic test and looks like this:
await element(by.id('email')).typeText('email\n');
await element(by.id('password')).typeText('password\n');
await element(by.id('login_btn')).tap();
This works fine on iOS but errors on Android:
Test Failed: No views in hierarchy found matching: (with tag value: is "login_btn" and view has effective visibility=VISIBLE)
Error: Command failed: jest --config e2e/config.json --testNamePattern "^((?!:ios:).)*$" --maxWorkers 1 e2e
However, the test does actually click the button (so it can find it) and completes, but it still gives the error and fails. If I replace the tap() procedure with this line:
await waitFor(element(by.id('login_btn'))).toBeVisible();
Then the button IS clicked (which is unexpected) and the test passes. I do not believe this is the expected behaviour by any means and I am fairly confused by this. Any ideas?