Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Taking snapshots of the webpage while unit testing using phantomjs and jasmine

I can't seem to get communication of jasmine and phantomjs working. I'm using the run-jasmine.js file in the examples folder for phantomjs. The problem I get is that the file can't find system so it can't require it.

This is the specific message:

undefined:0 Unknown module system for require()

On top of that, I was wondering how to get dom manipulation of the html file working with jasmine.

EDIT: It looks like the DOM issue was simple since it's just using phantom js's headless browser functionality. I still have the system problem, and I'm wondering how to call render page in between each test rather than when the page is done loading.

like image 837
prashn64 Avatar asked May 09 '12 19:05

prashn64


1 Answers

I solved the issue by following the instructions on this page

https://groups.google.com/forum/#!topic/phantomjs/Ac-77s4kFGk

Basically if you are installing phantomjs from the debian repository it is not up-to-date. Installing the latest version from their official website does the trick.

like image 157
Odin Avatar answered Oct 16 '22 21:10

Odin