This and the UI Testing videos are really well done! I bought the book from another hero of mine, Paul Hudson at Hacking With Swift, and have already read most of it! Nick, you really got me interested in TDD and would love to see a SwiftUI-based video on Unit Testing done in a TDD methodology. Thanks so much!
Your tutorial is very well structured and easy to understand. I read lots of Testing tutorials but could not get clear picture but now i understand very well. Thank you Nick
At time stamp 55:24 I think waitForExists is a little chance on something going away. Perhaps checking waitForExists then isHittable on an element that will be in view after the alert has disappeared would be better.
at 52:30 you mentioned that the waitForExistence call returns immediately if the target already exists. If that is indeed the case, then the call to waitForExistence you made at 53:48 should not be of any help (if it exists it returns immediately and if it doesn't you're waiting a full 5 seconds for nothing). If the test does pass (which it does) it means that you don't need any wait at that point, and you could just go ahead and run the exists check.
I think much better way to handle the alert not existing test would be to create expectation of not existing and then to wait for expectation with timeout. That way you finish the waiting period as soon as the expectation becomes true, which is what we want. Waiting for 5 seconds to confirm something does not exist seems like a small deal when you have 1 or 2 test, but I can imagine that a whole testing suite having this code will quickly add up.
One funny thing I noticed is that sometimes the simulator keyboard just won't pop up despite tapping on the textfield programmatically and that causes the test function to fail as it can't find any keyboard keys to tap on. Luckily manual keyboard toggle (Cmd+K) solves the issue for a long time and then it responds as it should even to programmatic tapping. Another great video, thanks you.
I had the same issue. I think I hit cmd-k when simulator was active to clean instead of cmd-shift-k when Xcode was active. It took me a while to figure out what went wrong. lol
@@JohnStrandt @Voeris You may have solved this by now but I discovered you can use .typeText() to avoid the issue and enter the text regardless of the keyboard state. So: if shouldTypeOnKeyboard { // let keyA = app.keys["A"] // keyA.tap() // let keya = app.keys["a"] // keya.tap() // keya.tap() textfield.typeText("Aaa") } - credit to ChatGPT for that one.
Thank you for the helpful UI Testing videos! I'm trying to refer to the UI element of the NFC session dialog or alert in my test, but I haven't been able to do so successfully. Do you have any tips or suggestions that could help me find and interact with this element? Thank you in advance for your help!
Do you know if it's possible to check views' colors and texts? I'm considering having those as VM's properties and assert that, OR use snapshot tests...
Thanks for the comment! No, I won't be covering UIKit. I believe SwiftUI is the future of iOS and is where new developers should spend most (if not all) of their time.
Hello, is is possible to read the iOS simulator or the real device console logs through XCUI test script, just to validate few things using the console log prints?
I skipped this video a year ago. I guess, and I came back and watched both UnitTesting and UITesting because I need these skills for applying jobs. Most of the job descriptions asks for familiarity with XCUnitTests and UITests. ❤️
It is the first time I learn UI Tests and I am glad you have been my captain on this trip, thanks a lot for this great tutorial!
Let’s goooo 🚀🚀🚀
This and the UI Testing videos are really well done! I bought the book from another hero of mine, Paul Hudson at Hacking With Swift, and have already read most of it! Nick, you really got me interested in TDD and would love to see a SwiftUI-based video on Unit Testing done in a TDD methodology. Thanks so much!
Once again, programming gold. This was a great introduction to UI testing.
Your videos are absolutely great! Very direct but you also explain. I have learned a lot.
Hey! Thanks for the comment :) Happy to help.
Your tutorial is very well structured and easy to understand. I read lots of Testing tutorials but could not get clear picture but now i understand very well. Thank you Nick
Thank you very much Nick, I think you are the best teacher i have ever seen. Hope to see new contents… thanks thanks thanks…
New content coming soon! Thanks Sinan :)
Great video as always! Around 34 minutes there is a dead zone that you forgot to edit out.
At time stamp 55:24 I think waitForExists is a little chance on something going away. Perhaps checking waitForExists then isHittable on an element that will be in view after the alert has disappeared would be better.
at 52:30 you mentioned that the waitForExistence call returns immediately if the target already exists. If that is indeed the case, then the call to waitForExistence you made at 53:48 should not be of any help (if it exists it returns immediately and if it doesn't you're waiting a full 5 seconds for nothing). If the test does pass (which it does) it means that you don't need any wait at that point, and you could just go ahead and run the exists check.
I think much better way to handle the alert not existing test would be to create expectation of not existing and then to wait for expectation with timeout. That way you finish the waiting period as soon as the expectation becomes true, which is what we want. Waiting for 5 seconds to confirm something does not exist seems like a small deal when you have 1 or 2 test, but I can imagine that a whole testing suite having this code will quickly add up.
Clear and good explanation 👏
You’re an awesome teacher, Nick!
Could you do some videos on using MapKit, please? 🙏
MapKit is great! The SwiftUI implementation is semi-limited so I was trying to wait for more features to be released 😌
One funny thing I noticed is that sometimes the simulator keyboard just won't pop up despite tapping on the textfield programmatically and that causes the test function to fail as it can't find any keyboard keys to tap on. Luckily manual keyboard toggle (Cmd+K) solves the issue for a long time and then it responds as it should even to programmatic tapping. Another great video, thanks you.
I had the same issue. I think I hit cmd-k when simulator was active to clean instead of cmd-shift-k when Xcode was active. It took me a while to figure out what went wrong. lol
@@JohnStrandt @Voeris You may have solved this by now but I discovered you can use .typeText() to avoid the issue and enter the text regardless of the keyboard state. So: if shouldTypeOnKeyboard {
// let keyA = app.keys["A"]
// keyA.tap()
// let keya = app.keys["a"]
// keya.tap()
// keya.tap()
textfield.typeText("Aaa")
}
- credit to ChatGPT for that one.
Allowing for the Return as well looks like:
if shouldTypeOnKeyboard {
textfield.typeText("Aaa
")
} else {
textfield.typeText("
")
}
Thank you for the helpful UI Testing videos! I'm trying to refer to the UI element of the NFC session dialog or alert in my test, but I haven't been able to do so successfully. Do you have any tips or suggestions that could help me find and interact with this element? Thank you in advance for your help!
Another awesome video. Thank you, Nick.
Ummm…. At 1:23:29… “boolExpr ? true : false” can just be “boolExpr”
Super video for beginners and pros.
You should have an statue, all your videos are awesome, since first one to last one
🥲😂 You make me cry lol thanks for the comment Alan
Superb!
Do you know if it's possible to check views' colors and texts? I'm considering having those as VM's properties and assert that, OR use snapshot tests...
I love your videos you made a really great job 👏 . I want to ask you if you have any good videos resources on uikit
Thanks for the comment! No, I won't be covering UIKit. I believe SwiftUI is the future of iOS and is where new developers should spend most (if not all) of their time.
Hello, is is possible to read the iOS simulator or the real device console logs through XCUI test script, just to validate few things using the console log prints?
Perfect video course.. thanky you!
hi, my test on 55:08 is still failing, even after .waitForExistance
I guess the .alert(isPresented:content:) was deprecated. I change the code to .alert(_ title:isPresented:actions:) and It is working.
I skipped this video a year ago. I guess, and I came back and watched both UnitTesting and UITesting because I need these skills for applying jobs. Most of the job descriptions asks for familiarity with XCUnitTests and UITests. ❤️
Hey I wanted to join the community you mentioned in the the video but don’t know how to
We’re in Discord: discord.gg/3Aa3aHrcS4
Excellent ❤
Thank you, awesome teacher!
Great one!
Thanks Tamas!
Does anyone know why on xcode 14 the record button is greyed out ?
you rock!!!🤙
💥💥💥👏
Great! Thank you very much!
For me it work without the sleep. Maybe they fixed some things related to this.
Could you please add subtitle Persian language auto translatio?
please firebase+storage+auh +crud with photo
Hi Kayra! Firebase playlist is coming soon 😇
@@SwiftfulThinking the Firebase playlist is the best ever. Most likely for years to come also. Thanks a lot.
@@SwiftfulThinking thanks for the Extra Firebase packages also.
My whole job is keyboarding 😂😂
record some vlogs!!
Hahaha I never though of that 😂 hmmm
@@SwiftfulThinking Do it