How can I set accessibilityIdentifier to UIAlertController?

前端 未结 4 1684
梦毁少年i
梦毁少年i 2021-02-05 05:56

This is how I simply create UIAlertController and present it on the screen:

private class func showAlertWithTitle(title: String, message: String) {
         


        
4条回答
  •  不要未来只要你来
    2021-02-05 06:31

    Right now I have a UIAlertAction called addCamera and I'm just doing:

    addCamera.accessibilityLabel = "camera-autocomplete-action-photo"

    That allows me to tap it in UI Tests as follows:

    app.sheets.buttons["camera-autocomplete-action-photo"].firstMatch.tap()

提交回复
热议问题