Coder Social home page Coder Social logo

webdriverio-community / wdio-video-reporter Goto Github PK

View Code? Open in Web Editor NEW
57.0 12.0 47.0 4.82 MB

Reporter for WebdriverIO that makes videos of failed tests and has optional allure integration

Home Page: https://webdriver.io/docs/wdio-video-reporter

License: MIT License

JavaScript 4.31% TypeScript 95.69%
wdio allure wdio-reporter wdio-video-reporter video

wdio-video-reporter's Introduction

WebdriverIO Video Reporter test MIT license

Create a video screen capture of your tests and enhanced your Allure reporting easily!

This is a WebdriverIO reporter that generates videos of your test executions. If you use it in combination with the Allure Reporter, then the test cases automatically get decorated with the videos as well (see example project).

As this reporter is using the saveScreenshot command to render the video it supports all environments including mobile environments.

That said, taking a screenshot after almost every command can slow down your tests. Also, note that the videos don't include alert-boxes and popups.

Installation

First, install the reporter:

npm install --save-dev wdio-video-reporter

or

yarn add --dev wdio-video-reporter

Then add the reporter to your configuration:

 reporters: [
    ['video', {
      saveAllVideos: false,       // If true, also saves videos for successful test cases
      videoSlowdownMultiplier: 3, // Higher to get slower videos, lower for faster videos [Value 1-100]
    }],
  ],

Usage

Adding the Allure reporter as well automatically updates the reports with videos without any need to configure anything :-)

 reporters: [
    ['video', {
      saveAllVideos: false,       // If true, also saves videos for successful test cases
      videoSlowdownMultiplier: 3, // Higher to get slower videos, lower for faster videos [Value 1-100]
    }],
    ['allure', {
      outputDir: './_results_/allure-raw',
      disableWebdriverStepsReporting: true,
      disableWebdriverScreenshotsReporting: true,
    }],
  ],

Adding the html nice reporter automatically updates the reports with videos without any need to configure anything ๐Ÿ™‚

 reporters: [
    ['video', {
      saveAllVideos: false,       // If true, also saves videos for successful test cases
      videoSlowdownMultiplier: 3, // Higher to get slower videos, lower for faster videos [Value 1-100]
      outputDir: './reports/html-reports/',
    }],
    ['html-nice', {
          outputDir: './reports/html-reports/',
          filename: 'report.html',
          reportTitle: 'Test Report Title',
          linkScreenshots: true,
          //to show the report in a browser when done
          showInBrowser: true,
          collapseTests: false,
          //to turn on screenshots after every test must be false to use video
          useOnAfterCommandForScreenshot: false,
    }],
  ],

Configuration

Most users may want to set these configurations:

saveAllVideos

Set to true to save videos for passing tests.

Type: boolean
Default: false

rawPath

Where to save the screenshots for the video.

Type: string
Default: .video-reporter-screenshots

filenamePrefixSource

Prefix for video filenames by either suite or test name. When using cucumber it will always be suite.

Type: 'suite' | 'test'
Default: test

videoSlowdownMultiplier

Integer between [1-100]. Increase if videos are playing to quick.

Type: number
Default: 3

videoScale

Scaling of video. See https://trac.ffmpeg.org/wiki/Scaling.

Type: string
Default: '1200:trunc(ow/a/2)*2'

videoRenderTimeout

Maximum time to wait for a video to finish rendering (in ms).

Type: number
Default: 5000

outputDir

If it's not set, it uses outputDir.

Type: string

maxTestNameCharacters

Max length of test name.

Type: number
Default: 250

snapshotCommands

Which commands should result in a screenshot (without: /session/:sessionId/).

Type: string[]
Default: ['url', 'forward', 'back', 'refresh', 'execute', 'size', 'position', 'maximize', 'click', 'submit', 'value', 'keys', 'clear', 'selected', 'enabled', 'displayed', 'orientation', 'alert_text', 'accept_alert', 'dismiss_alert', 'moveto', 'buttondown', 'buttonup', 'doubleclick', 'down', 'up', 'move', 'scroll', 'doubleclick', 'longclick', 'flick', 'location']

excludedActions

Add actions where screenshots are unnecessary.

Type: string[]
Default: []

recordAllActions

Skip filtering and screenshot everything. (Not recommended)

Type: boolean
Default: false

screenshotIntervalSecs

Force a screenshot at this interval (minimum 0.5s).

Type: number

videoFormat

Video format (container) to be used. Supported formats: mp4, webm.

Type: string
Default: webm

onlyRecordLastFailure

Only record the last failure when specFileRetries is > 0

Type: boolean
Default: false

Cucumber Support

If you are using the Allure reporter with Cucumber, add useCucumberStepReporter: true to Allure option in wdio.conf.js file, a typical configuration would look like this:

  reporters: [
    ['video', {
      saveAllVideos: false,       // If true, also saves videos for successful test cases
      videoSlowdownMultiplier: 3, // Higher to get slower videos, lower for faster videos [Value 1-100]
    }],
    ['allure', {
      outputDir: './_results_/allure-raw',
      disableWebdriverStepsReporting: true,
      disableWebdriverScreenshotsReporting: true,
      useCucumberStepReporter: true
    }],
  ],

For a complete example, check out the cucumber branch at the wdio-template

Appium Support

Since wdio-video-reporter v1.2.4 there is support to help Allure differentiate between safari and chrome browsers on desktop and devices. The reporter uses the custom property appium:deviceType to id the different devices. Recommended values are phone and tablet. It is recommended to include browserVersion as well for all browsers to avoid a bug in Chrome webdriver when using devices in same Selenium grid as desktop Chrome browsers.

The generated video files will also get appium:deviceType added to the browser name.

Example Appium configuration:

  "capabilities": [
    {
      ...
      "deviceType": "phone",
      "browserVersion": "73.0-phone-1",
      ...
    }
  ],

And wdio.conf.js:

  capabilities: [
    {
      ...
      'appium:deviceType': 'phone',
      'browserVersion': '73.0-phone-1',
      ...
    },
  ],

Example

Check out the simple template at wdio-template to quickly get up to speed.

Clone one of the repositories and install dependencies with yarn or npm install. Then run yarn e2e or npm run e2e in demo directory and finally yarn report or npm run report to see Allure report.

Contributing

Fork, make changes, write some tests, lint, run tests, build, and verify in the demo that changes work as they should, then make a PR.

The demo folder works with the built version of the library, so make sure to build if you added new features and want to try them out.

Thanks

Thanks to Johnson E for fixing Cucumber support which a lot of users have asked for.

wdio-video-reporter's People

Contributors

ajitesh11 avatar brunoargolo avatar christian-bromann avatar dependabot[bot] avatar erwinheitzman avatar grant-mccarriagher avatar hiqqs avatar imajithkv avatar joaquimds avatar jonn-set avatar kerkeniakov avatar mbikola avatar merugajs avatar presidenten avatar pwespi avatar rpii avatar saranyaeaswaran avatar sdlarmo avatar seanpoulter avatar sovoid avatar tadashi0713 avatar wadjei avatar wdio-bot avatar willbrock avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

wdio-video-reporter's Issues

Type DSL is missing

