I'm trying to add visual comparison tests to my layouts but it seems I've not configured my testing environment correctly.
I'm using:
This is my test JS file:
var url, screenshotRoot, modules, phantomCSS, page;
url = 'http://website.local';
screenshotRoot = 'tests/screenshots';
modules = '../node_modules';
phantomCSS = require(modules + '/phantomcss/phantomcss.js');
page = { width: 1024, height: 768 };
phantomCSS.init({
screenshotRoot: screenshotRoot,
failedComparisonsRoot: screenshotRoot + '/failures',
libraryRoot: modules + '/phantomcss',
});
casper
.start(url)
.then(function() {
phantomCSS.screenshot("body", "elements-cheatsheet");
})
.then(function() {
phantomCSS.compareAll();
})
.run(function() {
phantom.exit(phantomCSS.getExitStatus());
});
casper.viewport(page.width, page.height);
When I run casperjs test tests/layout.js
the test starts, creates the screenshot and throws an error:
[PhantomCSS] Can't find Resemble container. Perhaps the library root is mis configured. (../node_modules/phantomcss/ResembleJs/resemblejscontainer.html)
I've checked the location of resemblejscontainer.html
file and it's exactly in the location listed in the thrown error.
Where I'm wrong?