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

Ability to use fs.chmodSync on the recorded file for #26

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
7 changes: 7 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,13 @@ 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. For example:

```
chmod: '755' or chmod: '0755'
```


* `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