Skip to content

otto-de/jlineup

Repository files navigation

Status

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

News

2024-04-10: JLineup 4.10.0 is out! This release contains dependency updates and the brand-new Lambda module. It allows you to run the screenshot creation in a lambda function, and it can speed up the process significantly. We have this running in an internal beta. Documentation will follow soon.

2023-12-19: Ho ho ho, JLineup 4.9.2 is here! This should fix the flaky Chrome issue with problems parsing a JSON response.

2023-08-16: JLineup 4.9.0, which fixes latest Chromedriver issues, requires Java 17 or later due to dependency updates that have this requirement.

2023-03-09: Chrome 111 requires a new parameter to fix the connection with the current Selenium version built into JLineup. This was added in JLineup 4.8.3. Background information may be found in this thread.

2023-02-14: Chrome 110 replaced the "old" --headless parameter, that was used by JLineup. If you face problems with CHROME_HEADLESS runs, please update to JLineup 4.8.3, which uses the new --headless=new parameter. Chrome headless mode's device size specifications now include the Browser controls and the window frame, except you switch to mobile emulation.

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.10.0/jlineup-cli-4.10.0.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.10.0 was tested successfully with

  • Chrome 123.x
  • Firefox 124.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

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