I'm doing UI testing in Swift and the app I'm testing shows many update/progress messages using the pod SVProgressHud. I want to be able to verify whether the correct message is being displayed. How can I capture the SVProgress HUD and get its text?
Asked
Active
Viewed 1,332 times
3 Answers
1
SVProgressHud is accessibility-ready (at least the version 1.1.3 that I'm using), so it's as simple as:
let message = app.otherElements["Your update/progress message"]
If you're also looking for string localization in UI tests target, please refer to this answer: https://stackoverflow.com/a/44014704/1104337

imilakovic
- 134
- 8
-1
Show SVProgressHUD with text and setting ring thickness in Swift 4
func startLoader(){
DispatchQueue.main.async {
SVProgressHUD.show(withStatus: "Loading...")
SVProgressHUD.setDefaultStyle(SVProgressHUDStyle.dark)
SVProgressHUD.setRingThickness(3.0)
SVProgressHUD.setMinimumDismissTimeInterval(2.0)
}
}
Thanks!

Mahesh Chaudhari
- 797
- 9
- 9
-1
Hide SVProgressHUD in Swift 4
func stopLoader(){
DispatchQueue.main.async {
SVProgressHUD.dismiss()
}
}
Thanks!

Mahesh Chaudhari
- 797
- 9
- 9