forked from firka/flutter
Add retry flag to flutter_test (#125851)
Closes https://github.com/flutter/flutter/issues/125920 I will add tests, polish code, etc, if this change looks generally OK!
This commit is contained in:
@@ -51,6 +51,24 @@ void main() {
|
||||
});
|
||||
});
|
||||
|
||||
group('group retry flag allows test to run multiple times', () {
|
||||
bool retried = false;
|
||||
group('the group with retry flag', () {
|
||||
testWidgets('the test inside it', (WidgetTester tester) async {
|
||||
addTearDown(() => retried = true);
|
||||
expect(retried, isTrue);
|
||||
});
|
||||
}, retry: 1);
|
||||
});
|
||||
|
||||
group('testWidget retry flag allows test to run multiple times', () {
|
||||
bool retried = false;
|
||||
testWidgets('the test with retry flag', (WidgetTester tester) async {
|
||||
addTearDown(() => retried = true);
|
||||
expect(retried, isTrue);
|
||||
}, retry: 1);
|
||||
});
|
||||
|
||||
group('respects the group skip flag', () {
|
||||
testWidgets('should be skipped', (WidgetTester tester) async {
|
||||
expect(false, true);
|
||||
|
||||
Reference in New Issue
Block a user