use of com.seleniumtests.util.imaging.ImageDetector in project seleniumRobot by bhecquet.
the class TestImageDetector method searchPicturesByTemplateNoMatching.
@Test(groups = { "ut" }, expectedExceptions = ImageSearchException.class)
public void searchPicturesByTemplateNoMatching() throws IOException {
ImageDetector detector = new ImageDetector(createFileFromResource("tu/images/p9.png"), createFileFromResource("tu/images/creditMutuelLogo.png"), 0.06);
detector.detectExactZoneWithScale();
Assert.assertEquals(detector.getSizeRatio(), 1.0, 0.05);
}
use of com.seleniumtests.util.imaging.ImageDetector in project seleniumRobot by bhecquet.
the class TestImageDetector method searchPictureWithoutRotation.
/**
* Search an image inside an other one, no rotation, no resizing
* @throws IOException
*/
@Test(groups = { "ut" }, enabled = false)
public void searchPictureWithoutRotation() throws IOException {
ImageDetector detector = new ImageDetector(createFileFromResource("tu/images/RIB.png"), createFileFromResource("tu/images/creditMutuelLogo.png"));
detector.detectCorrespondingZone();
Assert.assertEquals(detector.getRotationAngle(), 0);
Assert.assertEquals(detector.getDetectedRectangle(), new Rectangle(604, 147, 76, 492));
}
use of com.seleniumtests.util.imaging.ImageDetector in project seleniumRobot by bhecquet.
the class TestImageDetector method searchExactPictureNoDetection.
/**
* Search an image with template matching. Here, image should not be found
* @throws IOException
*/
@Test(groups = { "ut" }, expectedExceptions = ImageSearchException.class)
public void searchExactPictureNoDetection() throws IOException {
ImageDetector detector = new ImageDetector(createFileFromResource("tu/images/RIB.png"), createFileFromResource("tu/images/vosAlertes.png"));
detector.detectExactZoneWithScale();
}
use of com.seleniumtests.util.imaging.ImageDetector in project seleniumRobot by bhecquet.
the class TestImageDetector method searchPicturesByTemplate4.
// highly detailed
@Test(groups = { "ut" })
public void searchPicturesByTemplate4() throws IOException {
ImageDetector detector = new ImageDetector(createFileFromResource("tu/images/RIB.png"), createFileFromResource("tu/images/creditMutuelLogo.png"), 0.06);
detector.detectExactZoneWithScale();
Assert.assertEquals(detector.getDetectedRectangle(), new Rectangle(604, 147, 77, 493));
Assert.assertEquals(detector.getSizeRatio(), 1.0, 0.05);
}
use of com.seleniumtests.util.imaging.ImageDetector in project seleniumRobot by bhecquet.
the class TestImageDetector method searchPicturesByTemplate3.
// small object
@Test(groups = { "ut" })
public void searchPicturesByTemplate3() throws IOException {
ImageDetector detector = new ImageDetector(createFileFromResource("tu/images/infolidays.png"), createFileFromResource("tu/images/bouton_enregistrer3.png"), 0.06);
detector.detectExactZoneWithScale();
Assert.assertEquals(detector.getDetectedRectangle(), new Rectangle(677, 1595, 220, 155));
Assert.assertEquals(detector.getSizeRatio(), 1.2, 0.05);
}
Aggregations