diff --git a/CompanionLib/Request/FBXCTestRunRequest.h b/CompanionLib/Request/FBXCTestRunRequest.h index 12c39f2e1..b3a20df29 100644 --- a/CompanionLib/Request/FBXCTestRunRequest.h +++ b/CompanionLib/Request/FBXCTestRunRequest.h @@ -71,6 +71,23 @@ The Initializer for App Tests. */ + (instancetype)applicationTestWithTestBundleID:(NSString *)testBundleID testHostAppBundleID:(NSString *)testHostAppBundleID environment:(NSDictionary *)environment arguments:(NSArray *)arguments testsToRun:(nullable NSSet *)testsToRun testsToSkip:(NSSet *)testsToSkip testTimeout:(NSNumber *)testTimeout reportActivities:(BOOL)reportActivities reportAttachments:(BOOL)reportAttachments coverageRequest:(FBCodeCoverageRequest *)coverageRequest collectLogs:(BOOL)collectLogs waitForDebugger:(BOOL)waitForDebugger collectResultBundle:(BOOL)collectResultBundle; + +/** +The Initializer for App Tests from a test path. + + @param testPath the path of the .xctest or .xctestrun file. + @param testHostAppBundleID the bundle id of the application to inject the test bundle into. + @param environment environment for the application test process. + @param arguments arguments for the application test process. + @param testsToRun the tests to run. + @param testsToSkip the tests to skip + @param testTimeout the timeout for the entire execution, nil if no timeout should be applied. + @param reportActivities if set activities and their data will be reported + @param coverageRequest information about llvm code coverage collection + @return an FBXCTestRunRequest instance. +*/ ++ (instancetype)applicationTestWithTestPath:(NSURL *)testPath testHostAppBundleID:(NSString *)testHostAppBundleID environment:(NSDictionary *)environment arguments:(NSArray *)arguments testsToRun:(nullable NSSet *)testsToRun testsToSkip:(NSSet *)testsToSkip testTimeout:(NSNumber *)testTimeout reportActivities:(BOOL)reportActivities reportAttachments:(BOOL)reportAttachments coverageRequest:(FBCodeCoverageRequest *)coverageRequest collectLogs:(BOOL)collectLogs waitForDebugger:(BOOL)waitForDebugger collectResultBundle:(BOOL)collectResultBundle; + /** The Initializer for UI Tests. @@ -87,6 +104,23 @@ The Initializer for UI Tests. */ + (instancetype)uiTestWithTestBundleID:(NSString *)testBundleID testHostAppBundleID:(NSString *)testHostAppBundleID testTargetAppBundleID:(NSString *)testTargetAppBundleID environment:(NSDictionary *)environment arguments:(NSArray *)arguments testsToRun:(nullable NSSet *)testsToRun testsToSkip:(NSSet *)testsToSkip testTimeout:(NSNumber *)testTimeout reportActivities:(BOOL)reportActivities reportAttachments:(BOOL)reportAttachments coverageRequest:(FBCodeCoverageRequest *)coverageRequest collectLogs:(BOOL)collectLogs collectResultBundle:(BOOL)collectResultBundle; + +/** +The Initializer for UI Tests. + + @param testPath the bundle id of the test to run. + @param testHostAppBundleID the bundle id of the application hosting the test bundle. + @param environment environment for the logic test process. + @param arguments arguments for the logic test process. + @param testsToRun the tests to run. + @param testsToSkip the tests to skip + @param testTimeout the timeout for the entire execution, nil if no timeout should be applied. + @param reportActivities if set activities and their data will be reported + @param coverageRequest information about llvm code coverage collection + @return an FBXCTestRunRequest instance. +*/ ++ (instancetype)uiTestWithTestPath:(NSURL *)testPath testHostAppBundleID:(NSString *)testHostAppBundleID testTargetAppBundleID:(NSString *)testTargetAppBundleID environment:(NSDictionary *)environment arguments:(NSArray *)arguments testsToRun:(nullable NSSet *)testsToRun testsToSkip:(NSSet *)testsToSkip testTimeout:(NSNumber *)testTimeout reportActivities:(BOOL)reportActivities reportAttachments:(BOOL)reportAttachments coverageRequest:(FBCodeCoverageRequest *)coverageRequest collectLogs:(BOOL)collectLogs collectResultBundle:(BOOL)collectResultBundle; + #pragma mark Properties /** diff --git a/CompanionLib/Request/FBXCTestRunRequest.m b/CompanionLib/Request/FBXCTestRunRequest.m index bf5dfcb02..d63c52aae 100644 --- a/CompanionLib/Request/FBXCTestRunRequest.m +++ b/CompanionLib/Request/FBXCTestRunRequest.m @@ -236,11 +236,20 @@ + (instancetype)applicationTestWithTestBundleID:(NSString *)testBundleID testHos return [[FBXCTestRunRequest_AppTest alloc] initWithTestBundleID:testBundleID testHostAppBundleID:testHostAppBundleID testTargetAppBundleID:nil environment:environment arguments:arguments testsToRun:testsToRun testsToSkip:testsToSkip testTimeout:testTimeout reportActivities:reportActivities reportAttachments:reportAttachments coverageRequest:coverageRequest collectLogs:collectLogs waitForDebugger:waitForDebugger collectResultBundle:collectResultBundle]; } ++ (instancetype)applicationTestWithTestPath:(NSURL *)testPath testHostAppBundleID:(NSString *)testHostAppBundleID environment:(NSDictionary *)environment arguments:(NSArray *)arguments testsToRun:(NSSet *)testsToRun testsToSkip:(NSSet *)testsToSkip testTimeout:(NSNumber *)testTimeout reportActivities:(BOOL)reportActivities reportAttachments:(BOOL)reportAttachments coverageRequest:(FBCodeCoverageRequest *)coverageRequest collectLogs:(BOOL)collectLogs waitForDebugger:(BOOL)waitForDebugger collectResultBundle:(BOOL)collectResultBundle { + return [[FBXCTestRunRequest_AppTest alloc] initWithTestPath:testPath testHostAppBundleID:testHostAppBundleID testTargetAppBundleID:nil environment:environment arguments:arguments testsToRun:testsToRun testsToSkip:testsToSkip testTimeout:testTimeout reportActivities:reportActivities reportAttachments:reportAttachments coverageRequest:coverageRequest collectLogs:collectLogs waitForDebugger:waitForDebugger collectResultBundle:collectResultBundle]; +} + + (instancetype)uiTestWithTestBundleID:(NSString *)testBundleID testHostAppBundleID:(NSString *)testHostAppBundleID testTargetAppBundleID:(NSString *)testTargetAppBundleID environment:(NSDictionary *)environment arguments:(NSArray *)arguments testsToRun:(NSSet *)testsToRun testsToSkip:(NSSet *)testsToSkip testTimeout:(NSNumber *)testTimeout reportActivities:(BOOL)reportActivities reportAttachments:(BOOL)reportAttachments coverageRequest:(FBCodeCoverageRequest *)coverageRequest collectLogs:(BOOL)collectLogs collectResultBundle:(BOOL)collectResultBundle { return [[FBXCTestRunRequest_UITest alloc] initWithTestBundleID:testBundleID testHostAppBundleID:testHostAppBundleID testTargetAppBundleID:testTargetAppBundleID environment:environment arguments:arguments testsToRun:testsToRun testsToSkip:testsToSkip testTimeout:testTimeout reportActivities:reportActivities reportAttachments:reportAttachments coverageRequest:coverageRequest collectLogs:collectLogs waitForDebugger:NO collectResultBundle:collectResultBundle]; } ++ (instancetype)uiTestWithTestPath:(NSURL *)testPath testHostAppBundleID:(NSString *)testHostAppBundleID testTargetAppBundleID:(NSString *)testTargetAppBundleID environment:(NSDictionary *)environment arguments:(NSArray *)arguments testsToRun:(NSSet *)testsToRun testsToSkip:(NSSet *)testsToSkip testTimeout:(NSNumber *)testTimeout reportActivities:(BOOL)reportActivities reportAttachments:(BOOL)reportAttachments coverageRequest:(FBCodeCoverageRequest *)coverageRequest collectLogs:(BOOL)collectLogs collectResultBundle:(BOOL)collectResultBundle +{ + return [[FBXCTestRunRequest_UITest alloc] initWithTestPath:testPath testHostAppBundleID:testHostAppBundleID testTargetAppBundleID:testTargetAppBundleID environment:environment arguments:arguments testsToRun:testsToRun testsToSkip:testsToSkip testTimeout:testTimeout reportActivities:reportActivities reportAttachments:reportAttachments coverageRequest:coverageRequest collectLogs:collectLogs waitForDebugger:NO collectResultBundle:collectResultBundle]; +} + - (instancetype)initWithTestBundleID:(NSString *)testBundleID testHostAppBundleID:(NSString *)testHostAppBundleID testTargetAppBundleID:(NSString *)testTargetAppBundleID environment:(NSDictionary *)environment arguments:(NSArray *)arguments testsToRun:(NSSet *)testsToRun testsToSkip:(NSSet *)testsToSkip testTimeout:(NSNumber *)testTimeout reportActivities:(BOOL)reportActivities reportAttachments:(BOOL)reportAttachments coverageRequest:(FBCodeCoverageRequest *)coverageRequest collectLogs:(BOOL)collectLogs waitForDebugger:(BOOL)waitForDebugger collectResultBundle:(BOOL)collectResultBundle { self = [super init];