Skip to content
This repository has been archived by the owner on Dec 22, 2018. It is now read-only.

Commit

Permalink
Ability to use fs.chmodSync on the recorded file for
Browse files Browse the repository at this point in the history
more flexibility with access permission rights
  • Loading branch information
Martin Bergström committed Apr 16, 2018
1 parent 321f3e3 commit f1b89a7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/VideoReporter.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ function VideoReporter(options) {
singleVideo: true,
singleVideoPath: 'uuid',
createSubtitles: true,
chmod: 'none',
ffmpegCmd: 'ffmpeg',
ffmpegArgs: [
'-y',
Expand All @@ -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())
Expand Down Expand Up @@ -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;
}

Expand Down
2 changes: 2 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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'`.
Expand Down

0 comments on commit f1b89a7

Please sign in to comment.