wix/Detox

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

m1chael-sp opened this issue · 1 comments

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

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.