dalekjs / dalek

[unmaintained] DalekJS Base framework
MIT License
695 stars 63 forks source link

`Running tests` and nothing else #146

Closed greenkey closed 8 years ago

greenkey commented 9 years ago

Hi, I'm trying to make a Dockerfile to run Dalek:

FROM ubuntu:14.04
MAINTAINER Lorenzo Mele <lorenzo@nospam.com>

# update packages before install
RUN apt-get update

# install nodejs
RUN apt-get install nodejs npm -y
RUN ln `which nodejs` /usr/bin/node

# install Dalekjs
RUN npm install dalek-cli -g
# install the Dalek base framework & all its dependencies
RUN npm install dalekjs --save-dev

Then I built the image: sudo docker build -t "local/dalek" . Finally I entered in the VM: sudo docker run -i -t "local/dalek" /bin/bash

I created the file test/my_first_test.js as described here, then I launch the test and this is what appens:

root@a4a525e451da:/mnt/cwd# dalek test/my_first_test.js  -l 5
Running tests
☁ [SYSTEM] dalek-internal-driver: Loading driver: "native"
root@a4a525e451da:/mnt/cwd# 

What am I missing to make the test work?

greenkey commented 9 years ago

I also tried to use IE and an interesting error comes out:

root@11f70741ff23:/mnt/cwd# npm install dalek-browser-ie --save-dev
npm WARN package.json test@0.0.1 No repository field.
[...]
Done. IEDriver binary available at /mnt/cwd/node_modules/dalek-browser-ie/lib/bin/IEDriverServer.exe
[...]
root@11f70741ff23:/mnt/cwd# dalek test/my_first_test.js -l 5 -b IE
Running tests
☁ [SYSTEM] dalek-internal-driver: Loading driver: "native"
>> ERROR: TypeError: Cannot read property 'setBrowser' of null
root@11f70741ff23:/mnt/cwd# 
ghguy commented 9 years ago

What version of IE?

greenkey commented 9 years ago

I don't know, it's the version it downloads when I write npm install dalek-browser-ie --save-dev.

Is there a way to see which drivers and browsers I have and the relate versions?

ghguy commented 9 years ago

It is using whatever on your box. We know only IE 9 works well, that is assuming that your pages are rendered in standard mode. For quirks mode, I do not think the css selectors works decently. For IE 10 or above, it is very slow and might not work at all.

greenkey commented 9 years ago

Sorry, forget about IE.

Please look at the first post: it says Running tests but nothing happens...

ghguy commented 9 years ago

Do you mean ERROR: TypeError: Cannot read property 'setBrowser' of null? If so, have you installed IE driver? i.e. npm install dalek-browser-ie --save-dev ?

asciidisco commented 9 years ago

@greenkey Can you please report the Node.js version you´re installing in your container?

bobjflong commented 9 years ago

I just had this problem, where I got the output:

$ dalek test/test.js -b chrome -l 5
Running tests
☁ [SYSTEM] dalek-internal-driver: Loading driver: "native"

I tried node 0.10.25 and 0.10.30.

I fixed the issue by deleting node_modules and re-running npm install. My issue may have been caused by copying over a node_modules from a different machine.

yvess commented 9 years ago

I have the same problem. Only getting "Running tests"

Here are my versions

root@9d69733fb491:/# nodejs -v
v0.10.36

root@dabe0d2b6dc5:/# npm list -g
/usr/lib
├─┬ dalek-cli@0.0.5
└─┬ npm@1.4.28
...

  root@dabe0d2b6dc5:/# npm list
/
└─┬ dalekjs@0.0.9
  ├─┬ dalek-browser-phantomjs@0.0.4
  │ ├─┬ phantomjs@1.9.12
  ├─┬ dalek-driver-native@0.0.6
  │ ├─┬ dalek-internal-webdriver@0.0.5
...

You can reproduce it by running docker run -it --rm yvess/drone-fig bash -l and than run dalek /root/test.js The same same test.js file works on my mac. Any idea what could be the problem? All the node_models are freshly downloaded not copied from another place.

yvess commented 9 years ago

Ok solved the problem. This is quite a basic docker image, no font stuff installed. When I installed phantomjs separately and tried to run it there was an error, no libfreetype etc.

After installing the missing libs it worked.

apt-get install fontconfig-config fonts-dejavu-core libfontconfig1 libfreetype6 libjpeg-turbo8 libjpeg8

Perhaps it would be good if the phantomjs errors would be propagated, so that you see them.

greenkey commented 8 years ago

Well sorry for the huge late reply, but it's working! Many thanks to @yvess