Home > Tutorials > Installing and running Zombie.js

Installing and running Zombie.js

For some reason the current setup procedures on the zombie site doesn’t work. I’ve had to look for work-arounds.

The following steps were done for node v0.4.10 and npm v1.0.22

Installation Steps:

  1. Download zombie.tar.gz from here: http://www.box.net/shared/sq8nlkk24ijifhoya7fa
  2. Extract to your node_modules folder
  3. Open command prompt
  4. Install coffeescript by typing: “npm install coffeescript” (Coffeescript should already be there, but still do this just in case)
  5. Type: “cake setup”
  6. Type: “cake clean”
  7. Type: “cake install”

Running Zombie.js

There are different BDD frameworks (node modules) available to execute Zombie scripts:

Sample Scripts

  • Jasmine-Node example: https://github.com/jbueza/zombie-microsoft-sql
  • Vows example:
    var zombie = require('zombie'),
    vows = require('vows'),
    assert = require('assert');
    
    var baseUrl = 'http://www.google.ca/';
    
    vows.describe('Zombie Tests on Google.ca').addBatch({
    'Navigate to Google.ca' : {
        topic: function () {
    	browser = new zombie.Browser({ debug: true });
    	browser.runScripts = false;
    	browser.on('error',function (err){console.log(err.stack)});
    	browser.on('done',function (done){console.log(done.document.cookie)});
    	browser.visit(baseUrl, this.callback);
     	},
        'Should be on Google homepage' : function (browser) {
    	assert.equal(browser.location, baseUrl);
    	},
        'Title should be correct' : function (browser) {
    	assert.equal(browser.text("title"), "Google");
    	},
        'Browser is not redirected' : function (browser) {
    	var redirect = browser.redirected;
    	assert.equal(redirect,false);
    	},
        'There is a button with name "btnG"' : function(browser) {
    	assert.ok(browser.button("btnG"));
    	},
        'and Search for "Test"' : {
    	topic: function (browser) {
    		browser.fill("q","Test");
    		browser.pressButton("btnG",this.callback);
    		},
    	'Title is correct' : function (browser) {
    		assert.equal(browser.text("title"), "Test - Google Search");
    		}
    	}
      },
    }).export(module);
Advertisements
Categories: Tutorials
  1. May 27, 2013 at 10:26 pm

    I am glad for writing to make you be aware of of the magnificent encounter my cousin’s princess undergone reading through your web site. She mastered a lot of pieces, most notably how it is like to have an excellent teaching heart to let a number of people without difficulty fully understand several advanced subject areas. You actually surpassed readers’ expected results. I appreciate you for offering such useful, trustworthy, informative as well as easy tips about this topic to Janet.

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: