0

I'm using google flutter integration driver to automate the mobile flutter apps.

The way we do differentiate the test suites as sanity, regression by tagging annotations in espresso, testNG, etc.

Is there any way in flutter integration tests to segregate the test suites as regression, sanity, etc?

Here is an example of main_test.dart having 4 tests. Out of 4, is there a way to tag/annotate regression or sanity to each test case and trigger the execution for the same?

or is it the only way to achieve this by having separate regression_test.dart & sanity_test.dart files?

import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';
....
....
//other imports

void main() {
  IntegrationTestWidgetsFlutterBinding.ensureInitialized(); 

  group('end to end test', () {
    //runs before each test
    setUp(() async {
      app.main();
    });

    //runs after each test
    tearDown(() async {
      final getIt = GetIt.instance;
      await getIt.reset();
    });

    testWidgets('test 1', (tester) async {
      expect(2 + 2, equals(4));
    });
    
    testWidgets('test 2', (tester) async {
      expect(2 + 2, equals(4));
    });
    
    testWidgets('test 3', (tester) async {
      expect(2 + 2, equals(4));
    });
    
    testWidgets('test 4', (tester) async {
      expect(2 + 2, equals(4));
    });
    
   });
}
Jagadeesh
  • 358
  • 5
  • 17

0 Answers0