Search code examples
javascripte2e-testingdetox

How do I control the alert use detox in iOS?


enter image description here

I tried using the following to push the OK button, but it does not work. await element (by.text ('Hello')). tap ();

https://github.com/wix/detox/blob/master/docs/ There is a note, but it does not seem to be about how to control the system pop-up window.

If you know, please let me know.


Solution

  • I have been able to do the following to tap on a native iOS alert.

    await element(by.label('OK').and(by.type('_UIAlertControllerActionView'))).tap();
    

    I got the solution from here Detox: iOS Simulator how to confirm alert message