Integration Testing with Flutter

แชร์
ฝัง
  • เผยแพร่เมื่อ 17 ก.ย. 2020
  • Integration Testing with Flutter
    The last type of testing Flutter has to offer is Integration Testing. So the 3 types are:
    Unit Testing - tests units of logic - • Unit Testing with Mock...
    Widget Testing - tests the UI of widgets - • Widget Testing with Fl...
    Integration Testing - tests the UX of the app flow
    If you do thorough testing for each of these 3 you can be pretty confident about your Flutter app, and should be able to release will a lot less worries!
    Link to the Code: github.com/tadaspetra/todoapp
    Connect With Me
    ✦ My Website: [tadaspetra.com/](tadaspetra.com/#/)
    ✦ Live Coding: [ / tadaspetra ]( / tadaspetra )
    ✦ Twitter: [ / tadaspetra ]( / tadaspetra )
    ✦ Chat on Discord: [ / discord ]( / discord )
    ✦ Instagram: [ / tadaspetra ]( / tadaspetra )
    I also do lots of Investing
    ✦ FREE stock: [join.robinhood.com/tadasp2](join.robinhood.com/tadasp2)
    My Top 5 Books:
    ✦ Brave New World - Aldous Huxley: [amzn.to/2JyaK96](amzn.to/2JyaK96)
    ✦ 1984 - George Orwell: [amzn.to/3lmLzUk](amzn.to/3lmLzUk)
    ✦ The Millionaire Fastlane - MJ Demarco: [amzn.to/2ViGthn](amzn.to/2ViGthn)
    ✦ The 4-Hour Workweek - Timothy Ferriss: [amzn.to/3mnypYD](amzn.to/3mnypYD)
    ✦ Homo Deus - Yuval Noah Harari: [amzn.to/2VlFRYe](amzn.to/2VlFRYe)
    TH-cam Gear
    ✦ MacBook Pro 16 inch: [amzn.to/3qe4MeF](amzn.to/3qe4MeF)
    ✦ MX Master 3 Mouse: [amzn.to/2VlkZQS](amzn.to/2VlkZQS)
    ✦ Canon Rebel SL3: [amzn.to/2ViIfPv](amzn.to/2ViIfPv)
    ✦ Hiearcool USB Hub: [amzn.to/3llsIsP](amzn.to/3llsIsP)
    ✦ iPad Pro 12.9 (3rd Generation): [amzn.to/36kaVy0](amzn.to/36kaVy0)
    ✦ Apple Pencil (2nd Generation): [amzn.to/2JoHy4y](amzn.to/2JoHy4y)
    ✦ Yeti Microphone: [amzn.to/37oRNOq](amzn.to/37oRNOq)
    ✦ Rode Boom Arm: [amzn.to/3lnEKCb](amzn.to/3lnEKCb)
    ✦ Blue Radius II Shock Mount: [amzn.to/2JoIfea](amzn.to/2JoIfea)
    ✦ Blue RPop Filter: [amzn.to/39rQSiZ](amzn.to/39rQSiZ)
    ✦ Sony WH1000XM3: [amzn.to/3moWgHh](amzn.to/3moWgHh)
    Thank you for watching!
    #integrationtesting #flutter #fluttertesting

ความคิดเห็น • 38

  • @husseinal-shammari5618
    @husseinal-shammari5618 ปีที่แล้ว

    Highly appreciate your videos man!!

  • @hermankravchenko6470
    @hermankravchenko6470 3 ปีที่แล้ว +1

    Thank you for your video. It was very helpful and gives me more confidence to do testing in Flutter. Even if you told me the same info from flutter dev documentation. It makes more sense now!!

    • @tadaspetra
      @tadaspetra  3 ปีที่แล้ว

      Glad I could help!

  • @FlutterMapp
    @FlutterMapp 2 ปีที่แล้ว +1

    thats firrrrrrrrrrrrre! 🔥🔥🔥🔥

  • @prshendra
    @prshendra 3 ปีที่แล้ว

    Clean tutorial 👍👍👍

  • @alirezarajaei1980
    @alirezarajaei1980 3 ปีที่แล้ว

    That's perfect thank man

  • @g4mrplays
    @g4mrplays 3 ปีที่แล้ว +1

    Oo, missed opportunity to link to your other testing videos in the description + video annotation. I know we can just search, but that was the first thing I looked for when you mentioned it at the beginning of the video.

    • @tadaspetra
      @tadaspetra  3 ปีที่แล้ว +1

      Thats a really good point, i will do that now 😊

  • @RickGladwin
    @RickGladwin 2 ปีที่แล้ว

    Is there a best practice in Flutter for using a test database for integration testing? This is a nice introduction to integration testing, but I'd never want to use the primary production database for testing.

  • @alinasmirnova6621
    @alinasmirnova6621 3 ปีที่แล้ว

    Can you create a video to show the same approach but using json maps as mocks?

  • @SpookyHector
    @SpookyHector 3 ปีที่แล้ว

    @TadasPetra can you help me with integration testing with datepicker?
    there is no key in datepicker? how can driver select date from picker?

  • @JeanPierreSchnyder
    @JeanPierreSchnyder ปีที่แล้ว

    Info given by ChatGPT4:
    As of my knowledge cutoff in September 2021, `flutter_driver` has been the traditional way of writing integration tests for Flutter apps. However, Flutter announced the `integration_test` package as the new way of testing, which is easier and more consistent with widget tests.
    Here are some differences and advantages between the two:
    1. **Driver vs In-Process:** `flutter_driver` runs tests in a separate process, and communicates with the app-under-test over a JSON wire protocol. This can sometimes introduce complications with setup, latency, or issues with flakiness. On the other hand, `integration_test` runs the tests in the same process as the app, resulting in faster execution and simpler setup.
    2. **Test Writing:** `flutter_driver` requires a more complex setup where you often end up with two separate files: one for the test app and another for the test scripts. With `integration_test`, the setup is simpler and the test code is more similar to unit and widget tests.
    3. **Host Platform Support:** `integration_test` has broader support for running tests directly on different host platforms, including macOS, Windows, Linux, Web, Chrome, etc., as it doesn't require Flutter's test host tooling (like the `flutter drive` command).
    4. **Tooling and Libraries:** `integration_test` can work with existing test libraries and tooling, and supports features like setup and teardown methods, the `testWidgets` function, and Flutter's widget testing environment in general.
    5. **Migration and Compatibility:** As of my last update, `integration_test` is being favored over `flutter_driver` by the Flutter team, and it's likely that the latter will eventually be deprecated. The team has also provided a migration guide for moving `flutter_driver` tests to `integration_test`.
    6. **Performance Profiling:** `flutter_driver` supports performance profiling of the app while running tests. As of my knowledge cutoff in September 2021, `integration_test` does not support this, although this may change in the future.
    Overall, it's recommended to use `integration_test` for new projects, and consider migrating existing `flutter_driver` tests to `integration_test` if feasible. This is because `integration_test` simplifies the process of writing integration tests, and aligns more closely with other types of Flutter testing. However, if your project relies heavily on performance profiling during test runs, you may want to stick with `flutter_driver` until such functionality is available in `integration_test`.

    • @samrashafique6155
      @samrashafique6155 10 หลายเดือนก่อน

      Flutter Driver tests are being deprecated in favor of new Integration Tests

  • @ZohaibKhan-io3jz
    @ZohaibKhan-io3jz ปีที่แล้ว

    How to click on the checkbox showing over there? Please help me as I need to click on favorite button showing in grid view and I am unable to access it. Looking forward to your response.

  • @laugedyret
    @laugedyret 2 หลายเดือนก่อน

    How can you run the same test in the Firebase Test Lab?

  • @howtosavealife3959
    @howtosavealife3959 3 ปีที่แล้ว

    do you know how to show keyboard?

  • @thomasmabika7291
    @thomasmabika7291 3 ปีที่แล้ว +1

    so states_rebuilder added global functional injection, navigation support, dialog and snackbar features, how about a video series like the one you did with GetX? Seeing that the two are kinda of aiming for the same thing, I wonder which is better.

    • @tadaspetra
      @tadaspetra  3 ปีที่แล้ว

      Thomas Mabika I've been planning on taking a look at that. But also I want to check out the get_cli and get_server and then Riverpod too. There's so much 😅

    • @thomasmabika7291
      @thomasmabika7291 3 ปีที่แล้ว +1

      @@tadaspetra I say we start with states_rebuilder first, do 5 or so videos, then get_cli and server.... then if you really must, maybe Riverpod. What do ya think?

    • @tadaspetra
      @tadaspetra  3 ปีที่แล้ว

      Thomas Mabika I appreciate that advise but I already got the other ones mostly planned out. And I still have a lot to learn and remember about states_rebuilder so that one will have to wait a bit. But I appreciate it 😊

    • @thomasmabika7291
      @thomasmabika7291 3 ปีที่แล้ว +1

      @@tadaspetra in that case, I guess I'll just have to unsubscribe from the channel. Good luck.
      lol, just kidding, whatever decision you make mate, I'm just here for the content.

    • @tadaspetra
      @tadaspetra  3 ปีที่แล้ว

      Thomas Mabika haha you got me there!

  • @alejosandu
    @alejosandu 3 ปีที่แล้ว +1

    Could this be enough to just use this method instead of widget and unit testing?

    • @tadaspetra
      @tadaspetra  3 ปีที่แล้ว +5

      Alejandro Sánchez Durán not really. Reach of them have their own purpose. For unit testing you can check all the error cases for each specific function, and same thing for widget tests. There are also a lot deeper you can go into the different types of testing and they each serve their own purpose. BUT I think if you were to only do one type of testing, I think integration testing covers the most parts with fewer lines of test code.

    • @alejosandu
      @alejosandu 3 ปีที่แล้ว +1

      @@tadaspetra really cool, thanks!

    • @vincentmontano4518
      @vincentmontano4518 3 ปีที่แล้ว +1

      Check the testing pyramid. You should have more unit test, moderate integration test and less widget test.

  • @parasarora4711
    @parasarora4711 3 ปีที่แล้ว +1

    hey, I am getting this error every time I run command for testing. { Could not find a file named "pubspec.yaml" in "/home/paras/.pub-cache/hosted/pub.dartlang.org/_fe_analyzer_shared-12.0.0".} Pls help me out. the path is correct that's confirmed, getting the same error on all integration test repo

    • @tadaspetra
      @tadaspetra  3 ปีที่แล้ว

      Where are you running the command?

    • @parasarora4711
      @parasarora4711 3 ปีที่แล้ว

      @@tadaspetra thanks, I resolved this by deleting pub cache. actually, my pub cache was corrupted.

  • @user-ln6ng8we9s
    @user-ln6ng8we9s ปีที่แล้ว

    how to test login feature that requires microsoft authentication

  • @mohammedashique8923
    @mohammedashique8923 3 ปีที่แล้ว

    Am got an error saying
    Error: Not found: 'dart.ui'
    Anyone have any idea how to resolve it?

    • @jdon144
      @jdon144 2 ปีที่แล้ว

      Were you able to resolve this?

  • @arjunp9334
    @arjunp9334 3 ปีที่แล้ว

    How can I create test reports for integration testing

    • @tadaspetra
      @tadaspetra  3 ปีที่แล้ว

      I’m not too sure to be honest

    • @arjunp9334
      @arjunp9334 3 ปีที่แล้ว

      @@tadaspetra ok pls post if u could find a solution thanks

    • @jags1230
      @jags1230 3 ปีที่แล้ว +1

      @arjun you can use flutter junit pluginto create reports

  • @karolisabrutis6501
    @karolisabrutis6501 3 ปีที่แล้ว +1

    Intergation testing makes me wet af!! You go girl, keep it up