mardi 27 août 2019

How to Test Cupertino Widgets on IOS App? I can't specify widget tests to run on IOS only

When @TestOn("ios") is specified at the head of the test file for IOS specific widgets, in this case, CupertinoApp, These tests never ran. When I remove TestOn("ios"), then TargetPlatform.android is true I can't specify to run tests on IOS only.

@TestOn("ios")
import 'package:flutter/cupertino.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:my_app/src/app.dart';

void main() {
  group('IOS only Test', () {
    testWidgets('Load IOS App', (WidgetTester tester) async {
    await tester.pumpWidget(App());
    expect(find.byType(CupertinoApp), findsOneWidget);
    });
  });
}

Aucun commentaire:

Enregistrer un commentaire