Hey, great framewrok. I just got stuck on confirming alert message.
I have simple code:
Alert.alert('Great!', 'Now Check us out.', [
{ text: 'Continue', onPress: () => { this.handleContinue() } }
])
How do I confirm the dialog? Thanks a lot for your help.
Did you try to use text matcher?
await element(by.text('Continue')).tap();
Element by text should work if I recall correctly.
This doesn't work if there is another element with the same label on the screen. Is there anything I can add to the matcher to make it more specific and only match the correct element?
@almost Not sure if this is still relevant, but for my case I used .and() with UIAlertControllerActionView to narrow it down.
https://stackoverflow.com/questions/47522081/detox-ios-simulator-how-to-confirm-alert-message
Hey there, I was trying to do the same, but using @anton6 didn't work for me now. Is there any other way to accomplish this? Thanks!
@jaumevn which iOS version? Do you know if it's the by.label or by.type part that fails to find the element?
@anton6 It fails in the by.label part, I'm using iOS 11.3 version.
Most helpful comment
Did you try to use
text matcher?