Skip to content
Projetos

SergeyPirogov/video-recorder-java

Ver no GitHub

Sobre

This library allows easily record video of your UI tests by just putting couple annotations.

Design e mídia

Como estes números são medidos

Crescimento medido de estrelas

em 24 h
0
em 7 dias
0
em 15 dias
0
em 1 mês
Coletando histórico

Variações líquidas em períodos sobrepostos, não totais diários. Medições ausentes ficam em branco. Estrelas indicam interesse, não qualidade.

README.md

Original

VideoRecorder

Build Status

This library allows easily record video of your UI tests by just putting couple annotations.

Supports popular Java test frameworks: JUnit, TestNg, Spock, Selenium Grid

<dependency>
  <groupId>com.automation-remarks</groupId>
  <artifactId>video-recorder-junit</artifactId>
  <version>LATEST</version>
</dependency>

Example with 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);
    }

    @Test
    @Video(name = "third_test", enabled = false)
    public void shouldFailWithoutRecording() {
        Thread.sleep(10000);
        assertTrue(false);
    }
}

Example with TestNG:

<dependency>
  <groupId>com.automation-remarks</groupId>
  <artifactId>video-recorder-testng</artifactId>
  <version>LATEST</version>
</dependency>

By default recorder will include testng dependency 7.4.0. If you want to place other version of TestNG use this declaration:

com.automation-remarks video-recorder-testng 2.1 org.testng 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 junit.framework.Assert.assertTrue;

@Listeners(VideoListener.class)
public class TestNgAnnotationTest {

    @Test
    @Video
    public void shouldFailAndCreateRecordWithTestName() {
        Thread.sleep(1000);
        assert false;
    }

    @Test
    @Video(name = "second_test")
    public void videoShouldHaveNameSecondTest(){
        Thread.sleep(1000);
        assertTrue(false);
    }

    @Test
    @Video(name = "third_test", enabled = false)
    public void shouldFailWithoutRecording() {
        Thread.sleep(1000);
        assertTrue(false);
    }
}

Remote Video Recording:

Build remote module:

./gradlew remote:jar

Run hub:

java -jar video-recorder-remote-1.0.jar -role hub -servlets "com.automation.remarks.remote.hub.Video"

Run node:

java -jar video-recorder-remote-1.0.jar -servlets "com.automation.remarks.remote.node.VideoServlet" -role node -port 5555 -hub "http://localhost:4444/grid/register"

TestNG + Remote Video recorder

Change listener in your tests to RemoteVideoListener:

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 junit.framework.Assert.assertTrue;

@Listeners(RemoteVideoListener.class)
public class TestNgAnnotationTest {

    @Test
    @Video
    public void shouldFailAndCreateRecordWithTestName() {
        Thread.sleep(1000);
        assert false;
    }

    @Test
    @Video(name = "second_test")
    public void videoShouldHaveNameSecondTest(){
        Thread.sleep(1000);
        assertTrue(false);
    }

    @Test
    @Video(name = "third_test", enabled = false)
    public void shouldFailWithoutRecording() {
        Thread.sleep(1000);
        assertTrue(false);
    }
}

more details

by automation-remarks.com

Explore projetos relacionados

Carregando…