Giter Site home page Giter Site logo

mred14 / selenium2-visualdiff Goto Github PK

View Code? Open in Web Editor NEW

This project forked from kreyssel/selenium2-visualdiff

0.0 0.0 0.0 176 KB

Selenium 2 Visual Diff

Home Page: kreyssel.github.com/selenium2-visualdiff/visualdiff.html

License: Apache License 2.0

Java 100.00%

selenium2-visualdiff's Introduction

Selenium Visual Diff

Goal

The goal is a better integration of screenshots taking in maven executed selenium2 functional tests, storing and versioning of screenshots to get a report of visual differences between two application versions.

Report

See sample report http://kreyssel.github.com/selenium2-visualdiff/visualdiff.html.

Usage

Embed jUnit4 and the selenium2-visualdiff core library as dependencies in your funtional test maven module:

<dependencies>
    ...
    <dependency>
        <groupId>org.kreyssel.selenium2.visualdiff</groupId>
        <artifactId>visualdiff-core</artifactId>
        <version>1.0.0-SNAPSHOT</version>
        <scope>test</scope>
    </dependency>
    ...
</dependencies>

Add the selenium2-visualdiff-maven-plugin to the maven module:

<plugins>
    ...
    <plugin>
        <groupId>org.kreyssel.selenium2.visualdiff</groupId>
        <artifactId>visualdiff-maven-plugin</artifactId>
        <version>1.0.0-SNAPSHOT</version>
        <executions>
            <execution>
                <goals>
                    <goal>prepare</goal>
                    <goal>package</goal>
                </goals>
            </execution>
        </executions>
    </plugin>
    ...
</plugins>

And after all, embed org.kreyssel.selenium2.visualdiff.core.junit4.TakesScreenshotRule in your functional test:

package org.kreyssel.selenium2.visualdiff.it;

import org.kreyssel.selenium2.visualdiff.core.junit4.TakesScreenshotRule;

/**
 * SimpleSeleniumIT.
 */
public class SimpleSeleniumIT {

    @Rule
    public TakesScreenshotRule screenshot = new TakesScreenshotRule();
  
    RemoteWebDriver driver;
  
    @Before
    public void init() {
      driver = createDriver();
    }
  
    @After
    public void destroy() {
      driver.close();
    }
      
    @Test
    public void test1() throws Exception {
        driver.get( "http://localhost:8080" );

        screenshot.takeScreenshot( driver );
    }
}

After the executions of functional tests in a maven run, all screenshots taken at this time are packaged as zip and attached to the build as ${project.build.finalName}-screenshots.zip. This archive is deployed to maven repository in the deploy phase of the maven build.

The selenium2-visualdiff report plugin generates a report that shows you the different screens per testcase compared to the previous release.

selenium2-visualdiff's People

Contributors

kreyssel avatar

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.