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.

Комментарии • 39

  • @CodePro
    @CodePro  6 лет назад +3

    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

    • @marlhex6280
      @marlhex6280 4 года назад

      I want to grow my UI testing any thoughts? **programmatically** no IB.

    • @nargizreza1541
      @nargizreza1541 4 года назад

      Unable to access the login

  • @Eugene.Berezin
    @Eugene.Berezin 5 лет назад +7

    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!

  • @YogeshPateliOS
    @YogeshPateliOS 6 лет назад +3

    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 :-)

    • @CodePro
      @CodePro  6 лет назад +1

      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.

  • @RePuLseHQKing
    @RePuLseHQKing 4 года назад +1

    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

  • @myrickchow3039
    @myrickchow3039 4 года назад

    Thank you very much. I didn't even know there was a recording button for generating codes automatically! It helps me a lot!

  • @randhirkumar1527
    @randhirkumar1527 4 года назад

    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.

  • @ribaker822
    @ribaker822 3 года назад

    Excellent refresher. Thank you!

  • @nargizreza1541
    @nargizreza1541 4 года назад

    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

  • @Vyacheslavskiy
    @Vyacheslavskiy 5 лет назад

    Thanks, great intro, very helpful and interesting. Are there any other UI testing videos?

  • @DhavalHNena
    @DhavalHNena 2 года назад

    So helpful, thank you!

  • @amolpawar3537
    @amolpawar3537 6 лет назад +1

    it's really helpful,great job

  • @jamesliscombe9006
    @jamesliscombe9006 5 лет назад

    Cracking video. Well explained, very helpful. Subscribed!

  • @remy-
    @remy- Год назад

    Very helpful.

  • @ЗеленскийЗеленский-у1ф

    thanks man . You are the best!

  • @waqar245
    @waqar245 5 лет назад

    Great tutorial. This was really helpful

  • @somenathbanerjee6236
    @somenathbanerjee6236 5 лет назад +1

    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.

    • @CodePro
      @CodePro  5 лет назад +1

      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.

  • @Князь-я7щ
    @Князь-я7щ 3 года назад

    thanks Dude!awesom!

  • @alexl2512
    @alexl2512 3 года назад +1

    at 14:50 Can someone please tell me what does NSPredicate(format: "exists == 1") mean here?

  • @nasir519
    @nasir519 4 года назад

    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.

  • @pradeepsagar4312
    @pradeepsagar4312 4 года назад

    Very helpful . thank you :-)

  • @605dave
    @605dave 6 лет назад

    Hey, great audio! Bookmarked for complete viewing later

    • @605dave
      @605dave 6 лет назад

      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.

    • @CodePro
      @CodePro  6 лет назад

      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.

  • @maxgairing
    @maxgairing 4 года назад

    i had to laugh hard at the intro, thank you :-)

  • @applepie7282
    @applepie7282 5 лет назад

    thanks

  • @RePuLseHQKing
    @RePuLseHQKing 4 года назад

    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".

    • @RePuLseHQKing
      @RePuLseHQKing 4 года назад

      e.g. the "fake arrows" besides the rows (guess those are called links or sth) aren't there aswell.

  • @vrishabreddy8652
    @vrishabreddy8652 5 лет назад

    I Have followed the same steps but the code is not autogenerating. Should we need to do anything else

    • @robinandthedog
      @robinandthedog 5 лет назад

      I had the same bug in XCode 11.0, later versions solved it. Makes you wonder if Apple uses this for their own apps...

  • @cursalex
    @cursalex 3 года назад

    Спасибо брать выручил

  • @jamesoesten7508
    @jamesoesten7508 5 лет назад

    Supabbbbbbb ..

  • @paulancajima
    @paulancajima 4 года назад

    Thanks