GithubHelp home page GithubHelp logo

otto-de / jlineup Goto Github PK

View Code? Open in Web Editor NEW
76.0 11.0 17.0 50.13 MB

An easy-to-use visual acceptance test tool to automatically detect design changes of your website. Works on the command line or as a web service.

License: Apache License 2.0

Java 88.33% Shell 0.97% HTML 10.09% Dockerfile 0.62%
test-automation continuous-integration continuous-deployment frontend-testing headless acceptance-testing visual-acceptance-testing

jlineup's Introduction

Status

Build Maven Central Maven Central GitHub release (latest by date)

About

JLineup is a tool which is useful for automated visual regression tests of web pages, especially in continuous delivery pipelines. It can be used as a simple command line tool or as a small web service which is controlled via REST API.

JLineup shoots and compares screenshots of a web page at two consecutive points in time. It does a pixel by pixel comparison of both runs and generates a HTML and a JSON report. Behind the scenes, it uses Selenium and a browser of choice (currently Chrome, Chromium and Firefox are supported).

JLineup has no other dependencies than web browser (Firefox or Chrome/Chromium) and a JVM. Experimental: There's also a self-contained Linux AMD64 build of the CLI version that doesn't even require a JVM.

Example

Let's take this little example config for a check of otto.de during a deployment:

{
  "urls": {
    "https://www.otto.de": {
      "paths": [ 
	    "/"
      ],
      "devices" : [ {
        "width" : 850,
        "height" : 600,
        "pixel-ratio" : 1.0,
        "device-name" : "DESKTOP",
        "touch" : false
      }, {
        "width" : 1000,
        "height" : 850,
        "pixel-ratio" : 1.0,
        "device-name" : "DESKTOP",
        "touch" : false
      }, {
        "width" : 1200,
        "height" : 1000,
        "pixel-ratio" : 1.0,
        "device-name" : "DESKTOP",
        "touch" : false
      } ]
    }
  },
  "wait-after-page-load" : 0.5,
  "browser" : "chrome-headless"
}

JLineup runs before and after the deployment and generates a report like this:

Screenshot of HTML report

There's also a JSON report, which is great if you want to check things by script:

Example JLineup JSON Report

Quick Howto

JLineup CLI comes as executable Java Archive. Java 17 or higher has to be available to run it.

Open a terminal and download it like this:

wget https://repo1.maven.org/maven2/de/otto/jlineup-cli/4.12.1/jlineup-cli-4.12.1.jar -O jlineup.jar

Then type

java -jar jlineup.jar --help

to see the command line help.

See the CLI documentation for more details and a small tutorial.

Integration example

This is an example, how JLineup can be helpful in your automated build and deploy pipeline. Let's assume, this is part of a continuous integration pipeline:

Pipeline exampe

Browser Compatibility

JLineup 4.11 was tested successfully with

  • Chrome 126.x
  • Firefox 127.x

Chrome or Firefox have to be installed on the system if you want to use one of them.

Documentation

JLineup as CLI tool

JLineup as web server

JLineup Job Configuration

Third Party Libraries

JLineup uses some third party tools and libraries

Selenium
Webdrivermanager
Jackson
Logback
Thymeleaf
Edison Microservice
Spring Boot
GraalVM Community Edition
Image Compare Viewer
Google Fonts
AWS SDK
Pixelmatch

Some code from Pixelmatch was ported to Java for JLineup.

Looks-same

Some code from Looks-same was ported to Java for JLineup.

Historic Facts

JLineup is a configuration compatible replacement for Lineup, implemented in Java. The original Lineup was a Ruby tool, but is not maintained any more.

Credit for original Lineup goes to Finn Lorbeer.

Contact

If you have questions or proposals, please open an issue or write an email to marco DOT geweke AT otto.de

jlineup's People

Contributors

dependabot[bot] avatar ewoelfel avatar frankbregulla1111 avatar ftorkler avatar mediamarco avatar michaelkoelbl1011 avatar ralfwarfelmann0815 avatar snyk-bot avatar stefandenner 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  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

jlineup's Issues

Does the max-diff value gets rounded internally?

I have a comparision with a very small difference value (0.00036101398601399). When I use exactly that value for the max-diff config value, the check fails. Increasing it to something like 0.00037101398601399 works, so I wondered if there is some rounding done internally?

after step does not recognice existing before step when running with delay

Hi,

I just noticed a strange behavior that seems to be existing since 4.4.0. 4.3.4 works fine:

I build a service that runs two comparisions: one where the after step runs right after the before step (no issues), and one where the before step runs, then some software updates are triggered, and after the updates are finished (might take a few minutes), the after step is exectued. This works with 4.3.4, but since 4.4.0, the after step seems to not notice the before step. It just creates additional folders for the screenshots, instead of adding the after screenshots in the folders created by the before step, and the report.json only contains screenshot-after-file-name entries, screenshot-before-file-name is null.

Persistence

JLineup Web doesn't have any persistence besides the screenshots and the generated reports on disk. To make it possible to restart the server without loosing currently running or pending jobs, we need a persistence.

report.json beinhaltet nicht das max-diff

In der report.json fehlt momentan die Information ob ein Test fehlgeschlagen ist. Es wird zwar das difference ausgewiesen, dieses muss dann aber manuell wieder gegen das max-dif aus der lineup.json verglichen werden. Wäre es nicht Sinnvoll ein failure Status oder das max-diff auch in das report.json mit aufzunehmen?

Gruß
David

Create a readme.md file

Hi
Could you create a readme.md file to help with the start and using the jlineup tool and some tips as to how would you use it and also test scenarios where some page interaction is required to go to the desired page like login or click or something else ??

thanks ....

Create a web frontend for jobs

The webserver part of JLineup should have a nice overview of running and recent Jobs. At the moment, the edison status detail indicator is (mis)used for this.

Make job errors accessible through the job status

At the moment, errors and exceptions, that are thrown during a JLineup web run, go to the configured log on the web server. It would be nice to have at least the root error cause in the job status.

Reveal run id after before run

It would be great to retrieve the 'before' run id after requesting the /runs endpoint either via body response or redirect in order to get the url to request for the 'after' phase

faulty dependency in 3.0.0-rc1 pom

In the pom of 3.0.0-rc1 jlineup-core is not properly referenced.
Is:

<dependency>
    <groupId>de.otto</groupId>
    <artifactId>core</artifactId>
    <version>3.0.0-rc1</version>
    <scope>compile</scope>
</dependency>

Should:

<dependency>
    <groupId>de.otto</groupId>
    <artifactId>jlineup-core</artifactId>
    <version>3.0.0-rc1</version>
    <scope>compile</scope>
</dependency>

This leads to problems if you want to use jlineup in gradle:
Execution failed for task ':jlineupBefore'.

Could not resolve all files for configuration ':runtime'.
> Could not find de.otto:core:3.0.0-rc1.
Searched in the following locations:
https://repo1.maven.org/maven2/de/otto/core/3.0.0-rc1/core-3.0.0-rc1.pom
https://repo1.maven.org/maven2/de/otto/core/3.0.0-rc1/core-3.0.0-rc1.jar
Required by:
project : > de.otto:jlineup:3.0.0-rc1

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.