@@ -1153,6 +1153,28 @@ - (void)testActionOptionMultipleAppTests
1153
1153
}];
1154
1154
}
1155
1155
1156
+ - (void )testActionOptionUITest
1157
+ {
1158
+ [[FakeTaskManager sharedManager ] runBlockWithFakeTasks: ^{
1159
+ Options *options = [[Options optionsFrom:
1160
+ @[
1161
+ @" -sdk" , @" macosx10.7" ,
1162
+ @" run-tests" ,
1163
+ @" -uiTest" ,
1164
+ TEST_DATA @" TestProject-UITests/Build/Products/Debug-iphonesimulator/TestProject-UITestsUITests-Runner.app/PlugIns/TestProject-UITestsUITests.xctest:"
1165
+ TEST_DATA @" TestProject-UITests/Build/Products/Debug-iphonesimulator/TestProject-UITestsUITests-Runner.app/TestProject-UITestsUITests-Runner:"
1166
+ TEST_DATA @" TestProject-UITests/Build/Products/Debug-iphonesimulator/TestProject-UITests.app/TestProject-UITests"
1167
+ ]] assertOptionsValidate ];
1168
+ RunTestsAction *action = options.actions [0 ];
1169
+ RunTestsActionUITest *config =
1170
+ [[RunTestsActionUITest alloc ] initWithHostApp: TEST_DATA @" TestProject-UITests/Build/Products/Debug-iphonesimulator/TestProject-UITests.app/TestProject-UITests"
1171
+ runnerApp: TEST_DATA @" TestProject-UITests/Build/Products/Debug-iphonesimulator/TestProject-UITestsUITests-Runner.app/TestProject-UITestsUITests-Runner" ];
1172
+ assertThat (action.uiTests , equalTo (
1173
+ @{TEST_DATA @" TestProject-UITests/Build/Products/Debug-iphonesimulator/TestProject-UITestsUITests-Runner.app/PlugIns/TestProject-UITestsUITests.xctest" : config,
1174
+ }));
1175
+ }];
1176
+ }
1177
+
1156
1178
- (void )testActionOptionMixedLogicAndAppTests
1157
1179
{
1158
1180
[[FakeTaskManager sharedManager ] runBlockWithFakeTasks: ^{
@@ -1210,7 +1232,7 @@ - (void)testWillComplainWhenPassingAppTestThatDoesntExist
1210
1232
@" -appTest" , TEST_DATA @" path/to/this-does-not-exist.xctest:path/to/HostApp.app/HostApp" ,
1211
1233
]]
1212
1234
assertOptionsFailToValidateWithError:
1213
- @" run-tests: Application test at path '" TEST_DATA @" path/to/this-does-not-exist.xctest' does not exist or is not a directory " ];
1235
+ @" run-tests: option -appTest has invalid argument: path '" TEST_DATA @" path/to/this-does-not-exist.xctest' doesn't exist" ];
1214
1236
1215
1237
}];
1216
1238
}
@@ -1225,8 +1247,51 @@ - (void)testWillComplainWhenPassingHostAppBinaryThatDoesntExist
1225
1247
TEST_DATA @" path/to/NonExistentHostApp.app/HostApp" ,
1226
1248
]]
1227
1249
assertOptionsFailToValidateWithError:
1228
- @" run-tests: Application test host binary at path '" TEST_DATA " path/to/NonExistentHostApp.app/HostApp' does not exist or is not a file" ];
1250
+ @" run-tests: option -appTest has invalid argument: path '" TEST_DATA " path/to/NonExistentHostApp.app/HostApp' doesn't exist" ];
1251
+
1252
+ }];
1253
+ }
1254
+
1255
+ - (void )testWillComplainWhenPassingUITestBundleThatDoesntExist
1256
+ {
1257
+ [[FakeTaskManager sharedManager ] runBlockWithFakeTasks: ^{
1258
+ [[Options optionsFrom:
1259
+ @[@" -sdk" , @" iphonesimulator" ,
1260
+ @" run-tests" ,
1261
+ @" -uiTest" ,
1262
+ TEST_DATA @" TestProject-UITests/Build/Products/Debug-iphonesimulator/TestProject-UITestsUITests-Runner.app/PlugIns/TestProject-UITestsUITestsFAKE.xctest:"
1263
+ TEST_DATA @" TestProject-UITests/Build/Products/Debug-iphonesimulator/TestProject-UITestsUITests-Runner.app/TestProject-UITestsUITests-Runner:"
1264
+ TEST_DATA @" TestProject-UITests/Build/Products/Debug-iphonesimulator/TestProject-UITests.app/TestProject-UITests" ]]
1265
+ assertOptionsFailToValidateWithError:
1266
+ @" run-tests: option -uiTest has invalid argument: path '" TEST_DATA @" TestProject-UITests/Build/Products/Debug-iphonesimulator/TestProject-UITestsUITests-Runner.app/PlugIns/TestProject-UITestsUITestsFAKE.xctest' doesn't exist" ];
1267
+ }];
1268
+ }
1269
+
1270
+ - (void )testWillComplainWhenPassingUITestRunnerAppThatDoesntExist {
1271
+ [[FakeTaskManager sharedManager ] runBlockWithFakeTasks: ^{
1272
+ [[Options optionsFrom:
1273
+ @[@" -sdk" , @" iphonesimulator" ,
1274
+ @" run-tests" ,
1275
+ @" -uiTest" ,
1276
+ TEST_DATA @" TestProject-UITests/Build/Products/Debug-iphonesimulator/TestProject-UITestsUITests-Runner.app/PlugIns/TestProject-UITestsUITests.xctest:"
1277
+ TEST_DATA @" TestProject-UITests/Build/Products/Debug-iphonesimulator/TestProject-UITestsUITests-Runner.app/TestProject-UITestsUITests-RunnerFAKE:"
1278
+ TEST_DATA @" TestProject-UITests/Build/Products/Debug-iphonesimulator/TestProject-UITests.app/TestProject-UITests" ]]
1279
+ assertOptionsFailToValidateWithError:
1280
+ @" run-tests: option -uiTest has invalid argument: path '" TEST_DATA @" TestProject-UITests/Build/Products/Debug-iphonesimulator/TestProject-UITestsUITests-Runner.app/TestProject-UITestsUITests-RunnerFAKE' doesn't exist" ];
1281
+ }];
1282
+ }
1229
1283
1284
+ - (void )testWillComplainWhenPassingUITestHostAppThatDoesntExist {
1285
+ [[FakeTaskManager sharedManager ] runBlockWithFakeTasks: ^{
1286
+ [[Options optionsFrom:
1287
+ @[@" -sdk" , @" iphonesimulator" ,
1288
+ @" run-tests" ,
1289
+ @" -uiTest" ,
1290
+ TEST_DATA @" TestProject-UITests/Build/Products/Debug-iphonesimulator/TestProject-UITestsUITests-Runner.app/PlugIns/TestProject-UITestsUITests.xctest:"
1291
+ TEST_DATA @" TestProject-UITests/Build/Products/Debug-iphonesimulator/TestProject-UITestsUITests-Runner.app/TestProject-UITestsUITests-Runner:"
1292
+ TEST_DATA @" TestProject-UITests/Build/Products/Debug-iphonesimulator/TestProject-UITests.app/TestProject-UITestsFAKE" ]]
1293
+ assertOptionsFailToValidateWithError:
1294
+ @" run-tests: option -uiTest has invalid argument: path '" TEST_DATA @" TestProject-UITests/Build/Products/Debug-iphonesimulator/TestProject-UITests.app/TestProject-UITestsFAKE' doesn't exist" ];
1230
1295
}];
1231
1296
}
1232
1297
@@ -1247,6 +1312,26 @@ - (void)testWillComplainWhenPassingSameLogicTestForMultipleTestHostApps
1247
1312
}];
1248
1313
}
1249
1314
1315
+ - (void )testWillComplainWhenPassingSameLogicTestForMultipleUITests
1316
+ {
1317
+ [[FakeTaskManager sharedManager ] runBlockWithFakeTasks: ^{
1318
+ [[Options optionsFrom:
1319
+ @[@" -sdk" , @" iphonesimulator" ,
1320
+ @" run-tests" ,
1321
+ @" -uiTest" ,
1322
+ TEST_DATA @" TestProject-UITests/Build/Products/Debug-iphonesimulator/TestProject-UITestsUITests-Runner.app/PlugIns/TestProject-UITestsUITests.xctest:"
1323
+ TEST_DATA @" TestProject-UITests/Build/Products/Debug-iphonesimulator/TestProject-UITestsUITests-Runner.app/TestProject-UITestsUITests-Runner:"
1324
+ TEST_DATA @" TestProject-UITests/Build/Products/Debug-iphonesimulator/TestProject-UITests.app/TestProject-UITests" ,
1325
+ @" -uiTest" ,
1326
+ TEST_DATA @" TestProject-UITests/Build/Products/Debug-iphonesimulator/TestProject-UITestsUITests-Runner.app/PlugIns/TestProject-UITestsUITests.xctest:"
1327
+ TEST_DATA @" TestProject-UITests/Build/Products/Debug-iphonesimulator/TestProject-UITestsUITests-Runner.app/TestProject-UITestsUITests-Runner:"
1328
+ TEST_DATA @" TestProject-UITests/Build/Products/Debug-iphonesimulator/TestProject-UITests.app/TestProject-UITests" ,
1329
+ ]]
1330
+ assertOptionsFailToValidateWithError:
1331
+ @" run-tests: The same test bundle '" TEST_DATA @" TestProject-UITests/Build/Products/Debug-iphonesimulator/TestProject-UITestsUITests-Runner.app/PlugIns/TestProject-UITestsUITests.xctest' cannot have more than one test configuration of host app and runner" ];
1332
+ }];
1333
+ }
1334
+
1250
1335
- (void )testPassingLogicTestViaCommandLine
1251
1336
{
1252
1337
[[FakeTaskManager sharedManager ] runBlockWithFakeTasks: ^{
0 commit comments