= Video Recorder :toc: left
image:https://travis-ci.org/SergeyPirogov/video-recorder-java.svg?branch=master["Build Status", link="https://travis-ci.org/SergeyPirogov/video-recorder-java"]
This library allows easily record video of your UI tests by just putting couple annotations.
http://sergeypirogov.github.io/video-recorder-java/[Documentation]
Supports popular Java test frameworks:
== JUnit Rule:
import com.automation.remarks.video.annotations.Video;
import com.automation.remarks.video.junit.VideoRule;
import org.junit.Rule;
import org.junit.Test;
import static junit.framework.Assert.assertTrue;
public class JUnitVideoTest {
@Rule
public VideoRule videoRule = new VideoRule();
@Test
@Video
public void shouldFailAndCreateRecordWithTestName() {
Thread.sleep(5000);
assert false;
}
@Test
@Video(name = "second_test")
public void videoShouldHaveNameSecondTest() {
Thread.sleep(10000);
assertTrue(false);
}
JUnit 5
[source,java]
import com.automation.remarks.junit5.Video;
public class JUnitVideoTest {
@Test
@Video
public void shouldFailAndCreateRecordWithTestName() {
Thread.sleep(5000);
assert false;
}
@Test
@Video(name = "second_test")
public void videoShouldHaveNameSecondTest() {
Thread.sleep(10000);
assertTrue(false);
}
== TestNG:
import com.automation.remarks.video.annotations.Video;
import com.automation.remarks.video.testng.VideoListener;
import org.testng.annotations.Listeners;
import org.testng.annotations.Test;
import static org.testng.Assert.assertTrue;
@Listeners(UniversalVideoListener.class) public class TestNgVideoTest {
@Test
@Video
public void shouldFailAndCreateRecordWithTestName() {
Thread.sleep(1000);
assert false;
}
@Test
@Video(name = "second_test")
public void videoShouldHaveNameSecondTest(){
Thread.sleep(1000);
assertTrue(false);
}
== Configuration
You are able to set some configuration parameters for Video Recorder.
Create properties file video.properties in classpath:
or with maven
=== FFMPEG recorder configuration
In order to use ffmpeg type recorder first you need to perform such steps:
==== Linux or Mac
Need to install https://www.ffmpeg.org/download.html[ffmpeg recorder]
On ubuntu you can do it using such command:
For Mac just use brew:
==== Windows
In case of Windows platform you need to download https://www.ffmpeg.org/download.html[ffmpeg]
Just download it and unzip to some folder on you PC. Example C:\ffmpeg
Then set System variable path for ffmpeg. http://www.computerhope.com/issues/ch000549.htm[Example]
Example: add to PATH variable ;C:\ffmpeg\bin
Also you need to https://github.com/SergeyPirogov/video-recorder-java/raw/master/core/src/main/resources/SendSignalCtrlC.exe[download SendSignalCtrlC.exe] utility and put into the folder ffmpeg/bin.
The final result should be folder with ffmpeg, SendSignalCtrlC.exe utilities and System variable that point to this folder.
To be sure that everything works properly, open CMD and perform first command:
ffmpeg
C:\Users\sepi>ffmpeg ffmpeg version N-81234-ge1be80a Copyright (c) 2000-2016 the FFmpeg developers built with gcc 5.4.0 (GCC) configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-dxva2 --enable-libmfx --enable-nvenc --enable-avisynth --enable-bzlib --enable-libebur128 --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-lzma --enable-decklink --enable-zlib libavutil 55. 28.100 / 55. 28.100 libavcodec 57. 51.100 / 57. 51.100 libavformat 57. 44.100 / 57. 44.100 libavdevice 57. 0.102 / 57. 0.102 libavfilter 6. 49.100 / 6. 49.100 libswscale 4. 1.100 / 4. 1.100 libswresample 2. 1.100 / 2. 1.100 libpostproc 54. 0.100 / 54. 0.100 Hyper fast Audio and Video encoder usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}...
Than execute in CMD another command:
SendSignalCtrlC
C:\Users\sepi>SendSignalCtrlC
SendSignalCtrlC