flutter_modern_test
: Modern, elegant and productive test framework for Flutter, inspired by Cypress
GitHub: https://github.com/fzyzcjy/flutter_modern_test
Writing tests should be as easy as speaking to a human being about what is expected to happen. No extra care and code should be made for anything else.
Before I record video of flutter_modern_test
(since I am not sure whether people are interested in this lib, I do not spend much time on writing readme), please watch this Cypress video and imagine the counterpart...
I have long been wishing that Flutter could have a testing framework as productive as Cypress in JavaScript; but with a long wait there is still none yet. So I write one (many thanks for Cypress's inspiration!).
Obviously, the rich features of Cypress itself are not made by one programmer. Even if I have made the core functionality for this library, there are still many features to add. If you are interested, please contact me (maybe via GitHub issues)!
Code looks like:
tTestWidgets('test one', (t) async {
// tap, drag, ... anything you like
await t.get('load_data_button').tap();
// With retry-ability, no need to wait for data to be loaded or retry.
await t.get('My Title').should(findsOneWidget);
// some other examples
await t.logout();
await t.routeName().shouldEquals('/create_chat');
});
UI looks like: (See that video above)
I have used it internally for my app (in production) and it worked well. But to make it a great open-source project, work is still needed.
The current code repository lacks some trivial internal library dependencies, but of course I will port them here soon.