Search in sources :

Example 11 with ImageDiff

use of ru.yandex.qatools.ashot.comparison.ImageDiff in project ashot by yandex-qatools.

the class DifferTest method testDifferentSizeDiff.

@Test
public void testDifferentSizeDiff() throws Exception {
    ImageDiff diff = imageDiffer.makeDiff(IMAGE_B_SMALL, IMAGE_B_BIG);
    assertThat(diff.getMarkedImage(), ImageTool.equalImage(loadImage("img/expected/different_size_diff.png")));
}
Also used : ImageDiff(ru.yandex.qatools.ashot.comparison.ImageDiff) Test(org.junit.Test)

Example 12 with ImageDiff

use of ru.yandex.qatools.ashot.comparison.ImageDiff in project ashot by yandex-qatools.

the class DifferTest method testSetDiffSizeTrigger.

@Test
public void testSetDiffSizeTrigger() throws Exception {
    ImageDiff diff = imageDiffer.makeDiff(IMAGE_A_SMALL, IMAGE_B_SMALL);
    assertThat(diff.withDiffSizeTrigger(624).hasDiff(), is(false));
    assertThat(diff.withDiffSizeTrigger(623).hasDiff(), is(true));
}
Also used : ImageDiff(ru.yandex.qatools.ashot.comparison.ImageDiff) Test(org.junit.Test)

Example 13 with ImageDiff

use of ru.yandex.qatools.ashot.comparison.ImageDiff in project ashot by yandex-qatools.

the class DifferTest method testIgnoredCoordsSame.

@Test
public void testIgnoredCoordsSame() throws Exception {
    Screenshot a = createScreenshotWithSameIgnoredAreas(IMAGE_A_SMALL);
    Screenshot b = createScreenshotWithSameIgnoredAreas(IMAGE_B_SMALL);
    ImageDiff diff = imageDiffer.makeDiff(a, b);
    assertThat(diff.getMarkedImage(), ImageTool.equalImage(loadImage("img/expected/ignore_coords_same.png")));
}
Also used : ImageDiff(ru.yandex.qatools.ashot.comparison.ImageDiff) Screenshot(ru.yandex.qatools.ashot.Screenshot) Test(org.junit.Test)

Example 14 with ImageDiff

use of ru.yandex.qatools.ashot.comparison.ImageDiff in project ashot by yandex-qatools.

the class DifferTest method testIgnoredCoordsNotSame.

@Test
public void testIgnoredCoordsNotSame() throws Exception {
    Screenshot a = createScreenshotWithIgnoredAreas(IMAGE_A_SMALL, new HashSet<>(asList(new Coords(55, 55))));
    Screenshot b = createScreenshotWithIgnoredAreas(IMAGE_B_SMALL, new HashSet<>(asList(new Coords(80, 80))));
    ImageDiff diff = imageDiffer.makeDiff(a, b);
    assertThat(diff.getMarkedImage(), ImageTool.equalImage(loadImage("img/expected/ignore_coords_not_same.png")));
}
Also used : ImageDiff(ru.yandex.qatools.ashot.comparison.ImageDiff) Screenshot(ru.yandex.qatools.ashot.Screenshot) Coords(ru.yandex.qatools.ashot.coordinates.Coords) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)14 ImageDiff (ru.yandex.qatools.ashot.comparison.ImageDiff)14 ImageDiffer (ru.yandex.qatools.ashot.comparison.ImageDiffer)5 Screenshot (ru.yandex.qatools.ashot.Screenshot)3 BufferedImage (java.awt.image.BufferedImage)2 Coords (ru.yandex.qatools.ashot.coordinates.Coords)2 ImageMarkupPolicy (ru.yandex.qatools.ashot.comparison.ImageMarkupPolicy)1 FixedCutStrategy (ru.yandex.qatools.ashot.shooting.cutter.FixedCutStrategy)1