在无头模式下将Xvfb与ffmpeg一起使用时看到空白视频

时间:2019-03-29 18:09:56

标签: ffmpeg protractor google-chrome-headless xvfb

使用Xvfb,ffmpeg,量角器视频报告器以无头模式运行量角器测试时看到空白视频

我正在使用量角器框架来运行自动化测试。我正在使用量角器录像机工具以无头模式录制视频。前提条件是在后台启动Xvfb。

这是我用来在无头模式下运行测试的设置。 启用无头模式视频的步骤如下:

Installed "npm i protractor-video-reporter"
Included ffmpeg setting for docker/linux.
```
 var VideoReporter = require('protractor-video-reporter');
 jasmine.getEnv().addReporter(new VideoReporter({
    baseDirectory: 'reports/videos',
    singleVideo: false,
    saveSuccessVideos: true,
    ffmpegCmd: '/usr/bin/ffmpeg',
    ffmpegArgs: [
      '-y',
      '-r', '30',
      '-f', 'x11grab',
      '-s', '1280x1024',
      '-i', 'process.env.DISPLAY',
      '-g', '300',
      '-vcodec', 'mpeg4'
    ]
  }));
    Executed "Xvfb :99 -ac -screen 5 1024x768x8 -listen tcp &" in a terminal
    Executed ```
       DISPLAY=:99  
       export $DISPLAY
``` in a separate window 
    Executed "env DEBUG=protractor-video-reporter protractor conf.js" in a separate terminal

Expected Result:

A video with the recordings that runs tests on google chrome

Actual Result:

Video is getting created but the video appears to be blank.

Chrome Version:73
Chromedriver Version: 2.46
Protractor version:5.4.2

0 个答案:

没有答案