Привет. Подскажите пожалуйста, не получается игнорировать элементы в ashot
Мой метод
public void takeScreenshot( String locator, Set<By> bySet) throws IOException {
WebDriver driver = WebDriverRunner.getWebDriver();
Screenshot newScreenshot =
(Screenshot) new AShot().coordsProvider(new WebDriverCoordsProvider())
.shootingStrategy(ShootingStrategies.viewportPasting(100))
.ignoredElements(bySet)
.takeScreenshot(driver, $(objMap.getLocator(locator)));
Set<Coords> ignoredCoords = newScreenshot.getIgnoredAreas();
File actualImage = new File(pathActualScreenshot);
ImageIO.write(newScreenshot.getImage(), "png", actualImage);
Screenshot expectedScreenshot =
new Screenshot(ImageIO.read(new File(pathExpectedScreenshot)));
expectedScreenshot.setIgnoredAreas(ignoredCoords);
ImageDiff diff = new ImageDiffer().makeDiff(newScreenshot, expectedScreenshot);
BufferedImage diffImage = diff.getMarkedImage();
createImageFromBuffer(diffImage, pathDiffScreenshot);
Assert.assertEquals(0, diff.getDiffSize());
}
Тест
public void test2() throws IOException {
Set<By> bySet = new HashSet<>();
page.takeScreenshot(".formDelt",
bySet);
bySet.add(By.cssSelector(".details_block"));
}
Тест проходит, а " .details_block" не игнорируется