diff --git a/README.md b/README.md index c08f2ca9..c1cd8b46 100644 --- a/README.md +++ b/README.md @@ -87,6 +87,7 @@ A full list supported options are listed here. | runner-app-path | -u | The test runner for UI tests. | N | n/a | | screenshots-directory | n/a | Directory where simulator screenshots for failed ui tests will be stored. | N | n/a | | videos-directory | n/a | Directory where videos of test runs will be saved. If not provided, videos are not recorded. | N | n/a | +| keep-passing-videos | n/a | Whether to keep the recorded video for passing tests. Deleted by default. | N | false | | video-paths | -V | A list of videos that will be saved in the simulators. | N | n/a | | image-paths | -I | A list of images that will be saved in the simulators. | N | n/a | | unsafe-skip-xcode-version-check | | Skip Xcode version check | N | NO | diff --git a/bluepill/tests/BPIntegrationTests.m b/bluepill/tests/BPIntegrationTests.m index dc01d5d6..84dbe4d2 100644 --- a/bluepill/tests/BPIntegrationTests.m +++ b/bluepill/tests/BPIntegrationTests.m @@ -38,6 +38,7 @@ - (BPConfiguration *)generateConfigWithVideoDir:(NSString *)videoDir { config.quiet = [BPUtils isBuildScript]; if (videoDir != nil) { config.videosDirectory = videoDir; + config.keepPassingVideos = true; } return config; } diff --git a/bp/src/BPConfiguration.h b/bp/src/BPConfiguration.h index 1215844c..3e845ab9 100644 --- a/bp/src/BPConfiguration.h +++ b/bp/src/BPConfiguration.h @@ -88,6 +88,7 @@ typedef NS_ENUM(NSInteger, BPProgram) { @property (nonatomic, strong) NSString *testTimeEstimatesJsonFile; @property (nonatomic, strong) NSString *screenshotsDirectory; @property (nonatomic, strong) NSString *videosDirectory; +@property (nonatomic) BOOL keepPassingVideos; @property (nonatomic, strong) NSString *simulatorPreferencesFile; @property (nonatomic, strong) NSString *scriptFilePath; @property (nonatomic) BOOL headlessMode; diff --git a/bp/src/BPConfiguration.m b/bp/src/BPConfiguration.m index ef68a4c8..92c02ae8 100644 --- a/bp/src/BPConfiguration.m +++ b/bp/src/BPConfiguration.m @@ -148,6 +148,8 @@ typedef NS_OPTIONS(NSUInteger, BPOptionType) { "Retry the tests after an app crash and if it passes on retry, consider them non-fatal."}, {367, "videos-directory", BLUEPILL_BINARY | BP_BINARY, NO, NO, required_argument, NULL, BP_VALUE | BP_PATH, "videosDirectory", "Directory where videos of test runs will be saved. If not provided, videos are not recorded."}, + {368, "keep-passing-videos", BLUEPILL_BINARY | BP_BINARY, NO, NO, no_argument, "Off", BP_VALUE | BP_BOOL, "keepPassingVideos", + "Whether recorded videos should be kept if the test passed. They are deleted by default."}, {0, 0, 0, 0, 0, 0, 0} }; diff --git a/bp/src/BPTMDRunnerConnection.m b/bp/src/BPTMDRunnerConnection.m index fd04c328..978c6720 100644 --- a/bp/src/BPTMDRunnerConnection.m +++ b/bp/src/BPTMDRunnerConnection.m @@ -52,7 +52,7 @@ @interface BPTMDRunnerConnection()