UI Testing a SwiftUI application in Xcode | Advanced Learning #18

Поділитися
Вставка
  • Опубліковано 21 гру 2024

КОМЕНТАРІ • 57

  • @Pepe_the_raver
    @Pepe_the_raver Рік тому +2

    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!

  • @KimbrellBrad
    @KimbrellBrad 2 роки тому +8

    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!

  • @lincolndickerson1293
    @lincolndickerson1293 2 роки тому +4

    Once again, programming gold. This was a great introduction to UI testing.

  • @lionsctn5053
    @lionsctn5053 3 роки тому +13

    Your videos are absolutely great! Very direct but you also explain. I have learned a lot.

  • @manishparihar3361
    @manishparihar3361 Рік тому

    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

  • @habercim
    @habercim 3 роки тому +2

    Thank you very much Nick, I think you are the best teacher i have ever seen. Hope to see new contents… thanks thanks thanks…

  • @MarkVolkmann
    @MarkVolkmann 2 роки тому +4

    Great video as always! Around 34 minutes there is a dead zone that you forgot to edit out.

  • @lincolndickerson1293
    @lincolndickerson1293 2 роки тому

    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.

  • @vahidtavana6551
    @vahidtavana6551 2 роки тому

    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.

  • @tomaszkubiak1011
    @tomaszkubiak1011 Рік тому +1

    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.

  • @denaktepe
    @denaktepe Рік тому +1

    Clear and good explanation 👏

  • @alexsmithers866
    @alexsmithers866 3 роки тому +2

    You’re an awesome teacher, Nick!
    Could you do some videos on using MapKit, please? 🙏

    • @SwiftfulThinking
      @SwiftfulThinking  3 роки тому +4

      MapKit is great! The SwiftUI implementation is semi-limited so I was trying to wait for more features to be released 😌

  • @Voeris
    @Voeris Рік тому +1

    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.

    • @JohnStrandt
      @JohnStrandt Рік тому +1

      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

    • @chadgoodyear7905
      @chadgoodyear7905 11 днів тому

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

    • @chadgoodyear7905
      @chadgoodyear7905 11 днів тому

      Allowing for the Return as well looks like:
      if shouldTypeOnKeyboard {
      textfield.typeText("Aaa
      ")
      } else {
      textfield.typeText("
      ")
      }

  • @vishallandepatil6320
    @vishallandepatil6320 11 місяців тому

    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!

  • @stanleyejechi1417
    @stanleyejechi1417 2 роки тому

    Another awesome video. Thank you, Nick.

  • @MikeCargal
    @MikeCargal 2 роки тому +2

    Ummm…. At 1:23:29… “boolExpr ? true : false” can just be “boolExpr”

  • @NyxAndrew
    @NyxAndrew 6 місяців тому

    Super video for beginners and pros.

  • @alancasasarevalo7750
    @alancasasarevalo7750 3 роки тому +4

    You should have an statue, all your videos are awesome, since first one to last one

    • @SwiftfulThinking
      @SwiftfulThinking  3 роки тому +1

      🥲😂 You make me cry lol thanks for the comment Alan

  • @mdyaminmollah7044
    @mdyaminmollah7044 Рік тому +1

    Superb!

  • @HenriqueValcanaia
    @HenriqueValcanaia 10 місяців тому

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

  • @farescherni6946
    @farescherni6946 3 роки тому +2

    I love your videos you made a really great job 👏 . I want to ask you if you have any good videos resources on uikit

    • @SwiftfulThinking
      @SwiftfulThinking  3 роки тому +1

      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.

  • @muraliagreeya5161
    @muraliagreeya5161 Рік тому

    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?

  • @mksmithycz
    @mksmithycz 3 роки тому +1

    Perfect video course.. thanky you!

  • @lukavujnovac1025
    @lukavujnovac1025 3 роки тому

    hi, my test on 55:08 is still failing, even after .waitForExistance

    • @chancelee713
      @chancelee713 2 роки тому +1

      I guess the .alert(isPresented:content:) was deprecated. I change the code to .alert(_ title:isPresented:actions:) and It is working.

  • @kavinda_dilshan_paramsoodi
    @kavinda_dilshan_paramsoodi 5 місяців тому

    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. ❤️

  • @NaveenKaushal-rv3fe
    @NaveenKaushal-rv3fe 9 місяців тому +1

    Hey I wanted to join the community you mentioned in the the video but don’t know how to

  • @aleksandertesenkov1421
    @aleksandertesenkov1421 Рік тому +1

    Excellent ❤

  • @AdjieSatryo
    @AdjieSatryo 2 роки тому

    Thank you, awesome teacher!

  • @tamasterjek7520
    @tamasterjek7520 3 роки тому +1

    Great one!

  • @obsessed92
    @obsessed92 2 роки тому

    Does anyone know why on xcode 14 the record button is greyed out ?

  • @diviercadavid9345
    @diviercadavid9345 Рік тому +1

    you rock!!!🤙

  • @sattorjabborov2728
    @sattorjabborov2728 Рік тому +1

    💥💥💥👏

  • @ShooMPozitiV
    @ShooMPozitiV 2 роки тому

    Great! Thank you very much!

  • @TheSpiralnotizblock
    @TheSpiralnotizblock 2 роки тому

    For me it work without the sleep. Maybe they fixed some things related to this.

  • @TrueMomentsVelogs
    @TrueMomentsVelogs 7 місяців тому

    Could you please add subtitle Persian language auto translatio?

  • @kayrawolf8937
    @kayrawolf8937 3 роки тому +2

    please firebase+storage+auh +crud with photo

    • @SwiftfulThinking
      @SwiftfulThinking  3 роки тому +8

      Hi Kayra! Firebase playlist is coming soon 😇

    • @NyxAndrew
      @NyxAndrew 6 місяців тому

      @@SwiftfulThinking the Firebase playlist is the best ever. Most likely for years to come also. Thanks a lot.

    • @NyxAndrew
      @NyxAndrew 6 місяців тому

      @@SwiftfulThinking thanks for the Extra Firebase packages also.

  • @BABEENGINEER
    @BABEENGINEER 2 роки тому

    My whole job is keyboarding 😂😂

  • @lukavujnovac1025
    @lukavujnovac1025 3 роки тому +1

    record some vlogs!!