Flutter Testing Guide for Beginners - Part 2: Widget & Integration Tests

Поділитися
Вставка
  • Опубліковано 10 лют 2025
  • 📗 Get the code snippets & project repo👇👇
    resocoder.com/...
    📧 Get Flutter news 📰 and resources:
    👉 flutter.education
    👨‍💻 Do you write good code? Find out now!
    resocoder.com/...
    In the first part of this short tutorial series, you’ve learned everything regarding the basics and principles of testing in Flutter and also how to write unit tests together with test-driven development. In this second part, you’re going to learn a lot about widget tests and integration tests in Flutter.
    Go to my website for more information, code examples, and articles:
    ● resocoder.com
    Follow me on social media:
    ● / resocoder
    ● / resocoder
    ● / resocoder

КОМЕНТАРІ • 47

  • @EduardoMendoza-gy3pg
    @EduardoMendoza-gy3pg 2 роки тому +1

    This information is worth millions, very clean and easy to undestand

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

    Thank you so much, Reso Coder. Your tutorials have significantly improved my understanding of testing and made learning new aspects of Flutter enjoyable.

  • @GabrielCosta-xr5vr
    @GabrielCosta-xr5vr 2 роки тому +17

    Great work! Just to note: Integration tests are almost a MUST nowadays, because doing it you can automatize the shaders compilations to avoid jank issues (specially in iOS). With integration tests you don't need to generate the shaders manually everytime you build a version of the app.

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

      Can you explain some more?

    • @GabrielCosta-xr5vr
      @GabrielCosta-xr5vr 2 роки тому +21

      @@wallywebber788 Sure.
      Nowadays flutter has a problem with rendering animations without jank in some cases. It's only in the first run of the app (in Android it's only in the first time that the users open your app, in iOS its more serious, if you close the app an open again, the jank will be there in the first run of the animation.)
      To mitigate that problem, the Flutter team gave us a way to pre-warm the animations, this is helping reducing the jank in the first run. To do that you need to open and navigate your app through the animations, basically using your app as the users would do. But you need to do everytime you will build your app or if you change something.
      As integration tests already navigate through the app, you can use them to cache the shaders for you automatically.
      You can check more in the flutter docs: docs.flutter.dev/perf/rendering/shader
      And this article shows how to use integration tests to mitigate the shader caching: alex-min.fr/improving-flutter-latency-through-sksl-automation/

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

      @@GabrielCosta-xr5vr thank you for detail explanation!

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

    wow, just finished part1, part two has been uploaded, thank you

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

    AWESOME and thanks for sharing so much knowledge!!

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

    I love you brother. Lots of love from Bangladesh. You are an angel for us whos are not have money for taking paid course. Please Please Please Please Please Please Please Please continue upload flutter videos.

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

    Wonderful tutorial. Thank you.💯

  • @lgf-sq9yf
    @lgf-sq9yf Рік тому

    awesome tutorial!!

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

    Reso coder prepare for real app development 🔥👍

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

    Awesome tutorial, this really helps me. Thanks man 💙

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

    Great work as always!

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

    Hi, I really appreciate your content that helps me learn from a professional. Can you upload more content of Flutter, I'm kinda addict to your content now.

  • @ליאורפולק-צ8ז
    @ליאורפולק-צ8ז 2 роки тому

    Excellent tutorial!

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

    Thank you so much ❤

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

    Thanks for sharing. Please do some more videos on testing.

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

    Hi, Could you please share about create preparation and end test such as junit @beforeeach @aftereace?

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

    Great tuto again thank you. I just don't get how you make integration test in real life only using mock. To me you would have, while developing your application, to implements your services with a Stub version (basically how you mocked your NewService the wrong way in the previous video), then run your application where it only uses Stubbed version of your services. I am not sure if I am clear

  • @jayasubin-codes6233
    @jayasubin-codes6233 2 роки тому

    Very informative; Thanks for making this tutorial

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

    Amazing! Thanks :)

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

    Good stuff!

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

    Yep, the tests are done! I feel I can ask for more salary 🤓.

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

    Thank you so much !!

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

    I respect your creativity. Everything is clear and understandable. I would really like a new playlist about blocks (ddd course)
    Please don't ignore your followers.

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

    Thank you!

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

    Hi, great content.
    I need to get the context before initializing Material App?
    How could I do this?

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

      you couldn't. material app is the first built widget, so you could assigning a navigate key to it and use it whenever you want.

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

    thank you for this testing!!, its could be more interesting if you try to do in a big app, thank you anyway!!!

  • @Enzo-hz7zo
    @Enzo-hz7zo 2 роки тому

    Thanks!

  • @Stefan-xm9qb
    @Stefan-xm9qb 11 місяців тому

    When I debug widget tests in vs code how can I see the widget in the browser/simulator? It would be helpful for debugging.

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

    Hey can you do a video on "integration testing" with flutter application for web application

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

    can you also create a tutorial about golden tests?

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

    Great work Always love your content

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

    Hello? I have a question "is it possible to incorporate test widget into integration test?" Thank you.

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

    Bro need new DDD course. please !!! Excitted to see with a API and local cache

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

    Is the flutter bootcamp worth it and still up to date? I'm a beginner in Flutter, but I have a few years of work experience as a software engineer and I'm interested in learning mobile app development.

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

    Why don't you talk about your bootcamp? is it up to date? or is it old videos?

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

    Integration_test dart package is discontinued. Is there any other way to run the integration test code

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

    Hi ResoCoder, I think you are a professional programmer. I am doubting why you are not using GetX State Management? Is there any defect with this package and using it? It is the most liked Flutter Package but not Flutter Favorite. I see many people spread hate on this package and de-promote using it. Can you reply with your honest opinion on this? I know many people gonna comment about the defects, but sorry... Any other's comment will not be considered to change my mind.

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

      GetX its really good, but it has one problem and is that you "forget" about the BuildContext, which is a core thing in Flutter. That's why its considered an "anti pattern" solution. I really like using it, but if you want to keep it clean, bloc is really good.

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

    First!

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

    I am on Android Studio and the integration_test is running on the command line instead of Emulator or other devices, how to fix this?
    #help

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

    My test throw:
    [core/no-app] No Firebase App '[DEFAULT]' has been created - call Firebase.initializeApp()
    ══╡ EXCEPTION CAUGHT BY FLUTTER TEST FRAMEWORK ╞════════════════════════════════════════════════════
    The following TestFailure was thrown running a test:

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

    Thanks!