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.
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?
- I have followed the instructions under Identifying which synchronization mechanism causes us to wait too much.
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.