[flutter_tools] enable web integration tests (#69114)
* [flutter_tools] stage web integration tests
This commit is contained in:
parent
735f6eec2c
commit
d0cdfa4176
@ -46,7 +46,7 @@ void main() {
|
|||||||
reason: 'After $i steps, debugger should stop at $expectedLine but stopped at $actualLine'
|
reason: 'After $i steps, debugger should stop at $expectedLine but stopped at $actualLine'
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}, skip: true); // https://github.com/flutter/flutter/issues/62889
|
}, skip: platform.isMacOS);
|
||||||
|
|
||||||
tearDown(() async {
|
tearDown(() async {
|
||||||
await flutter.stop();
|
await flutter.stop();
|
||||||
|
@ -57,7 +57,7 @@ void batch1() {
|
|||||||
await breakInTopLevelFunction(_flutter);
|
await breakInTopLevelFunction(_flutter);
|
||||||
await failToEvaluateExpression(_flutter);
|
await failToEvaluateExpression(_flutter);
|
||||||
await cleanProject();
|
await cleanProject();
|
||||||
}, skip: 'CI not setup for web tests'); // https://github.com/flutter/flutter/issues/53779
|
}, skip: platform.isMacOS);
|
||||||
|
|
||||||
testWithoutContext('flutter run expression evaluation - no native javascript objects in static scope', () async {
|
testWithoutContext('flutter run expression evaluation - no native javascript objects in static scope', () async {
|
||||||
await initProject();
|
await initProject();
|
||||||
@ -65,7 +65,7 @@ void batch1() {
|
|||||||
await breakInTopLevelFunction(_flutter);
|
await breakInTopLevelFunction(_flutter);
|
||||||
await checkStaticScope(_flutter);
|
await checkStaticScope(_flutter);
|
||||||
await cleanProject();
|
await cleanProject();
|
||||||
}, skip: 'CI not setup for web tests'); // https://github.com/flutter/flutter/issues/53779
|
}, skip: platform.isMacOS);
|
||||||
|
|
||||||
testWithoutContext('flutter run expression evaluation - can handle compilation errors', () async {
|
testWithoutContext('flutter run expression evaluation - can handle compilation errors', () async {
|
||||||
await initProject();
|
await initProject();
|
||||||
@ -73,7 +73,7 @@ void batch1() {
|
|||||||
await breakInTopLevelFunction(_flutter);
|
await breakInTopLevelFunction(_flutter);
|
||||||
await evaluateErrorExpressions(_flutter);
|
await evaluateErrorExpressions(_flutter);
|
||||||
await cleanProject();
|
await cleanProject();
|
||||||
}, skip: 'CI not setup for web tests'); // https://github.com/flutter/flutter/issues/53779
|
}, skip: platform.isMacOS);
|
||||||
|
|
||||||
testWithoutContext('flutter run expression evaluation - can evaluate trivial expressions in top level function', () async {
|
testWithoutContext('flutter run expression evaluation - can evaluate trivial expressions in top level function', () async {
|
||||||
await initProject();
|
await initProject();
|
||||||
@ -81,7 +81,7 @@ void batch1() {
|
|||||||
await breakInTopLevelFunction(_flutter);
|
await breakInTopLevelFunction(_flutter);
|
||||||
await evaluateTrivialExpressions(_flutter);
|
await evaluateTrivialExpressions(_flutter);
|
||||||
await cleanProject();
|
await cleanProject();
|
||||||
}, skip: 'CI not setup for web tests'); // https://github.com/flutter/flutter/issues/53779
|
}, skip: platform.isMacOS);
|
||||||
|
|
||||||
testWithoutContext('flutter run expression evaluation - can evaluate trivial expressions in build method', () async {
|
testWithoutContext('flutter run expression evaluation - can evaluate trivial expressions in build method', () async {
|
||||||
await initProject();
|
await initProject();
|
||||||
@ -89,7 +89,7 @@ void batch1() {
|
|||||||
await breakInBuildMethod(_flutter);
|
await breakInBuildMethod(_flutter);
|
||||||
await evaluateTrivialExpressions(_flutter);
|
await evaluateTrivialExpressions(_flutter);
|
||||||
await cleanProject();
|
await cleanProject();
|
||||||
}, skip: 'CI not setup for web tests'); // https://github.com/flutter/flutter/issues/53779
|
}, skip: platform.isMacOS);
|
||||||
|
|
||||||
testWithoutContext('flutter run expression evaluation - can evaluate complex expressions in top level function', () async {
|
testWithoutContext('flutter run expression evaluation - can evaluate complex expressions in top level function', () async {
|
||||||
await initProject();
|
await initProject();
|
||||||
@ -97,7 +97,7 @@ void batch1() {
|
|||||||
await breakInTopLevelFunction(_flutter);
|
await breakInTopLevelFunction(_flutter);
|
||||||
await evaluateComplexExpressions(_flutter);
|
await evaluateComplexExpressions(_flutter);
|
||||||
await cleanProject();
|
await cleanProject();
|
||||||
}, skip: 'CI not setup for web tests'); // https://github.com/flutter/flutter/issues/53779
|
}, skip: platform.isMacOS);
|
||||||
|
|
||||||
testWithoutContext('flutter run expression evaluation - can evaluate complex expressions in build method', () async {
|
testWithoutContext('flutter run expression evaluation - can evaluate complex expressions in build method', () async {
|
||||||
await initProject();
|
await initProject();
|
||||||
@ -105,7 +105,7 @@ void batch1() {
|
|||||||
await breakInBuildMethod(_flutter);
|
await breakInBuildMethod(_flutter);
|
||||||
await evaluateComplexExpressions(_flutter);
|
await evaluateComplexExpressions(_flutter);
|
||||||
await cleanProject();
|
await cleanProject();
|
||||||
}, skip: 'CI not setup for web tests'); // https://github.com/flutter/flutter/issues/53779
|
}, skip: platform.isMacOS);
|
||||||
}
|
}
|
||||||
|
|
||||||
void batch2() {
|
void batch2() {
|
||||||
@ -149,7 +149,7 @@ void batch2() {
|
|||||||
await breakInMethod(_flutter);
|
await breakInMethod(_flutter);
|
||||||
await failToEvaluateExpression(_flutter);
|
await failToEvaluateExpression(_flutter);
|
||||||
await cleanProject();
|
await cleanProject();
|
||||||
}, skip: 'CI not setup for web tests'); // https://github.com/flutter/flutter/issues/53779
|
}, skip: platform.isMacOS);
|
||||||
|
|
||||||
testWithoutContext('flutter test expression evaluation - can evaluate trivial expressions in a test', () async {
|
testWithoutContext('flutter test expression evaluation - can evaluate trivial expressions in a test', () async {
|
||||||
await initProject();
|
await initProject();
|
||||||
@ -157,7 +157,7 @@ void batch2() {
|
|||||||
await breakInMethod(_flutter);
|
await breakInMethod(_flutter);
|
||||||
await evaluateTrivialExpressions(_flutter);
|
await evaluateTrivialExpressions(_flutter);
|
||||||
await cleanProject();
|
await cleanProject();
|
||||||
}, skip: 'CI not setup for web tests'); // https://github.com/flutter/flutter/issues/53779
|
}, skip: platform.isMacOS);
|
||||||
|
|
||||||
testWithoutContext('flutter test expression evaluation - can evaluate complex expressions in a test', () async {
|
testWithoutContext('flutter test expression evaluation - can evaluate complex expressions in a test', () async {
|
||||||
await initProject();
|
await initProject();
|
||||||
@ -165,7 +165,7 @@ void batch2() {
|
|||||||
await breakInMethod(_flutter);
|
await breakInMethod(_flutter);
|
||||||
await evaluateComplexExpressions(_flutter);
|
await evaluateComplexExpressions(_flutter);
|
||||||
await cleanProject();
|
await cleanProject();
|
||||||
}, skip: 'CI not setup for web tests'); // https://github.com/flutter/flutter/issues/53779
|
}, skip: platform.isMacOS);
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> failToEvaluateExpression(FlutterTestDriver flutter) async {
|
Future<void> failToEvaluateExpression(FlutterTestDriver flutter) async {
|
||||||
|
@ -0,0 +1,52 @@
|
|||||||
|
// Copyright 2014 The Flutter 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 'dart:async';
|
||||||
|
|
||||||
|
import 'package:file/file.dart';
|
||||||
|
|
||||||
|
import '../src/common.dart';
|
||||||
|
import 'test_data/hot_reload_project.dart';
|
||||||
|
import 'test_driver.dart';
|
||||||
|
import 'test_utils.dart';
|
||||||
|
|
||||||
|
void main() {
|
||||||
|
Directory tempDir;
|
||||||
|
final HotReloadProject project = HotReloadProject();
|
||||||
|
FlutterRunTestDriver flutter;
|
||||||
|
|
||||||
|
setUp(() async {
|
||||||
|
tempDir = createResolvedTempDirectorySync('hot_reload_test.');
|
||||||
|
await project.setUpIn(tempDir);
|
||||||
|
flutter = FlutterRunTestDriver(tempDir);
|
||||||
|
});
|
||||||
|
|
||||||
|
tearDown(() async {
|
||||||
|
await flutter?.stop();
|
||||||
|
tryToDelete(tempDir);
|
||||||
|
});
|
||||||
|
|
||||||
|
testWithoutContext('hot restart works without error', () async {
|
||||||
|
await flutter.run(chrome: true);
|
||||||
|
await flutter.hotRestart();
|
||||||
|
}, skip: platform.isMacOS);
|
||||||
|
|
||||||
|
testWithoutContext('newly added code executes during hot restart', () async {
|
||||||
|
final Completer<void> completer = Completer<void>();
|
||||||
|
final StreamSubscription<String> subscription = flutter.stdout.listen((String line) {
|
||||||
|
print(line);
|
||||||
|
if (line.contains('(((((RELOAD WORKED)))))')) {
|
||||||
|
completer.complete();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
await flutter.run(chrome: true);
|
||||||
|
project.uncommentHotReloadPrint();
|
||||||
|
try {
|
||||||
|
await flutter.hotRestart();
|
||||||
|
await completer.future;
|
||||||
|
} finally {
|
||||||
|
await subscription.cancel();
|
||||||
|
}
|
||||||
|
}, skip: platform.isMacOS);
|
||||||
|
}
|
@ -89,8 +89,8 @@ class WebSteppingProject extends Project {
|
|||||||
|
|
||||||
Future<void> doAsyncStuff() async {
|
Future<void> doAsyncStuff() async {
|
||||||
print("test"); // BREAKPOINT
|
print("test"); // BREAKPOINT
|
||||||
await new Future.value(true); // STEP 1 // STEP 2
|
await new Future.value(true); // STEP 1
|
||||||
await new Future.microtask(() => true);
|
await new Future.microtask(() => true); // STEP 2
|
||||||
await new Future.delayed(const Duration(milliseconds: 1)); // STEP 3
|
await new Future.delayed(const Duration(milliseconds: 1)); // STEP 3
|
||||||
print("done!"); // STEP 4
|
print("done!"); // STEP 4
|
||||||
} // STEP 5
|
} // STEP 5
|
||||||
|
@ -27,5 +27,5 @@ void main() {
|
|||||||
|
|
||||||
testWithoutContext('flutter run works on web devices with a unary main function', () async {
|
testWithoutContext('flutter run works on web devices with a unary main function', () async {
|
||||||
await flutter.run(chrome: true);
|
await flutter.run(chrome: true);
|
||||||
}, skip: 'Web CI skipped');
|
}, skip: platform.isMacOS);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user