UI Testing iOS Tutorial
HTML-код
- Опубликовано: 27 ноя 2024
- My full length Udemy course: Saving Data in Your iOS App Using Core Data: bit.ly/30dcIjA
Check out my new full length iOS course:
Saving Data using Core Data: skl.sh/2O23FMN
#codepro #swift #UITesting #ios #OnPatreon #iOSProgramming
In this tutorial we will learn how to take advantage of UI Testing to automate a lot of the manual testing that we would normally have to do. UI Testing is great for testing different integration paths in your app and should definitely not be overlooked when you build out your test suite.
Starter Project: github.com/the...
-
50% off iOS Development Fundamentals Course on Udemy:
Udemy: bit.ly/2JfXdyn
or use CODEPRO999 for 50% off the course price.
Skillshare: skl.sh/2GgUwOL
Check out some of the apps I've built:
itunes.apple.c...
itunes.apple.c...
itunes.apple.c...
itunes.apple.c...
-
Follow Code Pro on:
Twitter: / codepro7
Patreon: / codepro
Facebook: / thecodepro
If you found this tutorial helpful please like the video, share the video, and subscribe to CodePro. You can follow CodePro on Twitter, Facebook, for the latest channel news and updates.
UI testing can really help automate a lot of the manual test flows in your app and helps provide an additional layer of protection to catch bugs before they go out to production. If you want to clone the starter project you can find that here: Starter Project: github.com/thecodepro/ios-ui-testing-tutorial
I want to grow my UI testing any thoughts? **programmatically** no IB.
Unable to access the login
Great tutorial! The only thing I’d recommend is to refactor your code and make reusable code that you’d utilize in your other tests. It also helps to keep them maintainable.
I know it’s a lot to put in one video.
Great job!
Hello Sir, Great Job must say :-) i have question in click on ui we see the code in ui testing file so how i know that it working or not .?? Ui is perfect or not I don’t have much idea about that so can you please tell me in brief so i can understand that Thank You And Please make a one video for Unit Testing :-)
Ultimately you have to eyeball the code generated from the UI test after you click into the UI and begin recording. Usually the recording Xcode does will not be optimal and you can streamline the code that Xcode generates and consolidate things. Once you've got that working you need to add in your Assertions. If you expect that when you click a certain UI element that you should be taken to another view controller or screen, you can write an XCAssertion that captures that. So in the future, if a transition ever fails (maybe a service call fails that should be working) that XCTAssertion will catch that a transition to another screen didn't occur and you'll know your UI tests are catching a real problem. You'll have to also make use of XCTestExpectations as well for async tasks that might not finish immediately. Hope that helps clarify things.
I came across another problem: at the beginning of a test (before let app = XCUIApplication()) make sure you type XCUIApplication().activate(). Otherwise your test won't run.
Furthermore to untangle the Keyboard as shown in the Tutorial it is called differently now. You click in the Simulator and then in the Featuresbar at the top of the screen select " I/O". There you will find Keyboard to disable it
Thank you very much. I didn't even know there was a recording button for generating codes automatically! It helps me a lot!
Awsm content, but i have one quick question what if we want to test if user is already logged in using userdefaults. E.g if user already logged in then my login screen wont popup so in this case my test case failed.
Excellent refresher. Thank you!
Hi Code Pro! Thanks for the tutorial, the only question is that did you change the password for the app? Because I'm not able to login
Thanks, great intro, very helpful and interesting. Are there any other UI testing videos?
So helpful, thank you!
it's really helpful,great job
Cracking video. Well explained, very helpful. Subscribed!
Very helpful.
thanks man . You are the best!
Great tutorial. This was really helpful
Excellent tutorial sir... Finally I am able to understand the UI testing part. But one thing I need know that in real life app we need to fire API in login action. So what will be the perfect approch then? Suppose I want to check if the login API response is successful then I want to move to another view controller. How can I test with the URL response? Or I have to make a mock API response class like you have shown in the unit testing tutorial? Please guide me. Thanks again.
That's where UI testing can be tricky because it's a lot of black box testing. Only considering UI testing (without mocking) you would have know what the UI elements you'd expect to see on a successful login. Then you can assert that certain screen elements match what you are expecting in a successful scenario. If you didn't navigate to those screens then your login failed and you can catch it that way in the UI tests.
thanks Dude!awesom!
at 14:50 Can someone please tell me what does NSPredicate(format: "exists == 1") mean here?
I would definatly enrol for your Udemy/Skillshare course of XCUITest for intermediate or Advance concepts, Please let me know if you have prepared anything like that.
Very helpful . thank you :-)
Hey, great audio! Bookmarked for complete viewing later
This was great, and the first time UITests seemed easy to me. We are planning to implement testing in my project and this is a good reference.
Thanks glad you found this helpful. UI Tests are easy to overlook but if used properly they can really catch a lot of bugs and problems throughout the development process.
i had to laugh hard at the intro, thank you :-)
thanks
I don't know what it is exactly, but the program is pretty buggy (doesn't work as expected/ as it does at your screen) therefore the tests etc. bug aswell. Sometimes you log in and don't even see the "My Downloads". Sometimes you aren't even logged in and see the "My Downloads".
e.g. the "fake arrows" besides the rows (guess those are called links or sth) aren't there aswell.
I Have followed the same steps but the code is not autogenerating. Should we need to do anything else
I had the same bug in XCode 11.0, later versions solved it. Makes you wonder if Apple uses this for their own apps...
Спасибо брать выручил
Supabbbbbbb ..
Thanks