I am trying to use image comparison feature of galen. In order to get expected images for my test, i used page dump feature as recommended. However, i am not getting the right image of the element specified in the spec file. To explain things in detail this is what i did for galenframework website:
1) My test.js looks like this -
test("Galen page", function() {
"1366x885");
sleep(8000);
dumpPage({
driver: driver,
name: "Galen page",
spec: "specs/galen_site.gspec",
exportPath: "dumps/galenpage",
onlyImages: true
});
function sleep(delay) {
var start = new Date().getTime();
while (new Date().getTime() < start + delay);
}
});
2) galen_site.gspec looks like this -
@objects
selenium_grid_image xpath (//img[contains(@class,'home-slide')])[2]
responsive_design_image xpath (//img[contains(@class,'home-slide')])[3]
3) I made following changes to galen.config -
galen.browser.screenshots.fullPage = true
galen.browser.screenshots.fullPage.scrollWait = 5000
When i run the test file i get following images -
-> responsive_design_image.png

-> selenium_grid_image.png

-> screen.img

These are obviously wrong images. Also as you see in screen.png there are duplicated elements of the page being displayed. I think galen keeps scrolling and keeps taking screenshots and then attaches it all together resulting in duplicate data/images being shown and probably that's the same reason why incorrect images appear in the page dumps. Is there a way to get around this problem. I would really like to use the image comparison feature provided in Galen
Thanks in advance.