I am trying to test a navigation menu by making CasperJS to click on different parts of the menu. After the first couple of clicks Slimerjs is hanging and after 5 minutes or so I'm getting the following error: addons.repository WARN cacheEnabled: Couldn't get pref: extensions.getAddons.cache.enabled".
This is how I run my test:
casperjs test tests/ --engine=slimerjs --verbose
And here's my code:
casper.test.begin('Deal menu is working as expected', 2, function suite(test) {
casper.start('http://username:password@somesite/section/home', function() {
test.assertTitle('Main Page', 'Main Page loaded');
casper.capture('mainPage.png');
});
casper.then(function() {
this.click('#menuId1');
this.wait(2000, function() {
test.assertTitle('Menu 1', 'Menu 1 loaded');
casper.capture('pic1.png');
});
});
casper.then(function() {
this.click('#menuId2');
this.wait(2000, function() {
test.assertTitle('Menu 2', 'Menu 2 loaded');
casper.capture('pic2.png');
});
});
casper.then(function() {
this.click('#menuId3');
this.wait(2000, function() {
test.assertTitle('Menu 3', 'Menu 3 loaded');
casper.capture('pic3.png');
});
});
casper.run(function() {
test.done();
});
});
After the second casper.then
it hangs and after a while it gives me the error message I mentioned above. I've also checked firefox (version 39) that extensions.getAddons.cache.enabled is equal to true.
When I run the same test with PhantomJS it works fine. Any ideas?