Skip to content
This repository has been archived by the owner on Mar 8, 2023. It is now read-only.

ViljarVoidula/testreel-nightwatch-recoder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Record videos of Nightwatch.js test sessions, support multiple Operative Systems like MacOs, Windows(cooming soon), Linux.

Uses ffmpeg to capture a (remote) webdriver desktop screen.

Install

  npm i nightwatch-record --save

Usage

Add the following beforeEach/afterEach or before/after hooks:

module.exports = {
  beforeEach: function (browser, done) {
    require('testreel-nightwatch-record').start(browser, done);
  },
  afterEach: function (browser, done) {
    require('testreel-nightwatch-record').stop(browser, done);
  }
}

If you are using Mocha test runner, you can use;

  beforeEach(function(browser, done) {
    require('testreel-nightwatch-record').start(browser);
    done();
  });

  afterEach(function (browser, done) {
    const testPassed = this.currentTest.state !== 'failed'; // Fix videoSettings.deleteOnSuccess: true issue with other test runners
    require('testreel-nightwatch-record').stop(browser, done, testPassed);
  });

Enable the video screen recording in your test settings:

{
  "test_settings": {
    "default": {
      "videos": {
        "fileName": "example", // Required field
        "nameAfterTest": true,
        "format": "mp4",
        "enabled": true,
        "deleteOnSuccess": false,
        "path": "",
        "resolution": "1440x900",
        "fps": 15,
        "input": "",
        "videoCodec": "libx264"
      }
    }
  }
}

Original author:

Author

Ignacio Marenco

About

Modified nightwatch-record for specific usage

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published