0

Here's my set up on Ubuntu

  1. dalek and dalek-cli installed as instructed in the website, the version is displayed correctly
  2. phantomjs was installed via npm install but the phantomjs command could not be run
  3. installed phantomjs via apt-get ... now I have version 1.4
  4. in the folder /var/www/first_tests/ I have the package.json file provided in the website along with a subfolder tests containing first.js with the google example provided

I am in my homedirectory since that's the only place I can call dalek (I'm guessing because that where I was when I installed it) so I'm doing

dalekjs /var/www/first_tests/tests/*.js

The console shows "Running tests" but nothing happens. Trying to run

phantomjs /var/www/first_tests/tests/first.js

gives me "undefined:0 ReferenceError: Can't find variable: module"

Adrian Miu
  • 91
  • 1
  • 1
  • 4

1 Answers1

0

Dalek expects the PhantomJS binary in the:

node_modules/dalekjs/node_modules/dalek-browser-phantomjs/node_modules/phantomjs/bin

Folder. Also, it definitely needs version 1.9.0 or higher. You could try to download the binary from the PhantomJS homepage & manually copy it to the folder mentioned above.

It would be awesome, if you could send me (dalekjs@asciidisco.com) the npm debug log, so that I can check why this happened in the first place.

  • I'm sorry but I don't know where the npm debug log is. I'm getting the error ReferenceError: Can't find variable: module The content of the file is: module.exports = { 'Page title is correct': function (test) { test .open('http://google.com') .assert.title().is('Google', 'It has title') .done(); } }; – Adrian Miu Aug 27 '13 at 13:58
  • same here if I enter `dalek test.js`, I get "Running tests" and the stops. If i run `dalek -b phontomjs test.js` this error happens: `/node_modules/dalekjs/node_modules/dalek-driver-native/index.js:112 this.events.on('tests:complete:native:' + this.browserName, browser.kill.bind ^ TypeError: Cannot read property 'kill' of null` – xrado Sep 13 '13 at 21:24
  • The npm debug log can be found in the same folder where your package.json exists. If there is no debug log file, please retry with the latest stable version of Dalek. If it still does not work after updating, please post a gist or so with a reduced testcase, your OS & OS version, the Node version running & the contents of your package.json. Thank you. – Sebastian Golasch Oct 07 '13 at 16:41