Image assertion library

Image assertion library brings image comparison into automated testing.

License

License

Categories

Categories

Wire Data Data Structures
GroupId

GroupId

com.hotwire.image-assert
ArtifactId

ArtifactId

image-assert
Last Version

Last Version

1.0.5
Release Date

Release Date

Type

Type

jar
Description

Description

Image assertion library
Image assertion library brings image comparison into automated testing.

Download image-assert

How to add to project

<!-- https://jarcasting.com/artifacts/com.hotwire.image-assert/image-assert/ -->
<dependency>
    <groupId>com.hotwire.image-assert</groupId>
    <artifactId>image-assert</artifactId>
    <version>1.0.5</version>
</dependency>
// https://jarcasting.com/artifacts/com.hotwire.image-assert/image-assert/
implementation 'com.hotwire.image-assert:image-assert:1.0.5'
// https://jarcasting.com/artifacts/com.hotwire.image-assert/image-assert/
implementation ("com.hotwire.image-assert:image-assert:1.0.5")
'com.hotwire.image-assert:image-assert:jar:1.0.5'
<dependency org="com.hotwire.image-assert" name="image-assert" rev="1.0.5">
  <artifact name="image-assert" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.hotwire.image-assert', module='image-assert', version='1.0.5')
)
libraryDependencies += "com.hotwire.image-assert" % "image-assert" % "1.0.5"
[com.hotwire.image-assert/image-assert "1.0.5"]

Dependencies

compile (2)

Group / Artifact Type Version
org.jetbrains.kotlin : kotlin-stdlib jar 1.2.31
com.google.code.gson : gson jar 2.8.2

Project Modules

There are no modules declared in this project.

Build Status Download

System requirements

ImageMagick 6.9.0+ must be installed and added to PATH variable

Dependencies

Maven
<dependency>
	<groupId>com.hotwire.image-assert</groupId>
	<artifactId>image-assert</artifactId>
	<version>1.0.5</version>
</dependency>
Gradle
'com.hotwire.image-assert:image-assert:1.0.5'

Usage

Approach and syntax are similar to FEST-Assert library. Use static method assertThat() to create ImageAssert instance. By default, ImageAssert instance does not report comparison results neither throws an exception, so you will need to provide one or multiple listeners using reportingTo() method.

Examples

You can create an ImageAssert instance and use chained calls to compare two images:

    ImageAssert.assertThat(screenshot)
            .reportingTo(ThrowExceptionResultListener())
            .isEqualTo(resource);

Alternatively, you can create a method to return a pre-configured instance of ImageAssert:

    ImageAssert assertThat(Image image) {
        return ImageAssert.assertThat(image)
                .reportingTo(PrintStreamResultListener())
                .reportingTo(ThrowExceptionResultListener())
    }

and then use it instead of static method (static methods are awful, right?):

    assertThat(screenshot())
        .isEqualTo(resource());
com.hotwire.image-assert

Hotwire

Find 4-star hotels at 2-star prices

Versions

Version
1.0.5
1.0.4
1.0.3
1.0.2