Giter Club home page Giter Club logo

protractor-video-reporter's Introduction

protractor-video-reporter

This is a fork of https://github.com/tepez/protractor-video-reporter to support video capture on a MAC and other enhancements like automatically naming individual test case video filenames.

A Jasmine 2 reporter that captures a screencast of Protractor specs running on a headless browser, e.g. under Xvfb. This is especially usefull for debugging you e2e specs on you CI server. The reporter also creates a SRT subtitles file to for the video so you can see which spec you are currently viewing and whether it passed or failed.

Install

npm install --save-dev protractor-video-reporter

Prerequisites

You have to start Xvfb before starting Protractor and set the DISPLAY enviroment variable.

If you're using Jenkins CI, you can use the Xvfb plugin to easily achive that.

Usage

In the protractor configuration file:

var VideoReporter = require('protractor-video-reporter');

...

onPrepare: function() {
  ...
  jasmine.getEnv().addReporter(new VideoReporter({
    baseDirectory: Path.join(__dirname, 'reports/videos/')
  }));
}

Options

  • baseDirectory (string): The path to the directory where videos are stored. If not existing, it gets created. Required.

  • singleVideo (bool): If true, will create a single video file for all the specs. Defaults to true. The file will be saved to baseDirectory/protractor-specs.mov. If singleVideo is false, the reporter will create a separate video file for every spec and place it at baseDirectory/{some random UUID}.mov. If you prefer this option, you would have to look at the "Spec video is in: ..." messages that are printed to the console.

  • 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.

  • 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'.

  • ffmpegArgs (array): The argumetns passed to ffmpeg, not including the actual output file which will be appended. Defaults to:

        [
          '-y',
          '-r', '30',
          '-f', 'x11grab',
          '-s', '1024x768',
          '-i', process.env.DISPLAY,
          '-g', '300',
          '-vcodec', 'qtrle',
        ]
    

protractor-video-reporter's People

Contributors

tomyam1 avatar

Watchers

 avatar  avatar

Forkers

amejiarosario

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.