Integration Testing with Flutter
HTML-код
- Опубликовано: 27 ноя 2024
- 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/tad...
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...](join.robinhood...)
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)
RUclips 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
thats firrrrrrrrrrrrre! 🔥🔥🔥🔥
Thanks bro 💪
Highly appreciate your videos man!!
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!!
Glad I could help!
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.
Thats a really good point, i will do that now 😊
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.
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`.
Flutter Driver tests are being deprecated in favor of new Integration Tests
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.
How can you run the same test in the Firebase Test Lab?
Clean tutorial 👍👍👍
@TadasPetra can you help me with integration testing with datepicker?
there is no key in datepicker? how can driver select date from picker?
That's perfect thank man
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
Where are you running the command?
@@tadaspetra thanks, I resolved this by deleting pub cache. actually, my pub cache was corrupted.
Intergation testing makes me wet af!! You go girl, keep it up
Can you create a video to show the same approach but using json maps as mocks?
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.
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 😅
@@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?
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 😊
@@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.
Thomas Mabika haha you got me there!
Could this be enough to just use this method instead of widget and unit testing?
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.
@@tadaspetra really cool, thanks!
Check the testing pyramid. You should have more unit test, moderate integration test and less widget test.
how to test login feature that requires microsoft authentication
do you know how to show keyboard?
Am got an error saying
Error: Not found: 'dart.ui'
Anyone have any idea how to resolve it?
Were you able to resolve this?
How can I create test reports for integration testing
I’m not too sure to be honest
@@tadaspetra ok pls post if u could find a solution thanks
@arjun you can use flutter junit pluginto create reports