All Projects → webdriverio-community → wdio-video-reporter

webdriverio-community / wdio-video-reporter

Licence: MIT License
Reporter for WebdriverIO v6 that makes videos of failed tests and has optional allure integration

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to wdio-video-reporter

frameworkium-examples
Sample project which utilises frameworkium-core, a framework for writing maintainable Selenium and REST API tests and facilitates reporting and integration to JIRA.
Stars: ✭ 52 (-3.7%)
Mutual labels:  allure, selenium-webdriver
PWAF
Python Webdriver Automation Framework
Stars: ✭ 37 (-31.48%)
Mutual labels:  selenium-webdriver
html-dnd
HTML Drag and Drop Simulator for E2E testing
Stars: ✭ 53 (-1.85%)
Mutual labels:  selenium-webdriver
Z-Spider
一些爬虫开发的技巧和案例
Stars: ✭ 33 (-38.89%)
Mutual labels:  selenium-webdriver
gatf
Generic Automated Test Framework For API/UI/RPA/Load Testing
Stars: ✭ 15 (-72.22%)
Mutual labels:  selenium-webdriver
kick-off-web-scraping-python-selenium-beautifulsoup
A tutorial-based introduction to web scraping with Python.
Stars: ✭ 18 (-66.67%)
Mutual labels:  selenium-webdriver
tees
Universal test framework for front-end with WebDriver, Puppeteer and Enzyme
Stars: ✭ 23 (-57.41%)
Mutual labels:  selenium-webdriver
allure-rspec
Deprecated, use https://github.com/allure-framework/allure-ruby instead
Stars: ✭ 30 (-44.44%)
Mutual labels:  allure
PaperScraper
A web scraping tool to systematically extract the text of scientific papers and corresponding metadata from university accessible journals.
Stars: ✭ 63 (+16.67%)
Mutual labels:  selenium-webdriver
OneFramework
Automation for iOS, Android, & Web Apps with one codebase. Like it, Star it & spread the word !!!
Stars: ✭ 46 (-14.81%)
Mutual labels:  selenium-webdriver
python-page-object
📔 Page object design pattern implementation (python, pom, selenium, pytest, travisCI)
Stars: ✭ 41 (-24.07%)
Mutual labels:  selenium-webdriver
weibo-porter
微博搬运姬,自动搬运B博动态至微博的机器人
Stars: ✭ 53 (-1.85%)
Mutual labels:  selenium-webdriver
headless-chrome
Implementation of the new headless chrome with chromedriver and selenium.
Stars: ✭ 34 (-37.04%)
Mutual labels:  selenium-webdriver
mediaforge
A Discord bot for editing and creating videos, images, GIFs, and more!
Stars: ✭ 45 (-16.67%)
Mutual labels:  selenium-webdriver
page-modeller
⚙️ Browser DevTools extension for modelling web pages for automation.
Stars: ✭ 66 (+22.22%)
Mutual labels:  selenium-webdriver
SeleniumCucumber
BDD framework for automation using Selenium Cucumber and TestNg
Stars: ✭ 48 (-11.11%)
Mutual labels:  selenium-webdriver
Selenium.WebDriver.Extensions
Extensions for Selenium WebDriver including jQuery/Sizzle selector support.
Stars: ✭ 46 (-14.81%)
Mutual labels:  selenium-webdriver
Auto-Download-QQMail-Attach
Python + Selenium + Chrome 模拟登陆QQ邮箱,批量下载附件,本地重命名
Stars: ✭ 38 (-29.63%)
Mutual labels:  selenium-webdriver
LBDuoDian
No description or website provided.
Stars: ✭ 21 (-61.11%)
Mutual labels:  selenium-webdriver
Python-Test-Automation-Framework
Test Automation Framework using selenium and Python
Stars: ✭ 41 (-24.07%)
Mutual labels:  allure

wdio-video-reporter Build Status test MIT license

Logo

This is a reporter for Webdriver IO v6 and highr that generates videos of your wdio test executions. If you use allure, then the test cases automatically get decorated with the videos as well. (For Webdriver IO v5, please use wdio-video-reporter version ^2.0.0.)

Videos ends up in wdio.config.outputDir

Checkout example Allure report with included videos on failed tests here: https://presidenten.github.io/wdio-video-reporter-example-report/

example-allure-report

Pros:

  • Nice videos in your allure reports
  • Nice human speed videos, even though tests are fast
  • Works with Selenium grid
  • Works with all webdrivers that support saveScreenshot
  • Verified on the following Deskop browsers using Selenium 3.141.59:
    • Chrome
    • Firefox
    • Safari
    • Internet Explorer 11
    • Microsoft Edge
  • Verified on the following ios and android devices with Appium 1.13.0-beta3:
    • Iphone 8
    • Ipad Gen 6
    • Samsung galaxy S9
    • Samsung galaxy tab A10

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
  • Selenium drivers doesn't include alert-boxes and popups in screenshots, so they are not visible in the videos

Quick start

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

Installation

Install the reporter

yarn add wdio-video-reporter or npm install wdio-video-reporter

Add the reporter to config

At the top of the wdio.conf.js-file, require the library:

const video = require('wdio-video-reporter');

Then add the video reporter to the configuration in the reporters property:

 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]
    }],
  ],

Using with Allure

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,
    }],
  ],

Using with wdio-html-nice-reporter (https://github.com/rpii/wdio-html-reporter)

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

Normal configuration parameters

Most users may want to set these

  • saveAllVideos Set to true to save videos for passing tests. Default: false
  • videoSlowdownMultiplier Integer between [1-100]. Increase if videos are playing to quick. Default: 3
  • videoRenderTimeout Max seconds to wait for a video to render. Default: 5
  • outputDir If its not set, it uses wdio.config.outputDir. Default: undefined
  • outputDir If its not set, it uses wdio.config.outputDir. Default: undefined
  • maxTestNameCharacters Max length of test name. Default: 250

Advanced configuration parameters

Advanced users who want to change when the engine makes a screengrab can edit these. These arrays may be populated with the last word of a jsonWireProtocol message, i.e. /session/:sessionId/buttondown.

  • addExcludedActions Add actions where screenshots are unnecessary. Default: []
  • addJsonWireActions Add actions where screenshots are missing. Default: []
  • recordAllActions Skip filtering and screenshot everything. (Not recommended) Default: false

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

To avoid extra logging all together and only get the video files, set wdio.config.logLevel: 'silent'.

Cucumber support

If you are using the Allure reporter, you need to ensure you do the following:

  • Use chai instead of using the built-in node assertions otherwise the failed tests gets reported as broken in your steps definitions
  • 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, checkout the cucumber branch at the wdio-template

Appium setup

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 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 deviceType added to the browser name.

Example appium configuration:

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

And wdio-config.json:

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

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 alot of users have asked for.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].