Skip to content

Commit

Permalink
Fixed getting orientation from config when no orientation
Browse files Browse the repository at this point in the history
  • Loading branch information
mmcc007 committed Jul 17, 2019
1 parent 9e0fabd commit a603f5c
Showing 1 changed file with 18 additions and 5 deletions.
23 changes: 18 additions & 5 deletions lib/src/run.dart
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,18 @@ Future runTestsOnAll(DaemonClient daemonClient, List devices, List emulators,
if (device != null && !device['emulator']) {
final defaultLocale = 'en_US'; // todo: need actual locale of real device
print('Warning: the locale of a real device cannot be changed.');
await runProcessTests(config, screens, configDeviceName, defaultLocale,
deviceType, testPaths, deviceId, imageProcessor, runMode, archive, 'unknown');
await runProcessTests(
config,
screens,
configDeviceName,
defaultLocale,
deviceType,
testPaths,
deviceId,
imageProcessor,
runMode,
archive,
'unknown');
} else {
// Function to check for a running android device or emulator
bool isRunningAndroidDeviceOrEmulator(Map device, Map emulator) {
Expand Down Expand Up @@ -225,9 +235,12 @@ Future runTestsOnAll(DaemonClient daemonClient, List devices, List emulators,
}

// Change orientation if required
final deviceOrientation = configInfo['devices']
[utils.getStringFromEnum(deviceType)][configDeviceName]
['orientation'];
final deviceInfo = configInfo['devices']
[utils.getStringFromEnum(deviceType)][configDeviceName];
String deviceOrientation;
deviceInfo != null
? deviceOrientation = deviceInfo['orientation']
: null;
if (deviceOrientation != null) {
final orientation = orient.getOrientationEnum(deviceOrientation);
final currentDevice =
Expand Down

0 comments on commit a603f5c

Please sign in to comment.