diff --git a/lib/common b/lib/common index b24e3a8a1a..bdd7023bf2 160000 --- a/lib/common +++ b/lib/common @@ -1 +1 @@ -Subproject commit b24e3a8a1a9349e1a222853031d06968751f36eb +Subproject commit bdd7023bf2727ae5e235408d505d6cf0233dbb93 diff --git a/lib/services/livesync/android-livesync-service.ts b/lib/services/livesync/android-livesync-service.ts index c6fe4551da..8386457609 100644 --- a/lib/services/livesync/android-livesync-service.ts +++ b/lib/services/livesync/android-livesync-service.ts @@ -14,8 +14,9 @@ class AndroidLiveSyncService extends liveSyncServiceBaseLib.LiveSyncServiceBase< private $mobileHelper: Mobile.IMobileHelper, private $options: IOptions, private $injector: IInjector, - private $projectData: IProjectData) { - super(_device); + private $projectData: IProjectData, + $liveSyncProvider: ILiveSyncProvider) { + super(_device, $liveSyncProvider); } public restartApplication(deviceAppData: Mobile.IDeviceAppData): IFuture { diff --git a/lib/services/livesync/ios-livesync-service.ts b/lib/services/livesync/ios-livesync-service.ts index a0c7795a3d..55a4583378 100644 --- a/lib/services/livesync/ios-livesync-service.ts +++ b/lib/services/livesync/ios-livesync-service.ts @@ -14,9 +14,10 @@ class IOSLiveSyncService extends liveSyncServiceBaseLib.LiveSyncServiceBase { return (() => { diff --git a/lib/services/livesync/livesync-service-base.ts b/lib/services/livesync/livesync-service-base.ts index dc566082e8..989a1fd606 100644 --- a/lib/services/livesync/livesync-service-base.ts +++ b/lib/services/livesync/livesync-service-base.ts @@ -3,9 +3,12 @@ export abstract class LiveSyncServiceBase { return (this._device); } - constructor(private _device: Mobile.IDevice) { } + constructor(private _device: Mobile.IDevice, + private $liveSyncProvider: ILiveSyncProvider) { } - public refreshApplication(deviceAppData: Mobile.IDeviceAppData, localToDevicePaths: Mobile.ILocalToDevicePathData[], canExecuteFastSync?: boolean): IFuture { + public refreshApplication(deviceAppData: Mobile.IDeviceAppData, localToDevicePaths: Mobile.ILocalToDevicePathData[], forceExecuteFullSync: boolean): IFuture { + let canExecuteFastSync = !forceExecuteFullSync && localToDevicePaths && + _.all(localToDevicePaths, localToDevicePath => this.$liveSyncProvider.canExecuteFastSync(localToDevicePath.getLocalPath(), deviceAppData.platform)); if (canExecuteFastSync) { return this.reloadPage(deviceAppData); } diff --git a/lib/services/test-execution-service.ts b/lib/services/test-execution-service.ts index 316aad9fdc..7f654fb579 100644 --- a/lib/services/test-execution-service.ts +++ b/lib/services/test-execution-service.ts @@ -64,14 +64,7 @@ class TestExecutionService implements ITestExecutionService { } this.detourEntryPoint(projectFilesPath).wait(); - let liveSyncData = { - platform: platform, - appIdentifier: this.$projectData.projectId, - projectFilesPath: projectFilesPath, - syncWorkingDirectory: path.join(projectDir, constants.APP_FOLDER_NAME) - }; - - this.$liveSyncServiceBase.sync(liveSyncData).wait(); + this.liveSyncProject(platform); if (this.$options.debugBrk) { this.$logger.info('Starting debugger...'); @@ -233,8 +226,8 @@ class TestExecutionService implements ITestExecutionService { platform: platform, appIdentifier: this.$projectData.projectId, projectFilesPath: projectFilesPath, + forceExecuteFullSync: true, // Always restart the application when change is detected, so tests will be rerun. syncWorkingDirectory: path.join(this.$projectData.projectDir, constants.APP_FOLDER_NAME), - canExecuteFastSync: false, // Always restart the application when change is detected, so tests will be rerun. excludedProjectDirsAndFiles: this.$options.release ? constants.LIVESYNC_EXCLUDED_FILE_PATTERNS : [] };