use of ru.yandex.qatools.ashot.comparison.ImageDiff in project ashot by yandex-qatools.
the class DifferTest method testCoordsToCompareAndIgnoredCombine.
@Test
public void testCoordsToCompareAndIgnoredCombine() throws Exception {
Screenshot a = createScreenshotWithIgnoredAreas(IMAGE_A_SMALL, new HashSet<>(asList(new Coords(60, 60))));
a.setCoordsToCompare(new HashSet<>(asList(new Coords(50, 50, 100, 100))));
Screenshot b = createScreenshotWithIgnoredAreas(IMAGE_B_SMALL, new HashSet<>(asList(new Coords(80, 80))));
b.setCoordsToCompare(new HashSet<>(asList(new Coords(50, 50, 100, 100))));
ImageDiff diff = imageDiffer.makeDiff(a, b);
assertThat(diff.getMarkedImage(), ImageTool.equalImage(loadImage("img/expected/combined_diff.png")));
}
use of ru.yandex.qatools.ashot.comparison.ImageDiff in project ashot by yandex-qatools.
the class DifferTest method testEqualImagesWithWrongIgnoredColorDiff.
@Test
public void testEqualImagesWithWrongIgnoredColorDiff() throws Exception {
ImageDiffer imageDifferWithIgnored = new ImageDiffer().withIgnoredColor(Color.RED);
ImageDiff diff = imageDifferWithIgnored.makeDiff(IMAGE_IGNORED_TEMPLATE, IMAGE_IGNORED_PASS);
assertTrue(diff.hasDiff());
}
use of ru.yandex.qatools.ashot.comparison.ImageDiff in project ashot by yandex-qatools.
the class DifferTest method testNonEqualImagesWithIgnoredColorDiff.
@Test
public void testNonEqualImagesWithIgnoredColorDiff() throws Exception {
ImageDiffer imageDifferWithIgnored = new ImageDiffer().withIgnoredColor(Color.MAGENTA);
ImageDiff diff = imageDifferWithIgnored.makeDiff(IMAGE_IGNORED_TEMPLATE, IMAGE_IGNORED_FAIL);
assertTrue(diff.hasDiff());
}
use of ru.yandex.qatools.ashot.comparison.ImageDiff in project ashot by yandex-qatools.
the class DifferTest method testSetDiffColor.
@Test
public void testSetDiffColor() throws Exception {
ImageDiffer greenDiffer = new ImageDiffer().withDiffMarkupPolicy(new ImageMarkupPolicy().withDiffColor(Color.GREEN));
ImageDiff diff = greenDiffer.makeDiff(IMAGE_A_SMALL, IMAGE_B_SMALL);
assertThat(diff.getMarkedImage(), ImageTool.equalImage(loadImage("img/expected/green_diff.png")));
}
use of ru.yandex.qatools.ashot.comparison.ImageDiff in project ashot by yandex-qatools.
the class DifferTest method testTransparentImageWithMarkedDiff.
@Test
public void testTransparentImageWithMarkedDiff() {
ImageDiff imageDiff = imageDiffer.makeDiff(loadImage("img/A_s.png"), loadImage("img/B_s.png"));
assertThat(imageDiff.getTransparentMarkedImage(), ImageTool.equalImage(loadImage("img/expected/transparent_diff.png")));
}
Aggregations