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

Unable to find or interact with any elements on Android #163

Open
PaperbagWriter opened this issue Sep 14, 2023 · 4 comments
Open

Unable to find or interact with any elements on Android #163

PaperbagWriter opened this issue Sep 14, 2023 · 4 comments

Comments

@PaperbagWriter
Copy link
Contributor

I ran your example app with no problem on Android.

On the other end our mature app does not work as expected.
takeScreenshot works as expected but every interacting API method does nothing and hangs.
toExist and press do not find element. I'm 100% certain I have the right testID. We also have e2e tests with appium having no issues finding those elements by test ids.

We are on "react-native": "0.71.8"

Is there something I'm missing?

const { press, takeScreenshot } = require('react-native-owl');

const setDelay = (delay) => new Promise((resolve) => setTimeout(resolve, delay));

jest.setTimeout(50000);

describe('App.tsx', () => {
  it('presses a button, then takes a screenshot', async () => {
    await setDelay(5000);
    await press('ButtonSignIn');
    // never reaches this
    const screen = await takeScreenshot('afterButtonPress');
    expect(screen).toMatchBaseline();
  });
});

@PaperbagWriter PaperbagWriter changed the title Unable to find or interact with any elements Unable to find or interact with any elements on Android Sep 14, 2023
@frankcalise
Copy link

frankcalise commented Dec 8, 2023

Hi @PaperbagWriter, can you post your owl config?

I'm guessing you're building the Android debug buildType. I've found that if you set this to Release, it won't timeout anymore.

Not sure what is wrong with the debug buildType just yet - but maybe it unblocks you.

@AdityaVandan
Copy link

AdityaVandan commented Feb 12, 2024

I am experiencing the same thing on my mature app. Except takeScreenshot, other apis are timing out the tests.

@danibrutal
Copy link

Same here, it seems press can't find those elements on the screen. Any ideas to give a try?

@danibrutal
Copy link

In case it can help someone, we noticed this was an issue in our monorepo setup, due to how the client/index.app.ts is implemented.
If you have the node_modules in the root, and the package in a different directory, it's not gonna work.

We managed to make it work via pnpm setting shamefully-hoist=true in the .npmrc file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants