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

Cannot wait for system alerts 'Argument type IndexableSystemElement is not assignable to parameter type NativeElement' #4504

Open
1 of 2 tasks
APrincipe21 opened this issue Jun 7, 2024 · 2 comments

Comments

@APrincipe21
Copy link

APrincipe21 commented Jun 7, 2024

What happened?

Using the system.element(by.system.label("Allow")) method that was released two weeks ago is almost useless unless your app is built to conform to this. We login and the privacy alert is shown but there's some delay and no way to account for the delay other than a hard wait.

await waitFor(system.element(by.system.label("Allow")))
        .toBeVisible()
        .withTimeout(15000);

Above is not accepted due to 'Argument type IndexableSystemElement is not assignable to parameter type NativeElement' we should be able to call waitFor on this method since there's no way to precisely expect an iOS system alert.

What was the expected behaviour?

Ideally you would be able to wait until the alert is shown using other methods.

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:
React Native version:
Has Fabric (React Native's new rendering system) enabled: (yes/no)
Node version:
Device model:
iOS version:
macOS version:
Xcode version:
Test-runner (select one): jest / other

Detox logs

Detox logs
paste logs here!

Device logs

Device logs
paste your device.log here!

More data, please!

No response

@noomorph
Copy link
Collaborator

noomorph commented Jun 8, 2024

@asafkorem can you check this?

@asafkorem
Copy link
Contributor

@noomorph @APrincipe21 This is not a bug. This usage is invalid. System APIs can't be used with waitFor.
This can be an enhancement request, so I'll keep this open with new labels + contributions are welcome :)

TBH, I need to see it with my own eyes, other dialogs that we test on our test-app doesn't have this issue..

For now, if you have to, you can do a busy-sleep or implement some try-catch mechanism as a workaround.

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

No branches or pull requests

3 participants