Automate your Testing on Devices with Flutter Integration Testing

แชร์
ฝัง
  • เผยแพร่เมื่อ 6 ก.ค. 2024
  • I am also live streaming over on Kick, it would be great to see you there from time to time: kick.com/devcafe
    If you like our work and want to support us, feel free to join us on Patreon.
    / flutterexp
    The tip of the testing pyramid and the highest level of automation is included inside the Flutter Integration Testing. The integration Tests allow us to mimic user behaviour and use of a real physical device to execute the tests. Thanks to the execution of a real device, you get the highest certainty that your application works correctly.
    #Flutter #IntegrationTest #TestAutomation
    Interesting Links:
    github.com/md-weber/flutter_t...
    martinfowler.com/bliki/Integr...
    / updates-on-flutter-tes...
    gist.github.com/md-weber/6b33...
    Timetable:
    00:00 Introduction
    00:39 What is Integration Testing
    02:20 Benefits
    02:45 Downsides
    05:05 Setup Integration Tests in a project
    07:55 Write an Integration Test
    16:12 Except with Schematics
    19:00 Test multiple Files
    ** New Mentorship Program to boost your Flutter career **
    gumroad.com/l/ydgtfV
    **BOOKS I RECOMMEND**
    geni.us/flutterbook
    geni.us/clean-code
    ** TH-cam OPTIMIZATION PLUG-INS I USE **
    TUBEBUDDY: www.tubebuddy.com/flutterexpl...
    VIDIQ: vidiq.com?afmc=7jl
    **ALL THE TH-cam EQUIPMENT I USE**:
    Our current TH-cam gear
    💻 MacBook Pro: geni.us/mac-book
    📹 Lumix FZ1000: geni.us/fz-1000
    🎙 Samson Mic: geni.us/samson-mic
    🎉 ACCESSORIES:
    Satechi USB-C Adapter: geni.us/P9R0
    SD Card for 4k Videos: geni.us/PTAc
    Disclaimer Flutter Explained (Max & Mahtab) are a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to www.amazon.com.
    ** Social Medias **
    Website: flutter-explained.dev
    Say hi to Max
    Twitter: / flutter_exp
    GitHub Max: github.com/md-weber
    LinkedIn: / max-weber-9889a3ba
    Twitch: / maxflutter
    Say hi to Mahtab
    Twitter Mahtab: / mahtab_dev
    GitHub Mahtab: github.com/mt-tadayon

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

  • @nils.reichardt
    @nils.reichardt 3 ปีที่แล้ว +56

    Update: The integration_test package moved into the Flutter SDK (with Flutter 2.0). You should not use "integration_test: ^1.0.2+3" anymore. Use instead:
    dev_dependencies:
    integration_test:
    sdk: flutter

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

      should have noticed your comment earlier, it would save me around hour

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

      On VSCode i use pubspec assist extension that adds the most recent dependency version and runs flutter pub get also, check it out

  • @FlutterExplained
    @FlutterExplained  3 ปีที่แล้ว +6

    If you are interested in more testin videos, checkout the Testing Series Playlist: th-cam.com/play/PLq83k-ITj6lSISMo6JOGkcOBcio_zEeAB.html

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

      The playlist not exists!!

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

      @@mdshihabuddin129 Thank you for letting me know, I renamed it and probably it lost track, I will update the link right away.

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

    Awesome tutorial, thanks for sharing and hope to see more on integration videos.

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

    You produce excellent content Max. Thank you so much.

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

    Great great great tutorial. Very clear and comprehensive explanation, thank you!

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

    thanks for the video, it was very helpful

  • @BrunoCodeman
    @BrunoCodeman 2 ปีที่แล้ว +3

    I could expect learning sociology from Max Weber, but I never thought I would learn flutter from Max Weber.

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

      Yeah the world is a small place and my namesake is everywhere :D

  • @KraasRas
    @KraasRas 2 ปีที่แล้ว +6

    Thank you for this good tutorial. I have two questions: 1. I want to take a screenshot of the current frame, if a test fails. How could I do that? 2. What is the difference, doing integration tests with the 'package:integration_test/integration_test.dart' + 'package:flutter_test/flutter_test.dart'; vs. 'package:flutter_driver/flutter_driver.dart'; + 'package:test/test.dart';?

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

    Great tutorial! Thanks a lot!

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

    Thank you so much for this tutorial, it was very helpful.

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

      You are most welcome, I am glad that you could use it!

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

    Great video and great explanation, thx!
    The app I'm working on has to react on getting disconnected from power.
    I found out that you can use 'adb shell dumpsys battery set ac 0' to simulate it from command line, but I need to be able to do this during the test.
    Any idea on how to achieve that? Kind regards.

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

    I am loving your videos ❤

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

      Great that you like them, if I can do something that you like them even more, I am all ears :)

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

    fucking awesome, thank you so much for this flutter testing tutorial series

  • @ronny-if7ms
    @ronny-if7ms 3 ปีที่แล้ว +7

    Great video!
    Please make a complete series on integration testing of flutter apps there are lot of QA folks struggling with this and there is nothing on this topic 🙏🙏

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

      Hi Ronny, sounds like a fantastic idea. What would you like to see covered in such an Integration Test Series?

    • @ronny-if7ms
      @ronny-if7ms 3 ปีที่แล้ว

      @Flutter Explained complete E2E integration test suit
      1. OTP sign up
      2. Smoke test
      3. Test cases for switching between web browser and App
      4. CI/CD
      5. Report
      6. Parallel execution using firebase test lab or AWS device farm
      7. UI data validation with Api response
      Appium for flutter apps(I guess appium dosent support flutters but if u can cover this topic)
      A course specially for QA folks will be great and there is no content on these topics

    • @ronny-if7ms
      @ronny-if7ms 3 ปีที่แล้ว

      Thanks a lot for replying!

    • @ronny-if7ms
      @ronny-if7ms 3 ปีที่แล้ว

      And if possible please cover flutter gherkin aswell.

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

    Thanks for the video! How i can divide my tests without repeating previous steps? For example, I should always created an account in my app's first step. I wrote tests for this logic, but I want to keep tests for another logic in other files. And I should repeat the creation account in all test files. Is there a solution for this?

  • @sarharmiha3184
    @sarharmiha3184 21 วันที่ผ่านมา

    thank you

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

    Can you please share an example how to select radio button in integration test.

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

    Thank you for the nice explanation on flutter integration testing. Could you please make video on how to inject a mock client in integration testing. In the example you have shown, we know the flow but in some apps it all depends on the response of the app. Please make a video on injecting Client and testing with that.

  • @frx-michael-widjaja
    @frx-michael-widjaja 2 ปีที่แล้ว +1

    Thanks for the video. Btw do you have any suggestion for testing tool which support flutter for black box testing?

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

    can u explain how to test out a drop down menu widget used in a form

  • @iansmith3301
    @iansmith3301 3 ปีที่แล้ว +2

    Any tips or ideas on how to do unit testing / integration tests for parts of your app that use voice recognition? :) I've thought about using pre-recorded audio files but I'd need some type of set up that would stream audio through a virtual input. Maybe there's some integration software that has already done this? Bespoken might be an option but it looks pricey.

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

      Hi Ian, that is a great question, to be honest this is the first time I have to think about something like that. If you find something in that direction I would be super interested.

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

      Did you come up with any solution to this?

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

    How can we change location (latitude , longitude) with this intehration test? And is it possible to test terminated mod background test?

  • @iDujii
    @iDujii 3 ปีที่แล้ว +2

    So I've been trying to read about UI and Integration testing (specifically for iOS development). I always though these tests were different, but a lot of the integration tests example I see, appear to be what I would call UI testing.
    So now I'm curious, what is the difference between UI and integration testing?

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

      At the moment in Flutter there is basically no real difference.

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

    it was an awesome tutorial

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

      Thank you for your feedback, I am happy that you liked it!

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

    is there a way, that we can reuse the flutter mobile scripts for flutter web app? or do we have alternate way to automate the flutter web application?

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

    Hi nice video, thanks :). But, at the end, you mentioned that one thing learned is how to run multiple integration test and it didn't show in the video... could you please give more details about how to do it?
    thanks

    • @FlutterExplained
      @FlutterExplained  3 ปีที่แล้ว +2

      Hi you are most welcome, I am glad you like it :). At the last part of the video I explain that. It is not possible to run multiple at once but you can prepare a script that let you run one by one.
      th-cam.com/video/WPEsnJgW99M/w-d-xo.html

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

    Good job, sir :D

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

    do you integrate test authorization/sign in?

  • @Robin.Backer
    @Robin.Backer 8 หลายเดือนก่อน

    How would you work with semantics because sometimes really long name content must be entirely described to avoid duplicated. Especially if this text is a variable

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

    Hi, I am trying to test a flutter project, but this project is just web, and when I run the integration testing doesn't works, do you have some recommedation or idea? I really will appreciate it.

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

    Thank you for this explaination! One question: How we can check all checkboxes instead of only the first one?

    • @Nithin.Raaj.J
      @Nithin.Raaj.J ปีที่แล้ว

      find.byType(Checkbox).at(_index); use this to check the specific checkbox

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

    Can you have multiple testWidgets under same group?

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

    please provide the full execution code for the ps1 extention

  • @ivanivanov-lu5wm
    @ivanivanov-lu5wm 3 ปีที่แล้ว +1

    Thanks for video. Could tell how to get green play icon in .sh file, is it special extension for that? PS I don't have it

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

      Yep if you work with mac and shell scripts .sh I have the following plugin installed:
      plugins.jetbrains.com/plugin/13122-shell-script

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

    Hi brother,
    Flutter widget test does not trigger DropdownButton.onChanged when selecting another item

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

    how do i pick image while integeration testing

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

    gutes Video!
    hab mich schon gefragt, ob du deutsch bist, bei 5:20 war es mir klar :D
    hast du dich schon mit dem Thema Test-Lab Robo-Test beschäftigt? Finde das Konzept hinter den Monkey Tests richtig geil, sind ja quasi schnelle Integrationstests, um einfach mal bei z.B. größeren oder kleinere strukturellen oder architektonischen Änderungen am Code zu überprüfen, ob alles noch so klappt
    Tests sind halt teuer und zeitaufwendig... da konnte ich mich mit Unit- und Widget Tests noch nicht so anfreunden. Da haben für den Anfang Integrationstests und evtl. auch Monkey Tests(zukünftig) schon einen besseren Kosten/Nutzen Faktor, oder was denkst du?
    VG aus Sachsen, Robin

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

      Danke dir für dein Feedback! Immerhin konnte ich es für 5 minuten verheimlichen :)

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

    @FlutterExplained Very nicely explained except the thing which I was looking for. At the timestamp 11:59 you mentioned that we can put Key but how to find the exact widget to put key in a fully developed app and we have no idea about it. How to search and reach out to that exact widget to put key..? if you can help me in this.

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

      Sure to set a key for a specfic widget you can give the widget the "key" property with a unique key. This tutorial has a minimal setup for this: docs.flutter.dev/cookbook/testing/widget/finders#2-find-a-widget-with-a-specific-key

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

    Thanks

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

    I have a test build APK file. How do I import it to project to start testing by writing tests?

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

    How can I select one email in selector natvie google account?

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

    Great introduction. Question, can the test code and the app being tested live in two separate codebase? Thanks

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

      Mhhh good question, never tried that.

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

      yeah, I'm new to flutter testing and haven't explored it either. Since QAs are responsible for the integration test, it's a little risky if they will be working on the same codebase with the devs. Just wondering.

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

      @@rommelmalqued4580 hi i am also new to flutter testing you can help me and clear the doubt

  • @Ajaysharma-ri9xi
    @Ajaysharma-ri9xi ปีที่แล้ว +1

    Thanks a lot for your tutorial, its an awesome tutorial, I have also started with flutter test automation i am struggling to automate the file or image uploading from device automation part do you have any suggestion or help for me ,Thanks in advance!!

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

      Hi there, I am glad my video helped you. That is quite a specific use case. Let me see if I can have a look and would directly produce a video for that. It could be that it is to late to answer your question.
      In general you want probably using a Flutter Integration Testing helper like Patrol in this case because you want to access native elements (the gallery). This video gives a short intro: th-cam.com/video/2nE7qSWYyf4/w-d-xo.html
      patrol.leancode.co/native/overview
      I hope that helps :)

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

    can we test flutter with selenium ?

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

    Thanks for the video. One question. How can we handle the modals that require permissions to use geolocation, camera or any other service of the phone?

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

      Hi Sandor, thanks for your comment. Honestly I am not sure, sounds like a great topic for a future video. I will look around if I find something I will let you know.

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

      @@FlutterExplained thanks I will be waiting

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

      This is an open issue for the flutter sdk. There are multiple workarounds described in the issue. The one that works for me is this: github.com/flutter/flutter/issues/12561#issuecomment-782150327

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

    Anybody know how to choose value from dropdown

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

    when i move to next page the testing stop why and not complete the rest of code

  • @mahmoudadel1542
    @mahmoudadel1542 3 ปีที่แล้ว +2

    Hello,
    I got this error Target file "\" not found when running
    flutter drive \
    --driver=test_driver/integration_test.dart \
    --target=integration_test/app_test.dart \
    on the terminal, how can I solve it?
    I googled it but I couldn't solve it

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

      It looks like your line breaks are not able to execute \ is only working on mac or windows (not sure which system anymore) therefore it tries to exectue \ which is not a correct target file.

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

    Running the flutter integration test i just see "test starting" on my mobile device. Is there any reason this happens. would you know of any solution? Great video

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

      I will take tomorrow some time to investigate. Thanks for letting me know and I will give you a heads up if I find something odd.

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

    Hey i encounter one issue. When i have 3 tests and the first one fails, then it stops the execution of the next tests. It should print error to the console and try to do other tests. Do you encounter this issue and can help me somehow?

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

      Hi Hubert, I guess this is wished bahaviour, I will check if there is a solution so that tests will run further even on an error.

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

      Hey Hubert. If you run 3 tests, The app would be installed 3 times, right?

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

    Please, one question. Should I have the 'Android Emulator' opened? Or The script will OPEN the Android Emulator, instead.? Thanks

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

      The script should start the emulator actually.

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

      @@FlutterExplained thx for the answer. But how? I couldn't do that in IntelliJIdea. Could you please give some tip?

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

    what's the use again with integration_test_driver? Can't we run integration_test without it?

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

      The video is quite outdated and needs a new version. In former times with Flutter 2 I believe you would need it and nowadays you still need it but it is created differently. Checkout the following page to get all the info you need.
      docs.flutter.dev/cookbook/testing/integration/introduction
      If you have more questions please let me know :)

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

    Is there a way, I can down load the source bundle of the demo project ?

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

      Yes the code should be available in GitHub

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

    Hi teacher, is it possible to put 2 "testWidgets" within a group?

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

      I guess you mean in a Integration Test? No unfortunately not you will always run the whole suite

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

      @@FlutterExplained That means we cannot 2 widget tests within a group. That's not handy.
      Thank you for your explanation!

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

    Thanks a lot for this video. Can you upload Advanced flutter automation series?

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

    Quick question: will testing solve the extremely relevant animations jank on iOS? I’m desperate 😞

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

      Hi Dave, no, unfortunately not. According to most GitHub Issues that I saw around that topic, we will have to wait for a solution. But feel free to check out this tweet where I discussed the topic already with the Flutter Community.
      twitter.com/flutter_exp/status/1362315607673352193

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

      @@FlutterExplained Thank you so much for the answer, I’ll check out the post for sure 😊 I’ve been working and exploring various solutions for this problem and I found some interesting and possibile solutions short term at least. I’ll share everything with the community once I’m sure they work!
      Do you find this being problematic for you or you mainly develop for Android?
      Thanks again, have a nice day 😊

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

      @@deiv319x @Dave RiseUp I saw the problem and I had to explain it also to one of my customers, but he is not really concerned about it and me neither. The small lags are not business crucial at the moment and he decided to wait until the Flutter team found a solution to the problem.

  • @TankunPrukesapitak
    @TankunPrukesapitak 9 หลายเดือนก่อน

    I run test but App immediately shuts down when running. what happened?

    • @FlutterExplained
      @FlutterExplained  9 หลายเดือนก่อน

      That could have many reasons.
      1. The tests where successful and just run very fast.
      2. A bigger underlying issue, but without the stacktrace it will be hard to help you here.

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

    PumpAndSettle is not working with infinite animation. It would be really helpful if any alternate to do. Thanks

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

      Good point, you can also just use pump and add a duration for as long your particular animation needs to display the correct part of the screen.
      `pump(Duration(seconds: 1))`
      With that you avoid regressions too :)
      api.flutter.dev/flutter/flutter_test/WidgetTester/pump.html
      I hope that helps!

  • @shivz732
    @shivz732 3 ปีที่แล้ว +2

    This is all cool and stuff but when your app gets too complicated with lots of screens etc, I really can't see how this is better than manuelly testing (speed is the only thing I can think of).

    • @FlutterExplained
      @FlutterExplained  3 ปีที่แล้ว +2

      Excellent question, and actually, I am a bit sad that I could not bring that point over in my video. There are a couple of advantages, but the major once are:
      1. Money, Testing experts are usually pretty expensive.
      2. As you already mentioned, speed
      3. Consistency, manual testing tend to test different scenarios differently, good/bad
      4. Manual Testing is biased. People usually test positive and try to make the app work
      5. Overnight and Weekend Testing, you can let your tests run whenever you want.

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

    i think this video is little bit outdated

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

      Thanks for the feedback. Good point, I will take it into account and try to create a newer version soon.

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

      @@FlutterExplained perfect thanks :)

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

    Great explanation but disagree with this video editing style.
    Please stop switching into the full camera view. Had to pause like 100 times to keep up with what you type on the editor..
    It's really frustrating... 😩

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

      Hi thanks for your feedback, I will see if I can improve it in the future.