Describe the bug
webdriverio can load config file as typescript. (see https://webdriver.io/docs/typescript.html)
But wdio-video-reporter has no type DSL, so we cannot import like this in a typescript file.

import * as video from 'wdio-video-reporter';

To Reproduce
See https://webdriver.io/docs/typescript.html#typed-configuration.

Expected behavior
'wdio-video-reporter' can be used in typescript files.

Environment (please complete the following information):

  • **wdio-video-reporter version: 1.4.3
  • **WebdriverIO version:5.10.1
  • **Typescript: 5.17.0
  • **Node.js version: v10.11.0
  • **NPM version: 6.9.0

The latest screenshots do not fall within the ffmpeg video.

When I'm using wdio-video-reporter library, the latest two screenshots do not fall within the ffmpeg video.
BTW all screenshots are saved at the results folder but there are no two latest in the ffmpeg video.

Log
The log is empty after I set wdio.config.logLevel = 'debug'.. But, please see the following log from my test result:

[0-0] PASSED in chrome - /src/test/Welcome.test.js
2020-04-06T10:20:45.942Z INFO @wdio/cli:launcher: Run onComplete hook
 "Video" Reporter:
Using reporter config:[
  [
    null,
    {
      "saveAllVideos": true,
      "videoSlowdownMultiplier": 3
    }
  ],
  [
    "allure",
    {
      "outputDir": "./allure-results",
      "disableWebdriverStepsReporting": true,
      "disableWebdriverScreenshotsReporting": true,
      "disableMochaHooks": true
    }
  ]
]
Using config:{
  "debugMode": true,
  "logLevel": "info",
  "videoRenderTimeout": 5,
  "outputDir": "_results_",
  "allureOutputDir": "/Users/maks-pc/IdeaProjects/Oji/ui-tests/allure-results",
  "rawPath": "rawSeleniumVideoGrabs",
  "usingAllure": true,
  "saveAllVideos": true,
  "videoSlowdownMultiplier": 3,
  "excludedActions": [],
  "jsonWireActions": [
    "url",
    "forward",
    "back",
    "refresh",
    "execute",
    "size",
    "position",
    "maximize",
    "click",
    "submit",
    "value",
    "keys",
    "clear",
    "selected",
    "enabled",
    "displayed",
    "orientation",
    "alert_text",
    "accept_alert",
    "dismiss_alert",
    "moveto",
    "buttondown",
    "buttonup",
    "doubleclick",
    "down",
    "up",
    "move",
    "scroll",
    "doubleclick",
    "longclick",
    "flick",
    "location"
  ]
}
--- New suite: LoginTests ---
--- New test: userShouldBeLogin ---
Incomming command: /session/:sessionId/url => [url]
- Screenshot!!
Incomming command: /session/:sessionId/screenshot => [screenshot]
Incomming command: /session/:sessionId/element => [element]
Incomming command: /session/:sessionId/element/0.7028752295507747-1/clear => [clear]
- Screenshot!!
Incomming command: /session/:sessionId/screenshot => [screenshot]
Incomming command: /session/:sessionId/element/0.7028752295507747-1/value => [value]
- Screenshot!!
Incomming command: /session/:sessionId/screenshot => [screenshot]
Incomming command: /session/:sessionId/element => [element]
Incomming command: /session/:sessionId/element/0.7028752295507747-2/clear => [clear]
- Screenshot!!
Incomming command: /session/:sessionId/screenshot => [screenshot]
Incomming command: /session/:sessionId/element/0.7028752295507747-2/value => [value]
- Screenshot!!
Incomming command: /session/:sessionId/screenshot => [screenshot]
Incomming command: /session/:sessionId/element => [element]
Incomming command: /session/:sessionId/element/0.7028752295507747-3/click => [click]
- Screenshot!!
Incomming command: /session/:sessionId/screenshot => [screenshot]
Incomming command: /session/:sessionId/element => [element]
Incomming command: /session/:sessionId/elements => [elements]
Incomming command: /session/:sessionId/elements => [elements]
Incomming command: /session/:sessionId/elements => [elements]
Incomming command: /session/:sessionId/element => [element]
Incomming command: /session/:sessionId/element/0.7028752295507747-4/click => [click]
- Screenshot!!
Incomming command: /session/:sessionId/screenshot => [screenshot]
Incomming command: /session/:sessionId/element => [element]
Incomming command: /session/:sessionId/element/0.7028752295507747-5/click => [click]
- Screenshot!!
- Screenshot!!
ffmpeg command: "/Users/maks-pc/IdeaProjects/Oji/ui-tests/node_modules/@ffmpeg-installer/darwin-x64/ffmpeg" -y,-r,10,-i,"/Users/maks-pc/IdeaProjects/Oji/ui-tests/_results_/rawSeleniumVideoGrabs/LoginTests--userShouldBeLogin--CHROME--04-06-2020--13-20-38-604/%04d.png",-vcodec,libx264,-crf,32,-pix_fmt,yuv420p,-vf,"scale=1200:trunc(ow/a/2)*2","setpts=3.0*PTS","/Users/maks-pc/IdeaProjects/Oji/ui-tests/_results_/LoginTests--userShouldBeLogin--CHROME--04-06-2020--13-20-38-604.mp4"
Incomming command: /session/:sessionId/screenshot => [screenshot]
Incomming command: /session/:sessionId/screenshot => [screenshot]
Incomming command: /session/:sessionId => [:sessionId]
--- FFMPEG is done ---
Generated:[
  "/Users/maks-pc/IdeaProjects/Oji/ui-tests/_results_/LoginTests--userShouldBeLogin--CHROME--04-06-2020--13-20-38-604.mp4"
]
Video reporter Done!
Spec Files:      1 passed, 1 total (100% completed) in 00:00:09 
2020-04-06T10:20:45.946Z INFO @wdio/local-runner: Shutting down spawned worker
2020-04-06T10:20:46.200Z INFO @wdio/local-runner: Waiting for 0 to shut down gracefully
2020-04-06T10:20:46.201Z INFO @wdio/local-runner: shutting down

Expected behavior
The latest screenshots should be added to the video.

Environment:

  • wdio-video-reporter version: [2.0.0]
  • WebdriverIO version: [5.7.15]
  • Mode: [WDIO Testrunner]
  • If WDIO Testrunner, running sync/async: [sync]
  • Node.js version: [10.12.0]
  • NPM version: [6.4.1]
  • Browser name and version: [Chrome 71]
  • Platform name and version: [MacOs Catalina]

Desktop:

  • OS: [MacOs 10.15.4]
  • Browser [chrome]
  • Version [80.0.3987.149]

I see that the ffmpeg command is executed before the two latest screenshots...

Video is not generated onWindows10 and Windows Server.

Describe the bug
On macOs video is generated but on Windows 10 and Windows Server is not.

Log
Using reporter config:[
"spec",
[
null,
{
"saveAllVideos": true,
"videoSlowdownMultiplier": 5,
"videoRenderTimeout": 10
}
],
[
"allure",
{
"outputDir": "reports/allure-results_310",
"disableWebdriverStepsReporting": true,
"disableWebdriverScreenshotsReporting": true
}
],
[
"junit",
{
"outputDir": "reports/junit_310"
}
]
]

Using config:{
"debugMode": false,
"logLevel": "info",
"videoRenderTimeout": 10,
"outputDir": "reports",
"allureOutputDir": "C:\Projects\komplett.payments\Tests\Komplett.Payments.UI.Tests\reports\allure-results_310",
"rawPath": "rawSeleniumVideoGrabs",
"usingAllure": true,
"saveAllVideos": true,
"videoSlowdownMultiplier": 5,
"excludedActions": [],
"jsonWireActions": [
"url",
"forward",
"back",
"refresh",
"execute",
"size",
"position",
"maximize",
"click",
"submit",
"value",
"keys",
"clear",
"selected",
"enabled",
"displayed",
"orientation",
"alert_text",
"accept_alert",
"dismiss_alert",
"moveto",
"buttondown",
"buttonup",
"doubleclick",
"down",
"up",
"move",
"scroll",
"doubleclick",
"longclick",
"flick",
"location"
]
}

Max waiting time: 10s

--- Video C:\Projects\komplett.payments\Tests\Komplett.Payments.UI.Tests\reports\Update-B2B-recipient-shipping-address---Your-user-name-is-Auto-B2B-fsdfsdfsfsfsdfsf-and-your-pass-is-fsdfgsfgsgsgsg---Cancel-up--ile-page---C9468-should-click-on-Edit-recipient-button-and-cancel-update-shipping-address---CHROME--07-18-2019--14-05-09-882.mp4 ---
Waiting for video to exist: 0s
Waiting for video to exist: 1s
Waiting for video to exist: 2s
Waiting for video to exist: 3s
Waiting for video to exist: 4s
Waiting for video to exist: 5s
Waiting for video to exist: 6s
Waiting for video to exist: 7s
Waiting for video to exist: 8s
Waiting for video to exist: 9s
Waiting for video to exist: 10s

--- Video C:\Projects\komplett.payments\Tests\Komplett.Payments.UI.Tests\reports\Update-B2B-recipient-shipping-address---Your-user-name-is-dhagdfjhdsfjsfjjhsfsj-and-your-pass-is-adafafaf---Cancel-up--t-button-and-change-shipping-address-and-phone-number-and-not-update-data-on-profile-page---CHROME--07-18-2019--14-05-11-962.mp4 ---
Waiting for video to exist: 0s
Waiting for video to exist: 1s
Waiting for video to exist: 2s
Waiting for video to exist: 3s
Waiting for video to exist: 4s
Waiting for video to exist: 5s
Waiting for video to exist: 6s
Waiting for video to exist: 7s
Waiting for video to exist: 8s
Waiting for video to exist: 9s
Waiting for video to exist: 10s

--- Video C:\Projects\komplett.payments\Tests\Komplett.Payments.UI.Tests\reports\Update-B2B-recipient-shipping-address---Your-user-name-is-Auto-B2B-blalskalakjddd-no-and-your-pass-is-asdhjahdjad---Cancel-up--not-update-shipping-address-on-my-profile-page---C9470-Should-Click-pay-and-finish-button---CHROME--07-18-2019--14-05-25-013.mp4 ---
Waiting for video to exist: 0s
Waiting for video to exist: 1s
Waiting for video to exist: 2s
Waiting for video to exist: 3s
Waiting for video to exist: 4s
Waiting for video to exist: 5s
Waiting for video to exist: 6s
Waiting for video to exist: 7s
Waiting for video to exist: 8s
Waiting for video to exist: 9s
Waiting for video to exist: 10s

--- Video C:\Projects\komplett.payments\Tests\Komplett.Payments.UI.Tests\reports\Update-B2B-recipient-shipping-address---Your-user-name-is-Auto-B2B-fgshgfshfhsgfhs-and-your-pass-is-blalala---Cancel-up--profile-page---C9471-Shipping-address-and-phone-number-should-not-changed-on-profile-page---CHROME--07-18-2019--14-05-36-853.mp4 ---
Waiting for video to exist: 0s
Waiting for video to exist: 1s
Waiting for video to exist: 2s
Waiting for video to exist: 3s
Waiting for video to exist: 4s
Waiting for video to exist: 5s
Waiting for video to exist: 6s
Waiting for video to exist: 7s
Waiting for video to exist: 8s
Waiting for video to exist: 9s
Waiting for video to exist: 10s

Generated:[]

Done!

To Reproduce

Expected behavior
Video should generated

Environment (please complete the following information):
reporters: ['spec',
[video, {
saveAllVideos: true, // If true, also saves videos for successful test cases
videoSlowdownMultiplier: 5, // Higher to get slower videos, lower for faster videos [Value 1-100]
videoRenderTimeout: 10, // Max seconds to wait for a video to finish rendering
}],
['allure', {
outputDir: reports/allure-results_${process.env.npm_config_storeId},
disableWebdriverStepsReporting: false,
disableWebdriverScreenshotsReporting: false,
}],
['junit', {
outputDir: reports/junit_${process.env.npm_config_storeId},
outputFileFormat: function(opts) { // optional
return results-${opts.cid}.${opts.capabilities}.xml
}
}]
],

mochaOpts: {
ui: 'bdd',
timeout: 9999999,
compilers: ["js:babel-core/register", 'js:babel-register'],
require: "mocha-clean",
},

"@wdio/allure-reporter": "5.11.0",
"@wdio/cli": "5.11.6",
"@wdio/concise-reporter": "5.11.0",
"@wdio/devtools-service": "5.11.0",
"@wdio/dot-reporter": "5.11.0",
"@wdio/firefox-profile-service": "5.11.0",
"@wdio/junit-reporter": "5.11.0",
"@wdio/local-runner": "5.11.6",
"@wdio/mocha-framework": "5.11.0",
"@wdio/selenium-standalone-service": "5.11.2",
"@wdio/spec-reporter": "5.11.6",
"@wdio/sumologic-reporter": "5.11.0",
"@wdio/sync": "5.11.0",

"wdio-chromedriver-service": "5.0.2",
"wdio-errorshot-reporter": "0.2.1",
"wdio-iedriver-service": "0.1.0",
"wdio-json-reporter": "1.3.0",
"wdio-mochawesome-reporter": "3.1.0",
"wdio-screenshots-cleanup-service": "0.0.7",
"wdio-testrail-reporter": "1.1.5",
"wdio-timeline-reporter": "5.0.10",
"wdio-video-reporter": "1.4.4"

Desktop (please complete the following information):

  • Windows 10 and Windows Server
  • Chrome 75.0.3775
  • Node 10.16.0
  • npm 6.10.0

Video was not recorded upon assertion failure expect true to be false

Describe the bug

  • A video was not output when I purposely failed a test.
  • If I had the below code in my test, a video would be output as expected:
const currentURL = browser.getUrl();
expect(currentURL, "User was not re-directed to '/my-account'").to.contain("/my-accountZZZZZZZ");
  • However, if I had the below code - the test would obviously fail but no video is output:
expect(true).to.be.false;

The actual assertion I was using in my test that flagged the issue to me was:

it("confirms the user can 'Proceed To Checkout'", function() {
         const breadcrumbsYourDetails = $("[href='/checkout/details'].selected")
         expect(breadcrumbsYourDetails.isDisplayed()).to.be.false; // FAILING ON PURPOSE
      });

Log
https://pastebin.com/TwRQQq0W

To Reproduce

Spec file:

const { expect } = require("chai");

describe("Bug for wdio video reporter", function() {
    it("fails on purpose", function() {
        expect(true).to.be.false;
    });
});

The 'reporters' array in my config file:

reporters: [
        "spec",
        [ video , {
            outputDir: "./videos",
            saveAllVideos: false, // If true, also saves videos for successful test cases
            videoSlowdownMultiplier: 3, // Higher to get slower videos, lower for faster videos [Value 1-100]
            videoRenderTimeout: 5 // Max seconds to wait for a video to finish rendering
        }]
    ],

Expected behavior

  • I'd expect an .mp4 file to be output upon assertion/chai failures

Environment (please complete the following information):

  • wdio-video-reporter version: 1.3.1
  • WebdriverIO version: 5.8.3
  • Mode: WDIO Testrunner
  • If WDIO Testrunner, running sync/async: sync
  • Node.js version: 12.1.0
  • NPM version: 6.9.0
  • Browser name and version: Chrome
  • Platform name and version: Mac Mojave 10.14.4

Desktop (please complete the following information):

  • OS: MAC OS
  • Browser Chrome
  • Version 74.0.3729.157

Generated videos are incomplete if there are unfulfilled frames

Describe the bug
If ffmpeg is called before all promised screenshots are returned the video stops at the first gap. This is actually an issue with the way ffmpeg works.

Log
n/a

To Reproduce
This is a very intermittent issue - I've only seen it a few times.

Can be replicated by running a test suite then manipulating the _results_/rawSeleniumVideoGrabs directory to remove one or more frames then re-running the video generation command...

e.g.

$ cd suite/results/directory/rawSeleniumVideoGrabs
$ rm 0001.png
$ /path/to/ffmpeg -y -r 10 -i "./%04d.png" -vcodec libx264 -crf 32 -pix_fmt yuv420p -vf "scale=1200:trunc(ow/a/2)*2","setpts=2.0*PTS" "video.mp4"

where the generated video will stop abruptly after the first frame.

Expected behavior
Ideally, the video should continue to the last captured screenshot, skipping the missing frames.

Environment (please complete the following information):

  • wdio-video-reporter version: 3.2.3
  • WebdriverIO version: 7.25.1
  • Mode: WDIO Testrunner
  • If WDIO Testrunner, running sync/async: async
  • Node.js version: 19.1.0
  • NPM version: 8.19.3
  • Browser name and version: any
  • Platform name and version: any

Desktop (please complete the following information):

  • any

Smartphone (please complete the following information):

  • any

Additional context
Add any other context about the problem here.

_results_ folder is being generated even outputDir has been defined

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Just use the wdio-template and define different outputDir.

Expected behavior
Default outputDir should be clean up.

Environment (please complete the following information):

  • wdio-video-reporter version: 1.4.0
  • WebdriverIO version: 5.8.3
  • Mode: WDIO Testrunner
  • If WDIO Testrunner, running sync/async: sync
  • Node.js version: 11.3.0
  • NPM version: 6.7.0

Reporter fails when running tests with long names

Describe the bug
Operating systems has a limitation on the length of folder/file names. For example Windows poses a maximum of 260 characters. The reporter concatenates, suite_name+test_name+browser_name+timestamp to create a temporary folder for screenshots. This fails the tests if a test has a long name.

Log

`Using reporter config:[
  [
    null,
    {
      "saveAllVideos": false,
      "videoSlowdownMultiplier": 10,
      "outputDir": "./allure-results/videos",
      "logLevel": "debug"
    }
  ],
  [
    "allure",
    {
      "outputDir": "./allure-results",
      "disableWebdriverStepsReporting": true,
      "disableWebdriverScreenshotsReporting": true
    }
  ],
  "dot",
  "spec",
  "junit"
]

Using config:{
  "debugMode": true,
  "logLevel": "info",
  "videoRenderTimeout": 5,
  "outputDir": "./allure-results/videos",
  "allureOutputDir": "./allure-results",
  "rawPath": "rawSeleniumVideoGrabs",
  "usingAllure": "allure",
  "saveAllVideos": false,
  "videoSlowdownMultiplier": 10,
  "excludedActions": [],
  "jsonWireActions": [
    "url",
    "forward",
    "back",
    "refresh",
    "execute",
    "size",
    "position",
    "maximize",
    "click",
    "submit",
    "value",
    "keys",
    "clear",
    "selected",
    "enabled",
    "displayed",
    "orientation",
    "alert_text",
    "accept_alert",
    "dismiss_alert",
    "moveto",
    "buttondown",
    "buttonup",
    "doubleclick",
    "down",
    "up",
    "move",
    "scroll",
    "doubleclick",
    "longclick",
    "flick",
    "location"
  ]
}





--- New suite: abcsabcsabcsabcsabcsabcsabcsabcsabcsabcsabcsabcsabcsabcsabcsabcsabcsacaasddsdsdasdasdadaswd ---`

To Reproduce
Can be produced simply by running the flowing test:

import {assert} from "chai";

describe("abcsabcsabcsabcsabcsabcsabcsabcsabcsabcsabcsabcsabcsabcsabcsabcsabcsacaasddsdsdasdasdadaswd", function(){
     it("abcsabcsabcsabcsabcsabcsabcsabcsabcsabcsabcsabcsabcsabcsabcsabcsabcsabcsabcsabcsabcsabcsabcsabcsabcsabcsabcsabcsabcsabcsabcsabcsabcsabcs", function() {
        browser.url("https://webdriver.io");  
        assert.equal(1,2,"error");
    });
});

Expected behavior
I did a quick check in my forked repository by changing the generateFilename inside helper.js to just return browser_name+timestamp and the problem is resolved.

Environment (please complete the following information):

  • wdio-video-reporter version: 1.2.1
  • WebdriverIO version: 5.4.13
  • Mode: command line
  • Node.js version: 8.11.1
  • NPM version: 5.6.0
  • Browser name and version: Chrome 68
  • Platform name and version: Windows 10

Desktop (please complete the following information):

  • OS: Windows 10
  • Browser: Chrome
  • Version: 73.0.3683.103

Using video reporter with chrome headless is blocking popups

Describe the bug
When i use the video reporter with chrome headless, browser alert popups are being blocked in the test.
When i remove video reporter and run the tests in headless mode, the browser popups show up.

Log
Please set wdio.config.logLevel = 'debug', then post the whole file called wdio-0-0-video-reporter.log.
If it is very large, consider using a gist - http://gist.github.com.

To Reproduce
Include code or an example repository that can easily be set up.

A great way to help isolate an issue and thus get a quicker fix, is to fork this repo: https://github.com/presidenten/wdio-template
Check if the issue is existing in the template, otherwise override wdio config with your settings and try to reproduce the test code that causes the issue by using different web controls on Selenium Easy (https://www.seleniumeasy.com/test/) or The Internet (https://the-internet.herokuapp.com/).

Expected behavior
A clear and concise description of what you expected to happen.

Environment (please complete the following information):

  • **wdio-video-reporter version: "^2.0.0",

  • **WebdriverIO version:5.18.2

  • **Mode:WDIO Testrunner sync

  • **Node.js version:v8.16.0

  • NPM version: [e.g. 5.8.0]

  • **Browser name and version:Chrome 79.0.3945.88

  • **Platform name and version:MacOS
    Desktop (please complete the following information):

  • OS: [e.g. iOS]

  • Browser [e.g. chrome, safari]

  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

wdio-video-reporter not working with multiremote

Describe the bug
An exception is thrown when trying to use wdio-video-reporter with multi-remote.

Log

$ npm run localTests

> [email protected] localTests
> SELENIUM_SERVER=4.0.0 CHROMEDRIVER=95.0.4638.69 wdio wdio.conf.local.js


Execution of 1 workers started at 2021-11-12T14:46:47.174Z

2021-11-12T14:46:47.175Z DEBUG @wdio/utils:initialiseServices: initialise service "shared-store" as NPM package
2021-11-12T14:46:47.244Z DEBUG @wdio/utils:initialiseServices: initialise service "selenium-standalone" as NPM package
2021-11-12T14:46:47.273Z INFO @wdio/cli:launcher: Run onPrepare hook
2021-11-12T14:46:47.286Z INFO @wdio/shared-store-service: Started shared server on port 63187
2021-11-12T14:46:49.535Z DEBUG @wdio/cli:utils: Finished to run "onPrepare" hook in 2262ms
2021-11-12T14:46:49.538Z INFO @wdio/cli:launcher: Run onWorkerStart hook
2021-11-12T14:46:49.538Z DEBUG @wdio/cli:utils: Finished to run "onWorkerStart" hook in 0ms
2021-11-12T14:46:49.539Z INFO @wdio/local-runner: Start worker 0-0 with arg: wdio.conf.local.js
[0-0] 2021-11-12T14:46:49.610Z WARN @wdio/utils:shim: You are running tests with @wdio/sync which will be discontinued starting Node.js v16.Read more on https://github.com/webdriverio/webdriverio/discussions/6702
[0-0] 2021-11-12T14:46:49.968Z INFO @wdio/local-runner: Run worker command: run
[0-0] 2021-11-12T14:46:49.970Z DEBUG @wdio/config:ConfigParser: No compiler found, continue without compiling files
[0-0] 2021-11-12T14:46:50.077Z DEBUG @wdio/local-runner:utils: init multiremote session
[0-0] 2021-11-12T14:46:50.081Z DEBUG @wdio/utils:initialiseServices: initialise service "shared-store" as NPM package
[0-0] 2021-11-12T14:46:50.122Z DEBUG @wdio/utils:initialiseServices: initialise service "selenium-standalone" as NPM package
[0-0] 2021-11-12T14:46:50.141Z DEBUG @wdio/sync: Finished to run "beforeSession" hook in 1ms
[0-0] RUNNING in MultiRemote - /tests/specs/test.spec.js
[0-0] 2021-11-12T14:46:50.295Z DEBUG @wdio/local-runner:utils: init multiremote session
[0-0] 2021-11-12T14:46:50.297Z INFO webdriver: Initiate new session using the WebDriver protocol
[0-0] 2021-11-12T14:46:50.300Z INFO webdriver: [POST] http://localhost:4444/wd/hub/session
[0-0] 2021-11-12T14:46:50.300Z INFO webdriver: DATA {
[0-0]   capabilities: {
[0-0]     alwaysMatch: { browserName: 'chrome', 'goog:chromeOptions': [Object] },
[0-0]     firstMatch: [ {} ]
[0-0]   },
[0-0]   desiredCapabilities: {
[0-0]     browserName: 'chrome',
[0-0]     'goog:chromeOptions': { args: [Array] }
[0-0]   }
[0-0] }
[0-0] 2021-11-12T14:46:50.305Z INFO webdriver: Initiate new session using the WebDriver protocol
[0-0] 2021-11-12T14:46:50.305Z INFO webdriver: [POST] http://localhost:4444/wd/hub/session
[0-0] 2021-11-12T14:46:50.306Z INFO webdriver: DATA {
[0-0]   capabilities: {
[0-0]     alwaysMatch: { browserName: 'chrome', 'goog:chromeOptions': [Object] },
[0-0]     firstMatch: [ {} ]
[0-0]   },
[0-0]   desiredCapabilities: {
[0-0]     browserName: 'chrome',
[0-0]     'goog:chromeOptions': { args: [Array] }
[0-0]   }
[0-0] }
[0-0] 2021-11-12T14:46:56.309Z DEBUG @wdio/sync: Finished to run "before" hook in 0ms
[0-0] 2021-11-12T14:46:56.313Z ERROR @wdio/local-runner: Failed launching test session: TypeError: Cannot read property 'filter' of undefined
[0-0]     at Video.onRunnerStart (/Users/user/work/git/my-project/regression-tests/node_modules/wdio-video-reporter/dist/wdio-video-reporter.js:483:51)
[0-0]     at Video.<anonymous> (/Users/user/work/git/my-project/regression-tests/node_modules/@wdio/reporter/build/index.js:59:18)
[0-0]     at Video.emit (events.js:314:20)
[0-0]     at Video.EventEmitter.emit (domain.js:483:12)
[0-0]     at /Users/user/work/git/my-project/regression-tests/node_modules/@wdio/runner/build/reporter.js:36:56
[0-0]     at Array.forEach (<anonymous>)
[0-0]     at BaseReporter.emit (/Users/user/work/git/my-project/regression-tests/node_modules/@wdio/runner/build/reporter.js:36:25)
[0-0]     at Runner.run (/Users/user/work/git/my-project/regression-tests/node_modules/@wdio/runner/build/index.js:113:24)
[0-0]     at processTicksAndRejections (internal/process/task_queues.js:97:5)
2021-11-12T14:46:56.340Z DEBUG @wdio/local-runner: Runner 0-0 finished with exit code 1
[0-0] FAILED in MultiRemote - /tests/specs/test.spec.js
2021-11-12T14:46:56.342Z INFO @wdio/cli:launcher: Run onComplete hook
2021-11-12T14:46:56.343Z INFO @wdio/selenium-standalone-service: shutting down all browsers
2021-11-12T14:46:56.348Z DEBUG @wdio/cli:utils: Finished to run "onComplete" hook in 5ms

Spec Files:	 0 passed, 1 failed, 1 total (100% completed) in 00:00:09

2021-11-12T14:46:56.349Z INFO @wdio/local-runner: Shutting down spawned worker
2021-11-12T14:46:56.600Z INFO @wdio/local-runner: Waiting for 0 to shut down gracefully
2021-11-12T14:46:56.600Z INFO @wdio/local-runner: shutting down

To Reproduce

  • Install wdio-video-reporter
  • Configure multiremote in wdio.conf.js. Example:

capabilities: {
        phoneAtlasA: {
            capabilities: {
                browserName: 'chrome',
                'goog:chromeOptions': {
                    args: ['disable-infobars', 'window-size=1920,1080']
                }
            }
        },
        phoneAtlasB: {
            capabilities: {
                browserName: 'chrome',
                'goog:chromeOptions': {
                    args: ['disable-infobars', 'window-size=1920,1080']
                }
            }
        }
    },
  • Run any spec

Expected behavior
The spec should execute, and a video should be recorded.

Environment (please complete the following information):

  • wdio-video-reporter version: 3.1.3
  • WebdriverIO version: 7.14.1
  • Mode: WDIO Testrunner
  • If WDIO Testrunner, running sync/async: sync
  • Node.js version: v12.20.0
  • NPM version: 8.1.0
  • Browser name and version: Chrome 95.0.4638.69
  • Platform name and version: macOS Big Sur Version 11.6

Desktop (please complete the following information):

  • OS: macOS Big Sur Version 11.6
  • Browser Chrome
  • Version 95.0.4638.69

Additional context
NA

Missing a JSON Wire endpoint leads to failure

Describe the bug
We have a pattern match check for jsonWireMsg endpoint in wdio-video-reporter index.js file at https://github.com/presidenten/wdio-video-reporter/blob/2e113f17a45f7ef345f4cf14f2bbbfc904e1f604/src/index.js#L86.

However if an action has no endpoint, the video reporter reports an error.

Log

23:58:24 [0-0] 2020-06-15T18:28:24.306Z ERROR @wdio/sync: TypeError: Cannot read property 'match' of undefined
23:58:24 at Video.onAfterCommand (/workspace/src/extensions/AbuseFilter/node_modules/wdio-video-reporter/dist/wdio-video-reporter.js:486:42)
23:58:24 at reporters.forEach.reporter (/workspace/src/extensions/AbuseFilter/node_modules/@wdio/runner/build/reporter.js:38:49)
23:58:24 at Array.forEach ()
23:58:24 at BaseReporter.emit (/workspace/src/extensions/AbuseFilter/node_modules/@wdio/runner/build/reporter.js:38:20)
23:58:24 at EventEmitter.browser.on.result (/workspace/src/extensions/AbuseFilter/node_modules/@wdio/runner/build/index.js:196:50)
23:58:24 at Browser.WebDriver.prototype.(anonymous function) [as emit] (/workspace/src/extensions/AbuseFilter/node_modules/@wdio/utils/build/monad.js:133:33)
23:58:24 at saveScreenshot (/workspace/src/extensions/AbuseFilter/node_modules/wdio-mediawiki/index.js:23:11)
23:58:24 at Object.afterTest (/workspace/src/extensions/AbuseFilter/tests/selenium/wdio.conf.js:98:21)

Expected behavior
A video should be recorded without any errors.

Suggested fix
The reporter should not emit this error.

Currently, we do something like this:

const command = jsonWireMsg.endpoint.match(/[^\/]+$/);

Where we should be doing a check like this:

const command = jsonWireMsg.endpoint && jsonWireMsg.endpoint.match(/[^\/]+$/);

Steps to reproduce

  1. Clone Mediawiki/core repository using:
    git clone https://github.com/wikimedia/mediawiki mediawiki
  2. cd mediawiki
  3. Run git clone https://github.com/wikimedia/mediawiki-extensions-AbuseFilter extensions/AbuseFilter
  4. Append the line wfLoadExtension( 'AbuseFilter' ); in LocalSettings.php
  5. Run git clone https://github.com/wikimedia/Vector skins/Vector
  6. Set up mediawiki as specified in DEVELOPERS.md
  7. Check if AbuseFilter is visible on navigation to https://localhost:8080/wiki/Special:Version
  8. cd extensions/AbuseFilter
  9. npm i && npm run selenium-test

Environment (please complete the following information):

  • wdio-video-reporter version: 3
  • WebdriverIO version: 6
  • Mode: WDIO Testrunner
  • If WDIO Testrunner, running sync/async: sync/async
  • Node.js version: 12.x
  • NPM version: 6.x
  • Browser name and version: Chrome 83
  • Platform name and version: OSX Cataline

Desktop (please complete the following information):

  • OS: OS
  • Browser Chrome
  • Version 83

Video generated is corrupted under /allure-raw folder

Describe the bug
I'm using this library with version ^1.3.2, Tests runs fine, generates the videos however recently observed this wired issue when viewing the report with Allure for videos the mime is incorrect.

My reporters' options -

reporters: [
    'spec',
    [video, {
        saveAllVideos: true,       // If true, also saves videos for successful test cases
        videoSlowdownMultiplier: 10, // Higher to get slower videos, lower for faster videos [Value 1-100]
        videoRenderTimeout: 5,      // Max seconds to wait for a video to finish rendering
    }],
    ['allure', {
        outputDir: './_results_/allure-raw',
        disableWebdriverStepsReporting: true,
        disableWebdriverScreenshotsReporting: true,
    }],
],

image

Videos generated under results are fine, it plays well, however, the one under allure-raw with file extension .mp4 does not play.

Spend the whole day finding the issue, did not get a breakthrough.

Reinstalled all npm modules of @ffmpeg-installer/ffmpeg no luck

Expected behavior
Expect both videos to work the one from results and under allure raw

Environment (please complete the following information):

wdio-video-reporter version: 1.3.2
WebdriverIO version: 5.3.8
Mode: command line
Node.js version: 8.11.1
NPM version: 5.6.0
Browser name and version: FF latest
Platform name and version: Mac X10
Desktop (please complete the following information):

OS: Mac OS High Siera
Browser: FF / Chrome latest
Version: 74

Appreciate any help or a workaround for video's to work with allure reports

Thanks

Possibility to record the test suite as one video

My test suites are organized as such:

describe("place order from basket", () => {
    it("login", () => {
        browser.login_testuser()
    })

    it("go to /basket/delivery", () => {
        browser.urlAndWait("/basket/delivery")
    })

    it("click nextday", function() {
        $("input[name=delivery_method][value=nextday]").click()
    })

    it('fill [name="delivery_address"]', () => {
        $('[name="delivery_address"]').addValue(
            "XYZ Road"
        )
    })

...

Where each it is one user action. Right now each it generates a separate video. I'd like to know if it is possible to generate the video for the entire suite.

Thank you.

Observing "Cannot read property 'filter' of undefined" after adding video to reporters object

Describe the bug
After adding the video reporter to my wdio conf file the test do not run and I am faced with the following error.
ERROR @wdio/local-runner: Failed launching test session: TypeError: Cannot read property 'filter' of undefined

We are using running test on both an iOS app and on a website.
We have successfully added alurre reporter and cucumber to our framework and working as expected.
The current implementation for reporter in our wdio.conf.ts file is as follows:

    'spec',
    [video, {
      saveAllVideos: false,       // If true, also saves videos for successful test cases
      videoSlowdownMultiplier: 1, // Higher to get slower videos, lower for faster videos [Value 1-100]
    }],
    ['allure', {
      outputDir: '_results_/allure-raw',
      disableWebdriverStepsReporting: true,
      disableWebdriverScreenshotsReporting: true,
      useCucumberStepReporter: true
    }],
  ],

Log
Please set wdio.config.logLevel = 'debug', then post the whole file called wdio-0-0-video-reporter.log.
If it is very large, consider using a gist - http://gist.github.com.
no wdio-0-0-video-reporter log outputted but

[0-0]     at Video.onRunnerStart (/Users/username/dev/e2e-test-automation/node_modules/wdio-video-reporter/src/index.js:67:51)
[0-0]     at Video.<anonymous> (/Users/username/dev/e2e-test-automation/node_modules/@wdio/reporter/build/index.js:59:18)
[0-0]     at Video.emit (events.js:400:28)
[0-0]     at Video.emit (domain.js:470:12)
[0-0]     at /Users/username/dev/e2e-test-automation/node_modules/@wdio/runner/build/reporter.js:36:56
[0-0]     at Array.forEach (<anonymous>)
[0-0]     at BaseReporter.emit (/Users/username/dev/e2e-test-automation/node_modules/@wdio/runner/build/reporter.js:36:25)
[0-0]     at Runner.run (/Users/username/dev/e2e-test-automation/node_modules/@wdio/runner/build/index.js:113:24)
[0-0]     at processTicksAndRejections (internal/process/task_queues.js:95:5)

Expected behavior
Should not observe filter error after adding
Environment (please complete the following information):

  • wdio-video-reporter version: [e.g. 1.1.2]
  • WebdriverIO version: [e.g. 5.4.13]
  • Mode: [Standalone mode or WDIO Testrunner]
  • If WDIO Testrunner, running sync/async: [e.g. sync/async]
  • Node.js version: [e.g. 8.11.2]
  • NPM version: [e.g. 5.8.0]
  • Browser name and version: [e.g. Chrome 68]
  • Platform name and version: [e.g. Windows 10]

Desktop (please complete the following information):

  • OS: [Mac OS Big Sur 11.6.1]
  • Browser [chrome]
  • Version [99.0.4844.51]

Smartphone (please complete the following information):

  • Device: [iOS - iPad 9.7inch]
  • OS: [14.5]
  • Non-browser Application

Construct videos earlier and provide paths to attach to other reporters

Is your feature request related to a problem? Please describe.

I want to be able to send the created video to ReportPortal, etc. Since all videos are constructed in onRunnerEnd the only place we can do this is onComplete which is kind of late.

Describe the solution you'd like

I want to have access to the last created video path as well as access to file in afterScenario.

Describe alternatives you've considered
I have created a workaround storing values in JSON files but not 100% sure this will work.

Additional context
None at the current time.

When starting the autotest, an unknown error periodically occurs, which causes the test to crash

Describe the bug
A failing test sometimes causes wdio-video-reporter to crash.

Stdout

#0 0x5556f34f7ee3 <unknown>
#1 0x5556f2fc5608 <unknown>
#2 0x5556f2fb5e83 <unknown>
#3 0x5556f2fa9779 <unknown>
#4 0x5556f3038aa9 <unknown>
#5 0x5556f3019272 <unknown>
#6 0x5556f302c3bc <unknown>
#7 0x5556f3019163 <unknown>
#8 0x5556f2feebfc <unknown>
#9 0x5556f2fefc05 <unknown>
#10 0x5556f3529baa <unknown>
#11 0x5556f353f651 <unknown>
#12 0x5556f352ab05 <unknown>
#13 0x5556f3540a68 <unknown>
#14 0x5556f351f05f <unknown>
#15 0x5556f355b818 <unknown>
#16 0x5556f355b998 <unknown>
#17 0x5556f3576eed <unknown>
#18 0x7f31f512dfa3 <unknown>
    at Video.emit (node:events:381:22)
    at Video.emit (node:domain:470:12)
    at Array.forEach (<anonymous>)

To Reproduce
video reporter
npx wdio run wdio.conf.js

Expected behavior

  • video record in allure report
  • failing test stack trace in allure report

Actual behavior

  • empty video record
  • unexpected stack trace

Environment

  • wdio-video-reporter version: 3.2.0
  • WebdriverIO version:7.5.2
  • Mode: jasmine
  • If WDIO Testrunner, running: sync

Desktop (please complete the following information):

  • OS: docker node:15.14.0-buster
  • Browser chrome
  • Version 96.0.4664.55

Additional context

[Feature request]ย Add support for cucumber

Describe the bug
When using cucumber as a framework, video recording fails to work. No videos are produced. Cluttered and confusing raw output captured.

Log
https://gist.github.com/tangentially/aaf0c0d20364af9cc3279ba1ae120e9d

To Reproduce
Create a simple cucumber scenario and run.

Expected behavior
Videos recorded, one per scenario.

Environment (please complete the following information):

  • wdio-video-reporter version: 1.4.4
  • WebdriverIO version: 5.12.0
  • Mode: WDIO Testrunner
  • If WDIO Testrunner, running sync/async: sync
  • Node.js version: 10.16.0
  • NPM version: 6.10.3
  • Browser name and version: Chrome Version 74.0.3729.169 (Official Build) (64-bit)
  • Platform name and version: MacOS

Desktop (please complete the following information):

  • OS: MacOS
  • Browser Chrome
  • Version 74

Additional context
From wdio-cucumberjs-json-reporter

The order of running of the on* is the following:
onRunnerStart
onSuiteStart (feature)
onSuiteStart (scenario)
onHookStart
onHookEnd
onTestStart
onBeforeCommand
onAfterCommand
onTestPass
onHookStart
onHookEnd
onSuiteEnd (scenario is done)
onSuiteEnd (feature is done)
onRunnerEnd

Please note: onTestEnd() is never called, and that onTestStart() is called once per step. (This leads to a lot of single screenshot directories.

ls rawSeleniumVideoGrabs/
CES-Demo--HAOD-1325-Demo-scenario---subscribe-to-each-package-start-guidance-and-add-waypoints--Given-I-am-on-the-Login-page--CHROME--08-14-2019--11-40-58-918
CES-Demo--HAOD-1325-Demo-scenario---subscribe-to-each-package-start-guidance-and-add-waypoints--Given-I-am-on-the-Login-page--Then-the-password-text-input-is-not-empty--When-I-click-the-Login-button-on-the-Login-page--CHROME--08-14-2019--11-41-04-280
CES-Demo--HAOD-1325-Demo-scenario---subscribe-to-each-package-start-guidance-and-add-waypoints--Given-I-am-on-the-Login-page--When-I-type-drivertest3-username--CHROME--08-14-2019--11-41-00-152
CES-Demo--HAOD-1325-Demo-scenario---subscribe-to-each-package-start-guidance-and-add-waypoints--Given-I-am-on-the-Login-page--When-I-type-drivertest3-username--Then-the-username-text-input-has-value-drivertest3--CHROME--08-14-2019--11-41-01-732

outputDir without allure doesn't seem to work

Describe the bug
Everything else works like a charm, except the outputDir setting doesn't seem to do much. It creates a "videos" folder at the given path, but everything is still saved under "./results".

To Reproduce

  reporters: [
    [video, {
      outputDir: './e2e/test_output/videos', // Doesn't save under this location for some reason...
      saveAllVideos: false,       // If true, also saves videos for successful test cases
      videoSlowdownMultiplier: 3, // Higher to get slower videos, lower for faster videos [Value 1-100]
    }],
    'spec',
    [
      'cucumberjs-json',
      {
        jsonFolder: './e2e/test_output',
      },
    ],
  ],

Expected behavior
I would except all the videos and screenshots to be saved under './e2e/test_output/videos'.

Environment (please complete the following information):

  • wdio-video-reporter version: ^3.1.0
  • WebdriverIO version: ^5.23.0
  • Node.js version: v12.18.3
  • NPM version: 6.14.8 - Platform name and version: MacOS Catalina Version 10.15.6

Smartphone (please complete the following information):

  • Device: iPhone 11 simulator
  • OS: 13.0

** Additional info **
We are using Appium and Cucumber with the E2E tests.

Error throws when output is not defined.

Describe the bug
If config.output and options.logFile are not defined, throw an error.
https://github.com/presidenten/wdio-video-reporter/blob/master/src/index.js#L21

Log

[0-0] 2019-05-09T06:13:52.843Z ERROR @wdio/local-runner: Failed launching test session: TypeError: Cannot read property 'replace' of undefined
     at new Video (/Users/aha-oretama/IdeaProjects/mercari-web-jp-e2e-test/node_modules/wdio-video-reporter/dist/wdio-video-reporter.js:183:61)
     at BaseReporter.initReporter (/Users/aha-oretama/IdeaProjects/mercari-web-jp-e2e-test/node_modules/@wdio/runner/build/reporter.js:172:14)
     at Array.map (<anonymous>)
     at new BaseReporter (/Users/aha-oretama/IdeaProjects/mercari-web-jp-e2e-test/node_modules/@wdio/runner/build/reporter.js:42:39)
     at Runner.run (/Users/aha-oretama/IdeaProjects/mercari-web-jp-e2e-test/node_modules/@wdio/runner/build/index.js:91:21)
     at process._tickCallback (internal/process/next_tick.js:68:7)

To Reproduce
config -> output is not defined in wdio.conf.js.

Expected behavior
I think you should define default output directory.
Other report(such as Allure report) defines default directory as follows.
https://webdriver.io/docs/allure-reporter.html

Environment (please complete the following information):

  • **wdio-video-reporter version:1.3.1
  • **WebdriverIO version:5.8.3

Support for webdriver v8

Is your feature request related to a problem? Please describe.

I would like to use this reporter with wdio v8

Describe the solution you'd like

Add support for v8

Describe alternatives you've considered

Stay in webdriver 7

Additional context

latest 3.3.0 use this tree depenendency:

โ””โ”€โ”ฌ wdio-video-reporter@3.3.0
  โ”œโ”€โ”ฌ @wdio/allure-reporter@7.26.0
  โ”‚ โ””โ”€โ”€ @wdio/reporter@7.26.0 deduped
  โ””โ”€โ”€ @wdio/reporter@7.26.0

Video which is attaching is not attaching properly and showing the memory in Bytes and it is not playing

Describe the bug
Once the execution is completed, video got generated and attaching to the allure report but it the video attached is coming in Bytes and it is not playable.

Log
wdio-0-0-Video-reporter.log

To Reproduce
Run a normal test case with WebdriverIO along with wdio-video-reporter supporting allure reporting and add the code as mentioned in the log file in reporters section in config.js.

Expected behavior
Expected to attach the videos properly and they should be played from allure report.

PLEASE BELOW THE SCREENSHOT:

image

Also getting below error in console:

ERROR @wdio/local-runner: Failed launching test session: Error: ENOENT: no such file or directory, stat 'C:\Program Files (x86)\Jenkins\workspace\Demo2\recordings\Log-into-account--click-on-Sign-in-Link--CHROME--05-08-2020--13-30-18-432.mp4'
at Object.statSync (fs.js:932:3)
at Object.statSync (C:\Program Files (x86)\Jenkins\workspace\Demo2\node_modules\graceful-fs\polyfills.js:308:16)
at C:\Program Files (x86)\Jenkins\workspace\Demo2\node_modules\wdio-video-reporter\dist\wdio-video-reporter.js:189:70
at Array.map ()
at Object.waitForVideosToBeWritten (C:\Program Files (x86)\Jenkins\workspace\Demo2\node_modules\wdio-video-reporter\dist\wdio-video-reporter.js:189:33)
at Video.onExit (C:\Program Files (x86)\Jenkins\workspace\Demo2\node_modules\wdio-video-reporter\dist\wdio-video-reporter.js:590:13)
at process. (C:\Program Files (x86)\Jenkins\workspace\Demo2\node_modules\wdio-video-reporter\dist\wdio-video-reporter.js:463:44)
at process.emit (events.js:323:22)
at process.EventEmitter.emit (domain.js:482:12)
at process.exit (internal/process/per_thread.js:165:15)
[0-0] FAILED in chrome - C:\Program Files (x86)\Jenkins\workspace\Demo2\test-suites\demo\EndtoEndTest.js
2020-05-08T08:02:11.577Z INFO @wdio/cli:launcher: Run onComplete hook

Environment (please complete the following information):

  • **wdio-video-reporter version:"^2.0.0"
  • **WebdriverIO version:"^6.1.3"
  • **Mode:WDIO Testrunner
  • **Node.js version:v12.16.1
  • **NPM version:6.13.4
  • **Browser name and version:Chrome 81
  • **Platform name and version:Windows 10

Additional context
Facing the same issue when we are running from Mac or Windows, it showing the same behaviour.

Add an option to take screenshots at regular intervals during each test

Is your feature request related to a problem? Please describe.
Videos are made up from screen shots taken after commands are sent, so play very quickly unless slowed. Some ui changes between the commands may also be lost.

Describe the solution you'd like
An option to capture the screen at regular intervals while the test runs.

Describe alternatives you've considered
Proposed implementation at #89

logLevel and content files in outputDir

Hi!
According to your documentation, you say: "To see processed messages, set wdio.config.logLevel: 'debug' and check outputDir/wdio-X-Y-Video-reporter.log. This will also leave the screenshots output directory intact for review"

So, I set logLevel: error and see these log files and screenshots.
Actually, do we have any way of just get the videos in outputDir?

Add a parameter to remove excess console messages

Is your feature request related to a problem? Please describe.
When I run more than 200 tests, I can't see my post scripts due to the output of video reporter : those 2 lines :

this.write('\nGenerated:' + JSON.stringify(this.videos, undefined, 2) + '\n\n');
this.write(`\n\nVideo reporter Done!\n`);

Describe the solution you'd like
add a parameter to the wdio conf video reporter, that disables the this.write...

Describe alternatives you've considered
I forked the repo and temp fixed it but it interferes with npm install

Additional context
Add any other context or screenshots about the feature request here.

Unable to disable the rawSeleniumVideoGrabs screenshot.

Is your feature request related to a problem? Please describe.
Implemented the wdio-video-reporter for our test automation.
and we have set saveAllVideos: false
As we want to save the videos only after the test failure.
But the rawSeleniumVideoGrabs are still getting generated even if the test are passed though the video is not getting generated but the screenshots are consuming memory in pipeline which i wanted to avoid.
Is there any way to disable it if the execution is passed.

Describe the solution you'd like
If the execution is passed then we should not save the rawSeleniumVideoGrabs.

Describe alternatives you've considered
No alternative idea

Question: Why wdio-video-reporter add allure's arguments?

Describe the bug
See these lines.
I have a question. Why wdio-video-reporter add allure's argument?
https://github.com/presidenten/wdio-video-reporter/blob/04f5a248d202c4a199e5cd5065516e79deb67993/src/index.js#L134-L141

When a test is retried and first time's test fails and next test succeeds, this makes allure reporter display not one test case but two test cases.
( Because failed test doesn't pass above lines when an error is thrown in mocha's beforeEach, and succeeded test has above argument but failed test has no argument)

Expected behavior
I think that wdio-video-reporter has a responsibility to video, not to allure. So these lines are not required in wdio-video-reporter, right?

Disable Logging and rawscreenshots

Even after setting log level to silent in wdio config, video reporter still generates wdio-X-Y-Video-reporter.log and rawSeleniumVideoGrabs folder.
This is what loaded config for video reporter looks like

Using config:{
  "debugMode": false,
  "logLevel": "info",
  "videoRenderTimeout": 5,
  "outputDir": "output",
  "allureOutputDir": "allure-results",
  "rawPath": "rawSeleniumVideoGrabs",
  "usingAllure": false,
  "saveAllVideos": true,
  "videoSlowdownMultiplier": 20,
  "excludedActions": [],
  "jsonWireActions": [
    "url",
    "forward",
    "back",
    "refresh",
    "execute",
    "size",
    "position",
    "maximize",
    "click",
    "submit",
    "value",
    "keys",
    "clear",
    "selected",
    "enabled",
    "displayed",
    "orientation",
    "alert_text",
    "accept_alert",
    "dismiss_alert",
    "moveto",
    "buttondown",
    "buttonup",
    "doubleclick",
    "down",
    "up",
    "move",
    "scroll",
    "doubleclick",
    "longclick",
    "flick",
    "location"
  ]
}

Remove `sleep` in favor of async/await

Describe the bug
Putting the process to an halt with:

    const stop = new Date().getTime() + ms;
    while(new Date().getTime() < stop);

is not ideal as it completely blocks everything from happening. We should replace this and all functions with proper async/await logic. I see similar implementations in all do { ... } while (...) places.

Log
n/a

To Reproduce
n/a

Expected behavior
Use async/await instead of this.

Environment (please complete the following information):

  • wdio-video-reporter version: [e.g. 1.1.2]
  • WebdriverIO version: [e.g. 5.4.13]
  • Mode: [Standalone mode or WDIO Testrunner]
  • If WDIO Testrunner, running sync/async: [e.g. sync/async]
  • Node.js version: [e.g. 8.11.2]
  • NPM version: [e.g. 5.8.0]
  • Browser name and version: [e.g. Chrome 68]
  • Platform name and version: [e.g. Windows 10]

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

browser.getMetrics is not a function when using wdio-video-reporter alongside devtools

Description

browser.getMetrics is not a function when using wdio-video-reporter alongside devtools

Reproduction Steps

https://github.com/chrisplim/wdio-video-reporter-bug

  1. Setup, and run the example test. To see the test pass
git clone [email protected]:chrisplim/wdio-video-reporter-bug.git
cd wdio-video-reporter-bug
npm install
npm run wdio
  1. Uncomment the code in wdio.conf.js between the UNCOMMENT_ME blocks and run the test again to see the error message.
# uncomment code in wdio.conf.js between the UNCOMMENT_ME blocks
npm run wdio

Expected behavior

I expect that I should be able to use the devtools functionality like browser.getMetrics while also writing videos from the wdio-video-reporter in a test; and that test should pass without any errors.

Environment

  • wdio-video-reporter version: 3.2.3
  • WebdriverIO version: 7.24.1
  • Mode: wdio
  • If WDIO Testrunner, running sync/async: async
  • Node.js version: v16.15.0
  • NPM version: 8.5.5
  • Browser name and version: Chrome 105.0.5195.125
  • Platform name and version: macOS Monterey 12.3.1

Notes

Related issue comment:
webdriverio/webdriverio#7778 (comment)

Video will not be created if a failure/error occurs in a BEFORE hook

Describe the bug
If I'm using a Mocha framework and I have before hook that navigates to a page and waits for an element to exist, if the element does not exist - then a video will not be created.
If I move that one "wait for element to exist" command out of the before hook and into the "it" block, the video will be successfully created.

Apologies if this issue is basically a duplicate of the below!
https://github.com/presidenten/wdio-video-reporter/issues/11

Log
https://pastebin.com/YJkqKVM3

To Reproduce
I've created a repo with an example.
https://github.com/Faz540/wdio-video-reporter-bug

Expected behaviour
I'd expect a video to be created if the element cannot be found, regardless if that check is inside a before hook or the actual test itself.

Environment (please complete the following information):

  • wdio-video-reporter version: 2.0.0
  • WebdriverIO version: 5.18.6
  • Mode: [Standalone mode or WDIO Testrunner] WDIO Test Runner
  • If WDIO Testrunner, running sync/async: Sync
  • Node.js version: 13.2.0
  • NPM version: 6.13.6
  • Browser name and version: Chrome v79
  • Platform name and version: MacOS Mojave 10.14.6

Additional context
I'm using the Chromedriver service, not the Selenium Standalone.

Failed loading configuration file when use wdio-video-reporter with node 16

ERROR @wdio/config:ConfigParser: Failed loading configuration file: {MyPath}\wdio.conf.js: undefined

The error just happen when I require to wdio-video-reporter in configuration file and using Node 16 version.
The error not happen when I use Node 14 version

const video = require('wdio-video-reporter');
reporters: [
        ...
        [
            video,
            {
                saveAllVideos: false, // If true, also saves videos for successful test cases
                videoSlowdownMultiplier: 3, // Higher to get slower videos, lower for faster videos [Value 1-100]
            },
        ],
    ],

More info about package.json

"devDependencies": {
    "@wdio/allure-reporter": "^7.20.0",
    "@wdio/cli": "^7.20.2",
    "@wdio/dot-reporter": "^7.20.0",
    "@wdio/junit-reporter": "^7.20.0",
    "@wdio/local-runner": "^7.20.0",
    "@wdio/mocha-framework": "^7.20.0",
    "@wdio/selenium-standalone-service": "^7.20.0",
    "@wdio/spec-reporter": "^7.20.0",
    "wdio-video-reporter": "^3.2.1",
  },

Cannot see the recorded video file

Describe the bug
Does it support screenshot on mobile native APP with jasmine framework?

I have encountered this issue when the test end

[0515444646413736 LINUX 7.0 #0-0] TypeError: Cannot read property 'toUpperCase' of undefined
[0515444646413736 LINUX 7.0 #0-0] at
[0515444646413736 LINUX 7.0 #0-0] at Video.emit (events.js:182:13)
[0515444646413736 LINUX 7.0 #0-0] at Video.EventEmitter.emit (domain.js:441:20)
[0515444646413736 LINUX 7.0 #0-0] at
[0515444646413736 LINUX 7.0 #0-0] at

Log

`Using reporter config:[
"spec",
[
null,
{
"saveAllVideos": true,
"videoSlowdownMultiplier": 3,
"videoRenderTimeout": 5
}
],
[
"allure",
{
"outputDir": "./wdio/__logs/allure-result",
"disableWebdriverStepsReporting": true,
"disableWebdriverScreenshotsReporting": true
}
]
]

Using config:{
"debugMode": true,
"logLevel": "info",
"videoRenderTimeout": 5,
"outputDir": "results",
"allureOutputDir": "./wdio/__logs",
"rawPath": "rawSeleniumVideoGrabs",
"usingAllure": "allure",
"saveAllVideos": true,
"videoSlowdownMultiplier": 3,
"excludedActions": [],
"jsonWireActions": [
"url",
"forward",
"back",
"refresh",
"execute",
"size",
"position",
"maximize",
"click",
"submit",
"value",
"keys",
"clear",
"selected",
"enabled",
"displayed",
"orientation",
"alert_text",
"accept_alert",
"dismiss_alert",
"moveto",
"buttondown",
"buttonup",
"doubleclick",
"down",
"up",
"move",
"scroll",
"doubleclick",
"longclick",
"flick",
"location"
]
}

--- New suite: Validate Consent form in TO-DO list, ---

--- New test: should be able to tap on existing consent form successfully ---
Incomming command: /session/:sessionId/element => [element]
Incomming command: /session/:sessionId/element => [element]
Incomming command: /session/:sessionId/element => [element]
Incomming command: /session/:sessionId/element => [element]
Incomming command: /session/:sessionId/element => [element]
Incomming command: /session/:sessionId/element => [element]
Incomming command: /session/:sessionId/element/1/displayed => [displayed]
Incomming command: /session/:sessionId/element/1/click => [click]
Incomming command: /session/:sessionId/element => [element]
Incomming command: /session/:sessionId/element => [element]
Incomming command: /session/:sessionId/element/2/displayed => [displayed]
Incomming command: /session/:sessionId/element => [element]
Incomming command: /session/:sessionId/elements => [elements]
Incomming command: /session/:sessionId/element => [element]
Incomming command: /session/:sessionId/element/5/click => [click]
Incomming command: /session/:sessionId/element => [element]
Incomming command: /session/:sessionId/elements => [elements]
Incomming command: /session/:sessionId/element => [element]
Incomming command: /session/:sessionId/element => [element]
Incomming command: /session/:sessionId/element => [element]
Incomming command: /session/:sessionId/element => [element]
Incomming command: /session/:sessionId/element => [element]
Incomming command: /session/:sessionId/element => [element]
Incomming command: /session/:sessionId/element => [element]
Incomming command: /session/:sessionId/element => [element]
Incomming command: /session/:sessionId/element => [element]
Incomming command: /session/:sessionId/element => [element]
Incomming command: /session/:sessionId/element => [element]
Incomming command: /session/:sessionId/element => [element]
Incomming command: /session/:sessionId/element/6/displayed => [displayed]
Incomming command: /session/:sessionId/element => [element]
Incomming command: /session/:sessionId/element/7/click => [click]
Incomming command: /session/:sessionId/log/types => [types]
Incomming command: /session/:sessionId/log => [log]
Incomming command: /session/:sessionId/log => [log]
Incomming command: /session/:sessionId => [:sessionId]

--- Awaiting videos ---
Max waiting time: 5s

--- Videos are done ---

Generated:[]

--- Patching allure report ---

Done!

`

Expected behavior
I should see the video in the allure result folder

Environment (please complete the following information):

  • wdio-video-reporter version: 1.3.3
  • WebdriverIO version: 5.8.3
  • Mode: WDIO Testrunner
  • If WDIO Testrunner, running sync/async: sync
  • Node.js version: v11.3.0
  • NPM version: 6.7.0
  • Browser name and version: NA
  • Platform name and version: Samsung Galaxy Note5 (Appium)

Allure report generated via Jenkins failed to Load the Execution Video in Safari Browser

Describe the bug
Allure report generated via Jenkins failed to Load the Video [Execution Video].
Same code base running from local machine, loads the video in allure report.Same is not happening while running the test in Jenkins.
Execution Video attachment created in allure without loading the video.

Log
11:12:27 "Video" Reporter:
11:12:27 Using reporter config:[
11:12:27 "dot",
11:12:27 "spec",
11:12:27 "allure",
11:12:27 [
11:12:27 null,
11:12:27 {
11:12:27 "saveAllVideos": false,
11:12:27 "videoSlowdownMultiplier": 10,
11:12:27 "videoRenderTimeout": 5
11:12:27 }
11:12:27 ]
11:12:27 ]
11:12:27
11:12:27 Using config:{
11:12:27 "debugMode": false,
11:12:27 "logLevel": "info",
11:12:27 "videoRenderTimeout": 5,
11:12:27 "outputDir": "results",
11:12:27 "allureOutputDir": "allure-results",
11:12:27 "rawPath": "rawSeleniumVideoGrabs",
11:12:27 "usingAllure": true,
11:12:27 "saveAllVideos": false,
11:12:27 "videoSlowdownMultiplier": 10,
11:12:27 "excludedActions": [],
11:12:27 "jsonWireActions": [
11:12:27 "url",
11:12:27 "forward",
11:12:27 "back",
11:12:27 "refresh",
11:12:27 "execute",
11:12:27 "size",
11:12:27 "position",
11:12:27 "maximize",
11:12:27 "click",
11:12:27 "submit",
11:12:27 "value",
11:12:27 "keys",
11:12:27 "clear",
11:12:27 "selected",
11:12:27 "enabled",
11:12:27 "displayed",
11:12:27 "orientation",
11:12:27 "alert_text",
11:12:27 "accept_alert",
11:12:27 "dismiss_alert",
11:12:27 "moveto",
11:12:27 "buttondown",
11:12:27 "buttonup",
11:12:27 "doubleclick",
11:12:27 "down",
11:12:27 "up",
11:12:27 "move",
11:12:27 "scroll",
11:12:27 "doubleclick",
11:12:27 "longclick",
11:12:27 "flick",
11:12:27 "location"
11:12:27 ]
11:12:27 }
11:12:27
11:12:27
11:12:27 Max waiting time: 5s
11:12:27
11:12:27 --- Video /home/jenkins/workspace/PIT_WDIO_V5/results/add-to-cartpdp--Windows10_Chrome_v68-should-be-able-to-add-a-normal-sku-to-cart-lv--CHROME--07-18-2019--00-40-21-196.mp4 ---
11:12:27 Waiting for video to exist: 0s
11:12:27 Waiting for video to be ready: 0s
11:12:27 Waiting for video to be ready: 1s
11:12:27 Waiting for video to be ready: 2s
11:12:27 Waiting for video to be ready: 3s
11:12:27
11:12:27 Generated:[
11:12:27 "/home/jenkins/workspace/PIT_WDIO_V5/results/add-to-cartpdp--Windows10_Chrome_v68-should-be-able-to-add-a-normal-sku-to-cart-lv--CHROME--07-18-2019--00-40-21-196.mp4"
11:12:27 ]
11:12:27
11:12:27
11:12:27
11:12:27 Done!
11:12:27
11:12:27
11:12:27 "dot" Reporter:
11:12:27 F
11:12:27
11:12:27 "spec" Reporter:

To Reproduce
Try running test via Jenkins with allure report configurations

Expected behavior
clicking on 'Execution video' should loads the video in allure report generated via Jenkins..

Environment (please complete the following information):

  • wdio-video-reporter version: [ 1.4.4,]
  • WebdriverIO version: [5.10.7]
  • Mode: [WDIO Testrunner- mocha]
  • If WDIO Testrunner, running sync/async: [ sync]
  • Node.js version: [10.15.4]
  • NPM version: [6.4.1]
  • Browser name and version: [All browsers in Saucelabs]
  • Platform name and version: [All browsers in Saucelabs]

Additional context
This problem we are seeing only when test run from Jenkins.
Local testing load the video as expected.
Might be related the storing the video Artifacts for allure report to refer
Screen Shot 2019-07-18 at 11 42 16 AM
.

Extend wdio-video-reporter to support WebdriverIO v6

Is your feature request related to a problem? Please describe.
The wdio-video-reporter npm package made video recording of test runs nearly seamless with WebdriverIO v5. Because of how useful recording of tests can prove to be, an extension to support WebdriverIO v6 should not be a bad consideration more so because of the fact that this is the only plugin that supports video recording for WebdriverIO v6.

Describe the solution you'd like
A start can be with upgrading @wdio/reporter npm package to the latest version.

Videos not displaying properly in allure

Describe the bug
Videos are not being displayed in allure. I get a black box that doesn't play anything.
The video files are recorded / work.
When I curl the url for one of the video files, it is a link to the physical location of the text file on my hard drive.

Log

--- Patching allure report ---
Error during onRunnerEnd:The "path" argument must be one of type string, Buffer, or URL. Received type undefinedTypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be one of type string, Buffer, or URL. Received type undefined
    at Object.readdirSync (fs.js:781:3)
    at Video.onRunnerEnd (/Users/pmwebster/Sites/qa/helpwdio/node_modules/wdio-video-reporter/dist/wdio-video-reporter.js:346:10)
    at Video.WDIOReporter.on.runner (/Users/pmwebster/Sites/qa/helpwdio/node_modules/@wdio/reporter/build/index.js:181:12)
    at Video.emit (events.js:189:13)
    at Video.EventEmitter.emit (domain.js:441:20)
    at reporters.forEach.reporter (/Users/pmwebster/Sites/qa/helpwdio/node_modules/@wdio/runner/build/reporter.js:61:49)
    at Array.forEach (<anonymous>)
    at BaseReporter.emit (/Users/pmwebster/Sites/qa/helpwdio/node_modules/@wdio/runner/build/reporter.js:61:20)
    at Runner.run (/Users/pmwebster/Sites/qa/helpwdio/node_modules/@wdio/runner/build/index.js:188:19)
    at process._tickCallback (internal/process/next_tick.js:68:7)%

To Reproduce
Follow the quick start instructions. This is private product that isn't released to the public yet, so I can't post a public url.

Expected behavior
I click on 'Execution video' and a video loads.

Environment (please complete the following information):

  • wdio-video-reporter version: 1.4.1
  • WebdriverIO version: 5.9.4
  • Mode: standalone
  • Node.js version: 10.15
  • NPM version: 6.9
  • Browser name and version: Chrome 74
  • Platform name and version: OSX

Desktop (please complete the following information):
same as above

Additional context
I don't really see any errors in any of the logs for allure or webdriverIO. I also don't see any network / console errors in chrome's debug mode of allure. The videos get created and play just fine in Quicktime, it feels like something isn't linking right from the browser to the underlying server maybe?

Reporter errors when test name is long (242 char limit)

Describe the bug
CI fails when test name is very long. On the CircleCI docker image I'm running the character limit is 242 characters for the file name. I have confirmed this manually by setting the test name such that the filename produced fails at 243 characters, but passes at 242.

This is very similar to presidenten#1. Instead of setting the limit to 250, it should be set to 242 or be a configurable option.

Error: ENAMETOOLONG: name too long, mkdir '/home/circleci/lgc/ui-xxxxxxxxx-components/results/videos/rawSeleniumVideoGrabs/xxx-xxx-xxx--xxxxxxxxx-text-wrapping-and-truncation--in-standard-cells--should-reset-wrap-text-for-cells-of-a-column-and-header-action-changed-to-Clip-Text-when-wrapText-is-changed-to-false-in-columnDefinition--CHROME--07-28-2020--23-50-45-981

To Reproduce
describe("abcsabcsabcsabcsabcsabcsabcsabcsabcsabcsabcsabcsabcsabcsabcsabcsabcsacaasddsdsdasdasdadaswd", function(){
it("abcsabcsabcsabcsabcsabcsabcsabcsabcsabcsabcsabcsabcsabcsabcsabcsabcsabcsabcsabcsabcsabcsabcsabcsabcsabcsabcsabcsabcsabcsabcsabcsabcsabcs", function() {
browser.url("https://webdriver.io");
assert.equal(1,2,"error");
});
});

Expected behavior
No errors when a test name is very long.

Environment (please complete the following information):

  • wdio-video-reporter version: 2.0.1
  • WebdriverIO version: 6.0.16
  • Mode: wdio testrunner
  • If WDIO Testrunner, running sync/async: sync
  • Node.js version: 12.16.2
  • NPM version: 6.14.4
  • Browser name and version: Chrome 80
  • Platform name and version: Linux

WebdriverIO fails to run with wdio-video-reporter

Have included the video section into my reporters array

reporters: ['spec',
    ['allure', {
      outputDir: 'tests/UI/reports/allure-results',
      disableWebdriverStepsReporting: true,
      disableWebdriverScreenshotsReporting: true,
      useCucumberStepReporter: true
    }]
    ,
    [video, {
      saveAllVideos: true,       // If true, also saves videos for successful test cases
      videoSlowdownMultiplier: 3, // Higher to get slower videos, lower for faster videos [Value 1-100]
      videoRenderTimeout: 5,      // Max seconds to wait for a video to finish rendering
      outputDir: "tests/UI/reports/errorVideos",
      logLevel: "debug"
    }],
    ,
    ['timeline', {
      outputDir: 'tests/UI/reports/timeline',
      fileName: "timeline-report.html",
      embedImages: true,
      images: {
        quality: 80,
        resize: false,
        reductionRation: 2
      },
      screenshotStrategy: 'none'
    }]
  ],

As well as adding to the const to the top of the wdio config, when I exectute my tests all my runners fail, when looking in my log file this is displayed

2020-02-25T11:03:48.071Z INFO @wdio/local-runner: Run worker command: run
2020-02-25T11:03:53.421Z ERROR @wdio/local-runner: Failed launching test session: TypeError: Cannot read property 'onSuiteStart' of undefined
    at Video.onSuiteStart (C:\Users\karl.hudgell\Documents\Work\UKRI\Code\CLEAN\ukri-tfs-opportunity-manager\node_modules\wdio-video-reporter\src\index.js:113:20)
    at Video.<anonymous> (C:\Users\karl.hudgell\Documents\Work\UKRI\Code\CLEAN\ukri-tfs-opportunity-manager\node_modules\@wdio\reporter\build\index.js:72:12)
    at Video.emit (events.js:223:5)
    at Video.EventEmitter.emit (domain.js:475:20)
    at C:\Users\karl.hudgell\Documents\Work\UKRI\Code\CLEAN\ukri-tfs-opportunity-manager\node_modules\@wdio\runner\build\reporter.js:38:49
    at Array.forEach (<anonymous>)
    at BaseReporter.emit (C:\Users\karl.hudgell\Documents\Work\UKRI\Code\CLEAN\ukri-tfs-opportunity-manager\node_modules\@wdio\runner\build\reporter.js:38:20)
    at CucumberReporter.emit (C:\Users\karl.hudgell\Documents\Work\UKRI\Code\CLEAN\ukri-tfs-opportunity-manager\node_modules\@wdio\cucumber-framework\build\reporter.js:179:19)
    at CucumberReporter.handleBeforeFeature (C:\Users\karl.hudgell\Documents\Work\UKRI\Code\CLEAN\ukri-tfs-opportunity-manager\node_modules\@wdio\cucumber-framework\build\reporter.js:34:10)
    at CucumberEventListener.emit (events.js:223:5)
    at CucumberEventListener.EventEmitter.emit (domain.js:475:20)
    at CucumberEventListener.onGherkinDocument (C:\Users\karl.hudgell\Documents\Work\UKRI\Code\CLEAN\ukri-tfs-opportunity-manager\node_modules\@wdio\cucumber-framework\build\cucumberEventListener.js:38:10)
    at EventEmitter.emit (events.js:223:5)
    at EventEmitter.emit (domain.js:475:20)
    at C:\Users\karl.hudgell\Documents\Work\UKRI\Code\CLEAN\ukri-tfs-opportunity-manager\node_modules\cucumber\lib\cli\helpers.js:114:24
    at Array.forEach (<anonymous>)

any idea?

Thanks

Move project to WebdriverIO Community Org

Hey @presidenten ,

first off, thank you for creating this plugin and extending the WebdriverIO ecosystem!

We have been looking into successful WDIO plugins like this one as we want to ensure that its development can be continued even if the original maintainer decides to move on. Therefore on behalf of the WebdriverIO community I would like to ask if you would be interested to move this repository into the WebdriverIO Community organisation. It would allow us to help maintain this package, automate a few things like releases and allow others to contribute to it and make the package even better. You would of course continue to have full access to it.

What do you think? Please let me know if you have any questions.

Frames from a previous test/suite are being added to the next test/suite

Describe the bug
The last frame from the previous test is incorrectly saved as the first frame of the current test.

On the last test, a screenshot was taken after the call to ffmpeg.

I'm not sure where to start looking to help diagnose this issue as it appears to be a sync problem.

Log
I have trimmed some of the incoming commands as I don't believe they add value.

--- New suite: Test Suite 1 ---


--- New test: Test 1 ---
Incoming command: /session/:sessionId/screenshot => [screenshot]
- Screenshot!! (frame: 0)
Incoming command: /session/:sessionId/screenshot => [screenshot]
- Screenshot!! (frame: 1)
Incoming command: /session/:sessionId/screenshot => [screenshot]
- Screenshot!! (frame: 2)
Incoming command: /session/:sessionId/screenshot => [screenshot]
- Screenshot!! (frame: 3)
ffmpeg command: "ffmpeg.exe" ...



--- New suite: Test Suite 2 ---


--- New test: Test 1 ---
Incoming command: /session/:sessionId/screenshot => [screenshot]
- Screenshot!! (frame: 4)
Incoming command: /session/:sessionId/screenshot => [screenshot]
- Screenshot!! (frame: 0)
Incoming command: /session/:sessionId/element/55a8bedc-cca0-4e40-bdfc-9f70884dec4b/text => [text]
ffmpeg command: "ffmpeg.exe" ...



--- New suite: Test Suite 3 ---


--- New test: Test 1 ---
Incoming command: /session/:sessionId/screenshot => [screenshot]
- Screenshot!! (frame: 1)
Incoming command: /session/:sessionId/screenshot => [screenshot]
- Screenshot!! (frame: 0)
ffmpeg command: "ffmpeg.exe" ...
Incoming command: /session/:sessionId/screenshot => [screenshot]
- Screenshot!! (frame: 1)
Incoming command: /session/:sessionId => [:sessionId]

To Reproduce
I'll attempt to create an example repo and update this issue soon

Expected behavior
Frames from a previous test/suite shouldn't be added to the current test/suite

Environment (please complete the following information):

  • wdio-video-reporter version: 3.4.0
  • WebdriverIO version: 8.0.13
  • Mode: WDIO Testrunner
  • If WDIO Testrunner, running sync/async: async
  • Node.js version: v18.12.1
  • NPM version: 8.19.2
  • Browser name and version: Chrome 109

Bypass screenshots when the video reporter is enabled

Is your feature request related to a problem? Please describe.
Looking into the cons under https://webdriver.io/docs/wdio-video-reporter/ as follows, the test cases are getting slower by enabling this feature.

Cons:
Works by taking screenshots after "actions", which makes the tests a little bit slower. This is mitigated by carefully choosing which jsonWireProtocol messages that should result in a screenshot

Describe the solution you'd like
The preferred solution would be to have a way to bypass the screenshots when the video reporter is enabled.

Describe alternatives you've considered
Having a way to disable the video reporter for normal executions, like a configuration attribute that could be set while running locally. For regular runs, the video reporter would be disabled, and we would use screenshots instead.

Other options
Having usage examples of addExcludedActions?

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.