From 101316b76a98a08d28c2bc42c04bc039984d75e9 Mon Sep 17 00:00:00 2001 From: nturgut Date: Mon, 31 Aug 2020 20:30:27 -0700 Subject: [PATCH] [web] migrate from e2e to integration_test (#20914) * migrate from e2e to integration_test * address reviewer comments --- e2etests/web/regular_integration_tests/pubspec.yaml | 2 +- .../test_driver/image_loading_e2e.dart | 4 ++-- .../test_driver/image_loading_e2e_test.dart | 4 ++-- .../test_driver/platform_messages_e2e.dart | 4 ++-- .../test_driver/platform_messages_e2e_test.dart | 4 ++-- .../test_driver/profile_diagnostics_e2e.dart | 6 ++---- .../test_driver/profile_diagnostics_e2e_test.dart | 4 ++-- .../test_driver/target_platform_android_e2e.dart | 4 ++-- .../test_driver/target_platform_android_e2e_test.dart | 4 ++-- .../test_driver/target_platform_ios_e2e.dart | 4 ++-- .../test_driver/target_platform_ios_e2e_test.dart | 4 ++-- .../test_driver/target_platform_macos_e2e.dart | 4 ++-- .../test_driver/target_platform_macos_e2e_test.dart | 4 ++-- .../test_driver/text_editing_e2e.dart | 4 ++-- .../test_driver/text_editing_e2e_test.dart | 4 ++-- .../test_driver/treeshaking_e2e.dart | 4 ++-- .../test_driver/treeshaking_e2e_test.dart | 4 ++-- 17 files changed, 33 insertions(+), 35 deletions(-) diff --git a/e2etests/web/regular_integration_tests/pubspec.yaml b/e2etests/web/regular_integration_tests/pubspec.yaml index 3f0c3280b511b..26ee22f810be2 100644 --- a/e2etests/web/regular_integration_tests/pubspec.yaml +++ b/e2etests/web/regular_integration_tests/pubspec.yaml @@ -13,7 +13,7 @@ dev_dependencies: sdk: flutter flutter_test: sdk: flutter - e2e: 0.4.0 + integration_test: 0.9.0 http: 0.12.0+2 test: any diff --git a/e2etests/web/regular_integration_tests/test_driver/image_loading_e2e.dart b/e2etests/web/regular_integration_tests/test_driver/image_loading_e2e.dart index 3c858da3a9d08..2d87590b95386 100644 --- a/e2etests/web/regular_integration_tests/test_driver/image_loading_e2e.dart +++ b/e2etests/web/regular_integration_tests/test_driver/image_loading_e2e.dart @@ -6,10 +6,10 @@ import 'dart:html' as html; import 'package:flutter_test/flutter_test.dart'; import 'package:regular_integration_tests/image_loading_main.dart' as app; -import 'package:e2e/e2e.dart'; +import 'package:integration_test/integration_test.dart'; void main() { - E2EWidgetsFlutterBinding.ensureInitialized() as E2EWidgetsFlutterBinding; + IntegrationTestWidgetsFlutterBinding.ensureInitialized(); testWidgets('Image loads asset variant based on device pixel ratio', (WidgetTester tester) async { diff --git a/e2etests/web/regular_integration_tests/test_driver/image_loading_e2e_test.dart b/e2etests/web/regular_integration_tests/test_driver/image_loading_e2e_test.dart index a29203f7dcdd9..96b5ad0bf52a4 100644 --- a/e2etests/web/regular_integration_tests/test_driver/image_loading_e2e_test.dart +++ b/e2etests/web/regular_integration_tests/test_driver/image_loading_e2e_test.dart @@ -2,6 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import 'package:e2e/e2e_driver.dart' as e2e; +import 'package:integration_test/integration_test_driver.dart' as test; -Future main() async => e2e.main(); +Future main() async => test.integrationDriver(); diff --git a/e2etests/web/regular_integration_tests/test_driver/platform_messages_e2e.dart b/e2etests/web/regular_integration_tests/test_driver/platform_messages_e2e.dart index cd6a816b67f67..af77ea1a1437b 100644 --- a/e2etests/web/regular_integration_tests/test_driver/platform_messages_e2e.dart +++ b/e2etests/web/regular_integration_tests/test_driver/platform_messages_e2e.dart @@ -10,10 +10,10 @@ import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:regular_integration_tests/platform_messages_main.dart' as app; -import 'package:e2e/e2e.dart'; +import 'package:integration_test/integration_test.dart'; void main() async { - E2EWidgetsFlutterBinding.ensureInitialized() as E2EWidgetsFlutterBinding; + IntegrationTestWidgetsFlutterBinding.ensureInitialized(); testWidgets('platform message for Clipboard.setData reply with future', (WidgetTester tester) async { diff --git a/e2etests/web/regular_integration_tests/test_driver/platform_messages_e2e_test.dart b/e2etests/web/regular_integration_tests/test_driver/platform_messages_e2e_test.dart index a29203f7dcdd9..96b5ad0bf52a4 100644 --- a/e2etests/web/regular_integration_tests/test_driver/platform_messages_e2e_test.dart +++ b/e2etests/web/regular_integration_tests/test_driver/platform_messages_e2e_test.dart @@ -2,6 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import 'package:e2e/e2e_driver.dart' as e2e; +import 'package:integration_test/integration_test_driver.dart' as test; -Future main() async => e2e.main(); +Future main() async => test.integrationDriver(); diff --git a/e2etests/web/regular_integration_tests/test_driver/profile_diagnostics_e2e.dart b/e2etests/web/regular_integration_tests/test_driver/profile_diagnostics_e2e.dart index 485a77736cb7e..95c77b380a2c8 100644 --- a/e2etests/web/regular_integration_tests/test_driver/profile_diagnostics_e2e.dart +++ b/e2etests/web/regular_integration_tests/test_driver/profile_diagnostics_e2e.dart @@ -2,15 +2,13 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import 'dart:html' as html; -import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:regular_integration_tests/profile_diagnostics_main.dart' as app; -import 'package:e2e/e2e.dart'; +import 'package:integration_test/integration_test.dart'; void main() { - E2EWidgetsFlutterBinding.ensureInitialized() as E2EWidgetsFlutterBinding; + IntegrationTestWidgetsFlutterBinding.ensureInitialized(); testWidgets('App build method exception should form valid FlutterErrorDetails', (WidgetTester tester) async { diff --git a/e2etests/web/regular_integration_tests/test_driver/profile_diagnostics_e2e_test.dart b/e2etests/web/regular_integration_tests/test_driver/profile_diagnostics_e2e_test.dart index a29203f7dcdd9..96b5ad0bf52a4 100644 --- a/e2etests/web/regular_integration_tests/test_driver/profile_diagnostics_e2e_test.dart +++ b/e2etests/web/regular_integration_tests/test_driver/profile_diagnostics_e2e_test.dart @@ -2,6 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import 'package:e2e/e2e_driver.dart' as e2e; +import 'package:integration_test/integration_test_driver.dart' as test; -Future main() async => e2e.main(); +Future main() async => test.integrationDriver(); diff --git a/e2etests/web/regular_integration_tests/test_driver/target_platform_android_e2e.dart b/e2etests/web/regular_integration_tests/test_driver/target_platform_android_e2e.dart index 0e3cab4118002..d914d54693296 100644 --- a/e2etests/web/regular_integration_tests/test_driver/target_platform_android_e2e.dart +++ b/e2etests/web/regular_integration_tests/test_driver/target_platform_android_e2e.dart @@ -6,10 +6,10 @@ import 'package:flutter_test/flutter_test.dart'; import 'package:regular_integration_tests/target_platform_main.dart' as app; import 'package:flutter/material.dart'; -import 'package:e2e/e2e.dart'; +import 'package:integration_test/integration_test.dart'; void main() { - E2EWidgetsFlutterBinding.ensureInitialized() as E2EWidgetsFlutterBinding; + IntegrationTestWidgetsFlutterBinding.ensureInitialized(); testWidgets('Should detect android platform when running on android device', (WidgetTester tester) async { diff --git a/e2etests/web/regular_integration_tests/test_driver/target_platform_android_e2e_test.dart b/e2etests/web/regular_integration_tests/test_driver/target_platform_android_e2e_test.dart index a29203f7dcdd9..96b5ad0bf52a4 100644 --- a/e2etests/web/regular_integration_tests/test_driver/target_platform_android_e2e_test.dart +++ b/e2etests/web/regular_integration_tests/test_driver/target_platform_android_e2e_test.dart @@ -2,6 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import 'package:e2e/e2e_driver.dart' as e2e; +import 'package:integration_test/integration_test_driver.dart' as test; -Future main() async => e2e.main(); +Future main() async => test.integrationDriver(); diff --git a/e2etests/web/regular_integration_tests/test_driver/target_platform_ios_e2e.dart b/e2etests/web/regular_integration_tests/test_driver/target_platform_ios_e2e.dart index 6f32322248e47..72a74fc73e97d 100644 --- a/e2etests/web/regular_integration_tests/test_driver/target_platform_ios_e2e.dart +++ b/e2etests/web/regular_integration_tests/test_driver/target_platform_ios_e2e.dart @@ -6,10 +6,10 @@ import 'package:flutter_test/flutter_test.dart'; import 'package:regular_integration_tests/target_platform_main.dart' as app; import 'package:flutter/material.dart'; -import 'package:e2e/e2e.dart'; +import 'package:integration_test/integration_test.dart'; void main() { - E2EWidgetsFlutterBinding.ensureInitialized() as E2EWidgetsFlutterBinding; + IntegrationTestWidgetsFlutterBinding.ensureInitialized(); testWidgets('Should detect iOS platform when running on iOS device', (WidgetTester tester) async { diff --git a/e2etests/web/regular_integration_tests/test_driver/target_platform_ios_e2e_test.dart b/e2etests/web/regular_integration_tests/test_driver/target_platform_ios_e2e_test.dart index a29203f7dcdd9..96b5ad0bf52a4 100644 --- a/e2etests/web/regular_integration_tests/test_driver/target_platform_ios_e2e_test.dart +++ b/e2etests/web/regular_integration_tests/test_driver/target_platform_ios_e2e_test.dart @@ -2,6 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import 'package:e2e/e2e_driver.dart' as e2e; +import 'package:integration_test/integration_test_driver.dart' as test; -Future main() async => e2e.main(); +Future main() async => test.integrationDriver(); diff --git a/e2etests/web/regular_integration_tests/test_driver/target_platform_macos_e2e.dart b/e2etests/web/regular_integration_tests/test_driver/target_platform_macos_e2e.dart index c996a319200c8..4a20827769eb9 100644 --- a/e2etests/web/regular_integration_tests/test_driver/target_platform_macos_e2e.dart +++ b/e2etests/web/regular_integration_tests/test_driver/target_platform_macos_e2e.dart @@ -6,10 +6,10 @@ import 'package:flutter_test/flutter_test.dart'; import 'package:regular_integration_tests/target_platform_main.dart' as app; import 'package:flutter/material.dart'; -import 'package:e2e/e2e.dart'; +import 'package:integration_test/integration_test.dart'; void main() { - E2EWidgetsFlutterBinding.ensureInitialized() as E2EWidgetsFlutterBinding; + IntegrationTestWidgetsFlutterBinding.ensureInitialized(); testWidgets('Should detect MacOS platform when running on MacOS', (WidgetTester tester) async { diff --git a/e2etests/web/regular_integration_tests/test_driver/target_platform_macos_e2e_test.dart b/e2etests/web/regular_integration_tests/test_driver/target_platform_macos_e2e_test.dart index a29203f7dcdd9..96b5ad0bf52a4 100644 --- a/e2etests/web/regular_integration_tests/test_driver/target_platform_macos_e2e_test.dart +++ b/e2etests/web/regular_integration_tests/test_driver/target_platform_macos_e2e_test.dart @@ -2,6 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import 'package:e2e/e2e_driver.dart' as e2e; +import 'package:integration_test/integration_test_driver.dart' as test; -Future main() async => e2e.main(); +Future main() async => test.integrationDriver(); diff --git a/e2etests/web/regular_integration_tests/test_driver/text_editing_e2e.dart b/e2etests/web/regular_integration_tests/test_driver/text_editing_e2e.dart index ea2dddeaa2f2c..c9e5e7ad63d62 100644 --- a/e2etests/web/regular_integration_tests/test_driver/text_editing_e2e.dart +++ b/e2etests/web/regular_integration_tests/test_driver/text_editing_e2e.dart @@ -9,10 +9,10 @@ import 'package:flutter_test/flutter_test.dart'; import 'package:regular_integration_tests/text_editing_main.dart' as app; import 'package:flutter/material.dart'; -import 'package:e2e/e2e.dart'; +import 'package:integration_test/integration_test.dart'; void main() { - E2EWidgetsFlutterBinding.ensureInitialized() as E2EWidgetsFlutterBinding; + IntegrationTestWidgetsFlutterBinding.ensureInitialized(); testWidgets('Focused text field creates a native input element', (WidgetTester tester) async { diff --git a/e2etests/web/regular_integration_tests/test_driver/text_editing_e2e_test.dart b/e2etests/web/regular_integration_tests/test_driver/text_editing_e2e_test.dart index a29203f7dcdd9..96b5ad0bf52a4 100644 --- a/e2etests/web/regular_integration_tests/test_driver/text_editing_e2e_test.dart +++ b/e2etests/web/regular_integration_tests/test_driver/text_editing_e2e_test.dart @@ -2,6 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import 'package:e2e/e2e_driver.dart' as e2e; +import 'package:integration_test/integration_test_driver.dart' as test; -Future main() async => e2e.main(); +Future main() async => test.integrationDriver(); diff --git a/e2etests/web/regular_integration_tests/test_driver/treeshaking_e2e.dart b/e2etests/web/regular_integration_tests/test_driver/treeshaking_e2e.dart index 30758c555f5b0..9acd9e5eb63c8 100644 --- a/e2etests/web/regular_integration_tests/test_driver/treeshaking_e2e.dart +++ b/e2etests/web/regular_integration_tests/test_driver/treeshaking_e2e.dart @@ -7,10 +7,10 @@ import 'package:flutter_test/flutter_test.dart'; import 'package:regular_integration_tests/treeshaking_main.dart' as app; import 'package:flutter/material.dart'; -import 'package:e2e/e2e.dart'; +import 'package:integration_test/integration_test.dart'; void main() { - E2EWidgetsFlutterBinding.ensureInitialized() as E2EWidgetsFlutterBinding; + IntegrationTestWidgetsFlutterBinding.ensureInitialized(); testWidgets('debug+Fill+Properties for widgets is tree shaken', (WidgetTester tester) async { diff --git a/e2etests/web/regular_integration_tests/test_driver/treeshaking_e2e_test.dart b/e2etests/web/regular_integration_tests/test_driver/treeshaking_e2e_test.dart index a29203f7dcdd9..96b5ad0bf52a4 100644 --- a/e2etests/web/regular_integration_tests/test_driver/treeshaking_e2e_test.dart +++ b/e2etests/web/regular_integration_tests/test_driver/treeshaking_e2e_test.dart @@ -2,6 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import 'package:e2e/e2e_driver.dart' as e2e; +import 'package:integration_test/integration_test_driver.dart' as test; -Future main() async => e2e.main(); +Future main() async => test.integrationDriver();