ITNEXT

ITNEXT is a platform for IT developers & software engineers to share knowledge, connect, collaborate, learn and experience next-gen technologies.

Follow publication

Test Secrets, Test Suites

Fred Grott
ITNEXT
Published in
4 min readApr 28, 2021

--

If you do a quick search in google or even in the flutterdev forum on Reddit you will come away empty-handed. Test suite writing is only a secret due to it being obscure in that it's deep in the Flutter SDK, itself. Do not wait until your job interview to find out about it.

Background

We write test suites to ensure that the behavior of a UI component is consistent with our vision of how we want the design of the app to appear and behave. But, if the way it is constructed is not in human native languages; then it takes more cognitive power to understand what the test passing or failure means to the ones writing the individual tests that add to a specific test suite.

It’s a problem as usually as when dev teams of one person once again look at code it’s a month later, and they have forgotten that code sequence or in the case of an expanding team, it’s usually a different team member writing individual unit tests to expand the test suites.

My, thanks goes to the Flutter App Development team at eBay for digging through the flutter SDK and how the Flutter team tests the Flutter SDK for coming up with ways to extend that to make it easier to write a Flutter test suite.

eBay’s Give When Then and Page Object Plugins

The flutter plugins we will use from eBay are the give_when_then and page_object plugins. You install them by:

dev_dependencies:  given_when_then: ^0.2.0  page_object: ^0.2.0

As always, I’m curating my code and design stuff for my first flutter dev book at:

https://github.com/fredgrott/flutter_rose_glasses

And, this particular example repo is the fproject_layout repo:

https://github.com/fredgrott/fproject_layout

I will show you one example of the use of the give_when_then plugin, namely the test for the app_bar:

--

--

Published in ITNEXT

ITNEXT is a platform for IT developers & software engineers to share knowledge, connect, collaborate, learn and experience next-gen technologies.

No responses yet

Write a response