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

TypeError: system.element(...).toExist is not a function #4606

Closed
2 tasks done
m1chael-sp opened this issue Oct 11, 2024 · 1 comment · Fixed by #4607
Closed
2 tasks done

TypeError: system.element(...).toExist is not a function #4606

m1chael-sp opened this issue Oct 11, 2024 · 1 comment · Fixed by #4607

Comments

@m1chael-sp
Copy link

What happened?

According to the documentation, I can use await system.element(by.system.label('Allow')).toExist(); to assert that the alert exsist, however when I called exactly that, I got an error system.element(...).toExist is not a function. I also couldn't find any type definition for the toExist function.
Screenshot 2024-10-11 at 3 14 36 PM

Screenshot 2024-10-11 at 3 15 37 PM

What was the expected behaviour?

await system.element(by.system.label('Allow')).toExist(); should work as expected

Was it tested on latest Detox?

  • I have tested this issue on the latest Detox release and it still reproduces.

Did your test throw out a timeout?

Help us reproduce this issue!

No response

In what environment did this happen?

Detox version: 20.27.3
React Native version: 0.73.6
Has Fabric (React Native's new rendering system) enabled: (yes/no)
Node version: 18.14.2
Device model: iPhone 16 simulator
iOS version: 18.0
macOS version: 14.6.1
Xcode version:
Test-runner: jest

Detox logs

Detox logs
paste logs here!

Device logs

Device logs
paste your device.log here!

More data, please!

No response

@asafkorem
Copy link
Contributor

You're right. This is a mistake in the docs, you should rewrite this with expect(...).toExist().

For instance:

await expect(system.element(by.system.label('Allow'))).toExist();

We will update the docs, thanks.

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

Successfully merging a pull request may close this issue.

2 participants