Skip to content
This repository has been archived by the owner on Jan 17, 2019. It is now read-only.

Commit

Permalink
Initialize WDA for UITesting when using devices
Browse files Browse the repository at this point in the history
Summary: Configurations are copied around and we missed two places. :)

Reviewed By: nqmtuan

Differential Revision: D3834885

fbshipit-source-id: 5ccb320878ca8541560e796ee6588aaee6f3c13e
  • Loading branch information
Marek Cirkos authored and Facebook Github Bot 0 committed Sep 8, 2016
1 parent 3821874 commit 74b19d8
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 9 deletions.
20 changes: 11 additions & 9 deletions XCTestBootstrap/Bundles/FBApplicationDataPackage.m
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,11 @@ - (FBApplicationDataPackage *)buildWithError:(NSError **)error
}
NSError *innerError;
package.testConfiguration =
[[[[[[FBTestConfigurationBuilder builderWithFileManager:self.fileManager]
withModuleName:self.testBundle.name]
withSessionIdentifier:self.testBundle.configuration.sessionIdentifier]
withTestBundlePath:deviceTestBundlePath]
[[[[[[[FBTestConfigurationBuilder builderWithFileManager:self.fileManager]
withModuleName:self.testBundle.name]
withSessionIdentifier:self.testBundle.configuration.sessionIdentifier]
withTestBundlePath:deviceTestBundlePath]
withUITesting:self.testBundle.configuration.shouldInitializeForUITesting]
saveAs:[localTestPlanDirPath stringByAppendingPathComponent:testConfigurationFileName]]
buildWithError:&innerError];
if (!package.testConfiguration) {
Expand All @@ -144,11 +145,12 @@ - (FBApplicationDataPackage *)buildWithError:(NSError **)error
}

package.testBundle =
[[[[[[FBTestBundleBuilder builderWithFileManager:self.fileManager]
withBundlePath:testBundlePath]
withSessionIdentifier:self.testBundle.configuration.sessionIdentifier]
withWorkingDirectory:workingDirectory]
withCodesignProvider:self.codesignProvider]
[[[[[[[FBTestBundleBuilder builderWithFileManager:self.fileManager]
withBundlePath:testBundlePath]
withSessionIdentifier:self.testBundle.configuration.sessionIdentifier]
withWorkingDirectory:workingDirectory]
withCodesignProvider:self.codesignProvider]
withUITesting:self.testBundle.configuration.shouldInitializeForUITesting]
buildWithError:&innerError];
if (!package.testBundle) {
return
Expand Down
5 changes: 5 additions & 0 deletions XCTestBootstrap/Bundles/FBTestConfiguration.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@
*/
@property (nonatomic, copy, readonly) NSString *path;

/**
Determines whether should initialize for UITesting
*/
@property (nonatomic, assign, readonly) BOOL shouldInitializeForUITesting;

@end

/**
Expand Down
2 changes: 2 additions & 0 deletions XCTestBootstrap/Bundles/FBTestConfiguration.m
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ @interface FBTestConfiguration ()
@property (nonatomic, copy) NSString *moduleName;
@property (nonatomic, copy) NSString *testBundlePath;
@property (nonatomic, copy) NSString *path;
@property (nonatomic, assign) BOOL shouldInitializeForUITesting;
@end

@implementation FBTestConfiguration
Expand Down Expand Up @@ -101,6 +102,7 @@ - (FBTestConfiguration *)buildWithError:(NSError **)error
configuration.testBundlePath = self.testBundlePath;
configuration.moduleName = self.moduleName;
configuration.path = self.savePath;
configuration.shouldInitializeForUITesting = self.shouldInitializeForUITesting;
return configuration;
}

Expand Down

0 comments on commit 74b19d8

Please sign in to comment.