Phantom is a headless webkit for front-end testing.
You can download executable file on their website. (Direct link for phantomjs-2.1.3)
But you will soon get following error if you’re using Ubuntu 17.10.
1 | phantomjs: error while loading shared libraries: libicui18n.so.55: cannot open shared object file: No such file or directory |
It seems like we have missing dependency of libicu55
. If you try to resolve this dependancy issue by using apt, you won’t be successful.
1 | $ sudo apt install libicu55 |
You have to download the package manually and install it.
1 | $ wget http://security.ubuntu.com/ubuntu/pool/main/i/icu/libicu55_55.1-7ubuntu0.3_amd64.deb -P /tmp/ |
Testing phantomjs
1 | $ vim hello.js |
1 | console.log('Hello, world!'); |
1 | $ ./phantomjs hello.js |
1 | Hello, world! |