Detox: iOS Simulator how to confirm alert message
After some tinkering I ended up using this:
await element(by.label('Log out').and(by.type('_UIAlertControllerActionView'))).tap();
Not sure if this will work for every iOS version, but seem to work on 10.3 and 11.1
Use View Hierarchy Debugger provided by Xcode to see if the type has changed for a different version of iOS.
How do I control the alert use detox in iOS?
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
How to click this dialog with Detox? Obvious solution but I still can't tap it
Detox uses applesimutils to set permissions. This is battle tested in production at Wix and in Detox CI. Check out the docs and test project for examples.
How to tell Detox to wait for my elements to appear
You can use the waitFor
function with a timeout you define:
await waitFor(element(by.id('my-view'))).toBeVisible().withTimeout(5000)
this tells detox to wait 5000ms before failing.
See example here: https://github.com/wix/Detox/blob/master/docs/Troubleshooting.RunningTests.md#test-tries-to-find-my-component-before-its-created
Related Topics
How to Print Out a Property's Contents Using Xcode Debugger
Avplayer with Playback Controls of Avplayerviewcontroller
How to Access User Defined Runtime Attribute from the 'Sender' Object
Confirm Back Button on Uinavigationcontroller
Cgcontextsetfillcolorwithcolor: Invalid Context 0X0
Which Phassetcollection to Use for Saving an Image
Cordova Xcode Build Failed "Permission Denied"
Installing Openssl Library for Xcode
Mkmapview Doesn't Zoom Correctly While User Tracking Mode Is Mkusertrackingmodefollowwithheading
Insert String at Cursor Position of Uitextfield
How Can One Enable Keyboard Like in Imessages/Fb Messenger in Landscape Mode at iOS8
Module 'Googlemobileads' Not Found in iOS
Xcode 9 Crash When Open Storyboard
How to Overlay a Skscene Over a Scnscene in Swift
iOS 11 - Unable to Change Navigation Bar Height
Odd Property Declaration Syntax Containing Angular Brackets <>