npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

protractor-video-reporter

v0.3.0

Published

A jasmine2 reporter to capture a video screen cast of Protractor specs run with xvfb

Downloads

19,557

Readme

protractor-video-reporter

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 under the baseDirectory. The exact location is determined by singleVideoPath.

  • singleVideoPath: (string, function):

When uuid (default): Each spec video file will be placed 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.

When fullName: Each spec video will be placed at baseDirectory/{spec full name} - {spec status}.mov. The full name of the spec will be sanitized to be a valid file name

If you want to determine the full name yourself you can pass a function. The function recieves a single argument, the result object passed to specStarted. For example, you can do:

singleVideoPath: function (result) {
    // don't actually do this, you need to make sure fullName is a valid file name
    result.fullName + '.mov';
}
  • 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',
        ]

Debugging

If you encouter any issues with the reporter, e.g. video files are not created, turn on debugging by settings the DEBUG environment to protractor-video-reporter.