Flutter Widget Testing - Test Scrollable Widgets - Test AssertionError in Widget
ฝัง
- เผยแพร่เมื่อ 13 ก.ค. 2024
- * New Mentorship Program to boost your Flutter development*
gumroad.com/products/ydgtfV
In this video, I give you an introduction to Flutter Widget Testing. First, we will talk about the basic concept and I will explain you in the code how Flutter Widget Tests are done. For this purpose, I will introduce you to the Flutter Example Widget test and after that, we will create our own widget tests in three different Test Scenarios.
#Flutter #FlutterWidgetTesting #Testing
TimeTable:
00:00 Intro
01:03 - Introduction to Widget / Component Testing
04:45 - Starting with Programming
05:30 - Discover the default Counter App Test
10:40 - Test scroll Behavior
16:00 - Test Screen Sizes
17:19 - Test AssertionError
**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
Say hi to Mahtab
Twitter Mahtab: / mahtab_dev
GitHub Mahtab: github.com/mt-tadayon
Great video for starters on flutter widget test.
For someone who has just started doing TDD, this was really helpful. I noticed you did a live stream with Flutter 1.22 live learning. Could I request a video idea? Maybe a video on the new Navigator 2.,0 API since I am having a hard time understanding it. Another great video would be a rundown of all you learnt in and since that live stream. I hope to see more videos and thank you for making the awesome content.
Hi Parkar, that is a fantastic idea and I work already on a Navigator 2.0 video. I hope I can release it soon!
Arrange Act Assert - AAA
Arrange
Act
Assert
fucking chad, thanks for this series
You are welcome :)
thank you for the video. I came here to find how to test if my scrollbar appear or is hidden because I extend the time it is shown and want to keep this behavior. Is it possible to find the scrollbar? I tried to find the ScrollbarPainter widget but doesnt work.
Hi there, there are multiple ways I guess, one would be to add an key to the widget and look that one up. In general I would recommend you take a look into the Flutter Project.
github.com/flutter/flutter/blob/master/packages/flutter/test/widgets/scrollbar_test.dart
Plz flutter app advaned testing tuotorials for develoer
What if there are two icon buttons? How to differentiate between them?
You can set for one of the buttons a id and find it by id, another solution is to find unique attributes of the button like parents etc. the find method is very versatile and should be able to help you in any case. I would recommend you to check the Flutter Project for amazing test examples. github.com/flutter/flutter/tree/master/packages/flutter/test
I couldn't access the codes of Scrolling Widget which mentioned in the video. Could you share?
Thank you for letting me know, I had some troubles with the repository and cannot find it either, I will recreate the repository and send you the link asap :)
@@FlutterExplained Thank you ver much 🤗
@@FlutterExplained can you send me the link to? I can't find it. thanks
act arange assert
make a live session about testing
Sure sounds like a good plan :)
@@FlutterExplained Hey, could you please make a video on my plugin? It's a basic plugin that makes writing dynamic UI easy in Flutter.
widget testing is in black hole inside flutter universe...Of all example flutter projects in github and youtube video tuts I only see 0.01% content for widget test topic don't know why...
Yeah but the problem is that there are billions of possibilities. But if you want to learn more about different widget tests I highly recommend you take a look into the Flutter Repository. They write tons of them and many of them are just amazing.
@@FlutterExplained r they inside flutter samples or actual repo??
@@pradeep422 In the main repository:
github.com/flutter/flutter/tree/master/packages/flutter/test
@@FlutterExplained oh god ty...
@@pradeep422 You are most welcome :)
Arrange Act Assert