Setup PhantomJS for automate testing

Posted on in Environment Jasmine TDD

All your Jasmine TDD tests you can automate with PhantomJS.
This blog post will tell you how to setup your environment for automated testing with PhantomJS.

You should have a local webserver running. It it might be handy to have Jasmine already up and go.
Please see my post:

Get PhantomJS.
You can download it for MAC & Windows from:
- Windows users can run the exe file.
- Mac OSX users can run bin/phantomjs
But make sure you add phantomjs to your paths.

For Mac users, you can also install PhantomJS with homebrew.
To get homebrew you will need to have Ruby installed.
Use the following commands on your terminal:

whoami (it will prompt ur username: for example lee)
sudo chown lee:staff /usr/local
sudo chmod 0777 /usr/local
ruby <(curl -fsSkL

Now that you have brew on your Mac, you can use the following command to install PhantomJS:

brew update && brew install phantomjs

After everything is installed, you should type the following command in your command/terminal.

phantomjs --version

When everything is correctly installed it should output you the version number of PhantomJS!