diff --git a/lib/VideoReporter.js b/lib/VideoReporter.js index b68e9a3..4f2cb0b 100644 --- a/lib/VideoReporter.js +++ b/lib/VideoReporter.js @@ -27,6 +27,7 @@ function VideoReporter(options) { singleVideo: true, singleVideoPath: 'uuid', createSubtitles: true, + chmod: 'none', ffmpegCmd: 'ffmpeg', ffmpegArgs: [ '-y', @@ -53,7 +54,8 @@ function VideoReporter(options) { ), createSubtitles: Joi.boolean() .description('If true and singleVideo is also true, will create a SRT subtitles file with the name details of the currently running spec.'), - + chmod: Joi.string() + .description('Chmod to set after each saved video, e.g. "755"'), ffmpegCmd: Joi.string() .description('The command used to execute ffmpeg, e.g. /usr/bin/ffmpeg.'), ffmpegArgs: Joi.array().items(Joi.string(), Joi.number()) @@ -120,6 +122,10 @@ VideoReporter.prototype._stopScreencast = function(removeVideo) { case 'no': debug('Keeping the video'); console.log('Spec video is in: ' + self._videoPath); + if (self.options.chmod !== 'none') { + debug('Setting chmod settings for file'); + Fs.chmodSync(self._videoPath, self.options.chmod); + } break; } diff --git a/readme.md b/readme.md index 88809fb..aca0d5e 100644 --- a/readme.md +++ b/readme.md @@ -59,6 +59,8 @@ For example, you can do: * `createSubtitles` (bool): If `true` and singleVideo is also true, will create a SRT subtitles file with the name details of the currently running spec. Defaults to `true`. The file will be saves to `baseDirectory/protractor-specs.srt`. +* `chmod` (string): Will attempt so set the given chmod on saved video. Defaults to `none` which will use the default permission settings for the file. + * `saveSuccessVideos` (bool): If `true`, will save the videos of the succussfull specs, as well as the failed specs. This has no effect if `singleVideo` is `true` - we'll always capture all the specs then. Defaults to `false`. * `ffmpegCmd` (string): The command used to execute ffmpeg, e.g. `'/usr/bin/ffmpeg'`. Defaults to `'ffmpeg'`.