Fix for the tests
This commit is contained in:
parent
d2aef4aa0d
commit
a58ed36000
|
|
@ -1,4 +1,6 @@
|
||||||
// Import Flutter Driver API
|
// Import Flutter Driver API
|
||||||
|
import 'dart:async';
|
||||||
|
|
||||||
import 'package:flutter_driver/flutter_driver.dart';
|
import 'package:flutter_driver/flutter_driver.dart';
|
||||||
import 'package:test/test.dart';
|
import 'package:test/test.dart';
|
||||||
|
|
||||||
|
|
@ -9,15 +11,29 @@ void main() {
|
||||||
group('LOGIN TEST', () {
|
group('LOGIN TEST', () {
|
||||||
TestLocalization localization;
|
TestLocalization localization;
|
||||||
FlutterDriver driver;
|
FlutterDriver driver;
|
||||||
|
StreamSubscription streamSubscription;
|
||||||
|
|
||||||
setUpAll(() async {
|
setUpAll(() async {
|
||||||
localization = TestLocalization('en');
|
localization = TestLocalization('en');
|
||||||
driver = await FlutterDriver.connect();
|
driver = await FlutterDriver.connect(printCommunication: false);
|
||||||
|
|
||||||
|
// https://github.com/flutter/flutter/issues/24703#issuecomment-526382318
|
||||||
|
streamSubscription = driver.serviceClient.onIsolateRunnable
|
||||||
|
.asBroadcastStream()
|
||||||
|
.listen((isolateRef) {
|
||||||
|
print(
|
||||||
|
'Resuming isolate: ${isolateRef.numberAsString}:${isolateRef.name}');
|
||||||
|
isolateRef.resume();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
tearDownAll(() async {
|
tearDownAll(() async {
|
||||||
if (driver != null) {
|
if (driver != null) {
|
||||||
driver.close();
|
driver.close();
|
||||||
}
|
}
|
||||||
|
if (streamSubscription != null) {
|
||||||
|
streamSubscription.cancel();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
group('SELF-HOSTED', () {
|
group('SELF-HOSTED', () {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue