2

I wrote a few tests with casperjs. They run just fine with phantomjs. However, when I tried to use slimerjs with the following command:

casperjs --verbose --engine=slimerjs test create-project-suite.js

A small window appers with the SlimerJs logo and version number but the console seems to hang with the following line:

Test file: create-project-suite.js      

Is there anything else I need to do? Here are the version numbers:

Mozilla Firefox 28.0
CasperJS version 1.1.0-beta3
Innophi SlimerJS 0.9.1
3.8.0-37-generic #53~precise1-Ubuntu

Update:

I removed code until I got slimerjs to open the browser and execute tests. It seems that it hangs whenever I require a js file (I'm following the page objects pattern):

var Login = require('./objects/login');

I think require.paths could be helpful. Any ideas on how to get around this?

Ulises
  • 13,229
  • 5
  • 34
  • 50

2 Answers2

4

Using full paths makes slimerjs happy:

var path = fs.absolute(fs.workingDirectory + '/objects/login');
var Login = require(path);

It is plain simpler to move all modules to the same directory where the script is.

Ulises
  • 13,229
  • 5
  • 34
  • 50
  • Yes, i got the same problem with my includes and imports. Example : upload a picture in a form-media- (avatar). With slimer, I had to specify the full path, even if the jpeg file was in the current folder. – Fanch Mar 27 '14 at 08:32
1

I tried your command and it works for me, maybe in your file you use an instruction specific to phantom : http://docs.slimerjs.org/0.8/differences-with-phantomjs.html

But it should open the window(at least the start() ). Anyway the command is fine.

Fanch
  • 3,274
  • 3
  • 20
  • 51