blob: 64d83bf5c13bb20acf1eb8d2fe416db176d7fe31 [file] [log] [blame]
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:e2e/e2e.dart';
import 'package:e2e_example/main.dart';
// Tests the failure behavior of the E2EWidgetsFlutterBinding
//
// This test fails intentionally! It should be run using a test runner that
// expects failure.
void main() {
E2EWidgetsFlutterBinding.ensureInitialized();
testWidgets('success', (WidgetTester tester) async {
expect(1 + 1, 2); // This should pass
});
testWidgets('failure 1', (WidgetTester tester) async {
// Build our app and trigger a frame.
await tester.pumpWidget(MyApp());
// Verify that platform version is retrieved.
expect(
find.byWidgetPredicate(
(Widget widget) =>
widget is Text && widget.data.startsWith('This should fail'),
),
findsOneWidget,
);
});
testWidgets('failure 2', (WidgetTester tester) async {
expect(1 + 1, 3); // This should fail
});
}