fix(driver): increased the Flutter driver reconnection delay to try and overcome some driver to app connection issues on slower machines
This commit is contained in:
parent
3fab3ca2e9
commit
6fd30a6492
|
@ -1,3 +1,6 @@
|
||||||
|
## [1.1.7+2] - 07/01/2019
|
||||||
|
* Increased the Flutter driver reconnection delay to try and overcome some driver to app connection issues on slower machines
|
||||||
|
|
||||||
## [1.1.7+1] - 07/01/2019
|
## [1.1.7+1] - 07/01/2019
|
||||||
* Ensured when the Flutter driver is closed it cannot throw an unhandled exception causing the test run the stop
|
* Ensured when the Flutter driver is closed it cannot throw an unhandled exception causing the test run the stop
|
||||||
* Updated Gherkin library version
|
* Updated Gherkin library version
|
||||||
|
|
|
@ -41,6 +41,7 @@ class FlutterRunProcessHandler extends ProcessHandler {
|
||||||
String _appTarget;
|
String _appTarget;
|
||||||
String _buildFlavor;
|
String _buildFlavor;
|
||||||
String _deviceTargetId;
|
String _deviceTargetId;
|
||||||
|
Duration _driverConnectionDelay = const Duration(seconds: 2);
|
||||||
String currentObservatoryUri;
|
String currentObservatoryUri;
|
||||||
|
|
||||||
void setLogFlutterProcessOutput(bool logFlutterProcessOutput) {
|
void setLogFlutterProcessOutput(bool logFlutterProcessOutput) {
|
||||||
|
@ -51,6 +52,10 @@ class FlutterRunProcessHandler extends ProcessHandler {
|
||||||
_appTarget = targetPath;
|
_appTarget = targetPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void setDriverConnectionDelay(Duration duration) {
|
||||||
|
_driverConnectionDelay = duration ?? _driverConnectionDelay;
|
||||||
|
}
|
||||||
|
|
||||||
void setWorkingDirectory(String workingDirectory) {
|
void setWorkingDirectory(String workingDirectory) {
|
||||||
_workingDirectory = workingDirectory;
|
_workingDirectory = workingDirectory;
|
||||||
}
|
}
|
||||||
|
@ -146,7 +151,7 @@ class FlutterRunProcessHandler extends ProcessHandler {
|
||||||
|
|
||||||
// it seems we need a small delay here otherwise the flutter driver fails to
|
// it seems we need a small delay here otherwise the flutter driver fails to
|
||||||
// consistently connect
|
// consistently connect
|
||||||
await Future.delayed(Duration(seconds: 1));
|
await Future.delayed(_driverConnectionDelay);
|
||||||
|
|
||||||
return Future.value(true);
|
return Future.value(true);
|
||||||
}
|
}
|
||||||
|
|
|
@ -52,7 +52,12 @@ class FlutterTestConfiguration extends TestConfiguration {
|
||||||
/// Duration to wait for Flutter to build and start the app on the target device
|
/// Duration to wait for Flutter to build and start the app on the target device
|
||||||
/// Slower machine may take longer to build and run a large app
|
/// Slower machine may take longer to build and run a large app
|
||||||
/// Defaults to 90 seconds
|
/// Defaults to 90 seconds
|
||||||
Duration flutterBuildTimeout = Duration(seconds: 90);
|
Duration flutterBuildTimeout = const Duration(seconds: 90);
|
||||||
|
|
||||||
|
/// Duration to wait before reconnecting the Flutter driver to the app.
|
||||||
|
/// On slower machines the app might not be in a state where the driver can successfully connect immediately
|
||||||
|
/// Defaults to 2 seconds
|
||||||
|
Duration flutterDriverReconnectionDelay = const Duration(seconds: 2);
|
||||||
|
|
||||||
void setObservatoryDebuggerUri(String uri) => _observatoryDebuggerUri = uri;
|
void setObservatoryDebuggerUri(String uri) => _observatoryDebuggerUri = uri;
|
||||||
|
|
||||||
|
|
|
@ -49,7 +49,7 @@ class FlutterWorld extends World {
|
||||||
await _driver.close();
|
await _driver.close();
|
||||||
}
|
}
|
||||||
} catch (e, st) {
|
} catch (e, st) {
|
||||||
print('Error closing Flutter driver:\n\n`${e}`\n\n${st}');
|
print('Error closing Flutter driver:\n\n`$e`\n\n$st');
|
||||||
} finally {
|
} finally {
|
||||||
_driver = null;
|
_driver = null;
|
||||||
}
|
}
|
||||||
|
|
|
@ -62,6 +62,7 @@ class FlutterAppRunnerHook extends Hook {
|
||||||
..setLogFlutterProcessOutput(config.logFlutterProcessOutput)
|
..setLogFlutterProcessOutput(config.logFlutterProcessOutput)
|
||||||
..setVerboseFluterlogs(config.verboseFlutterProcessLogs)
|
..setVerboseFluterlogs(config.verboseFlutterProcessLogs)
|
||||||
..setApplicationTargetFile(config.targetAppPath)
|
..setApplicationTargetFile(config.targetAppPath)
|
||||||
|
..setDriverConnectionDelay(config.flutterDriverReconnectionDelay)
|
||||||
..setWorkingDirectory(config.targetAppWorkingDirecotry)
|
..setWorkingDirectory(config.targetAppWorkingDirecotry)
|
||||||
..setBuildRequired(haveRunFirstScenario ? false : config.build)
|
..setBuildRequired(haveRunFirstScenario ? false : config.build)
|
||||||
..setBuildFlavor(config.buildFlavor)
|
..setBuildFlavor(config.buildFlavor)
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
name: flutter_gherkin
|
name: flutter_gherkin
|
||||||
description: A Gherkin / Cucumber parser and test runner for Dart and Flutter
|
description: A Gherkin / Cucumber parser and test runner for Dart and Flutter
|
||||||
version: 1.1.7+1
|
version: 1.1.7+2
|
||||||
author: Jon Samwell <jonsamwell@gmail.com>
|
author: Jon Samwell <jonsamwell@gmail.com>
|
||||||
homepage: https://github.com/jonsamwell/flutter_gherkin
|
homepage: https://github.com/jonsamwell/flutter_gherkin
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue