Port testing to phantomjs