gozer
A phantomJS wrapper for testing your CSS
Last updated 6 years ago by rylnd .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install gozer 
SYNC missed versions from official npm registry.

gozer

Build Status

Gozer

gozer is a phantomJS wrapper. It can do normal phantomJS stuff, using promises:

var Gozer = require('gozer');

// Load an instance pointed at http://localhost:3000
var gozer = new Gozer({port: 3000});

// Get a page
var page = gozer.visit('/');

// Do some stuff with the page
page
  .run(function() {
    return document.title;
  })
  .then(function(title) {
    console.log('The page title is', title);
  });

but that's not why we built it. We built gozer to test our CSS, so it really shines when it's used in a test framework. Here's an example using mocha and chai-as-promised:

var Gozer = require('gozer');

describe('google.com', function() {
  var gozer, page;

  before(function() {
    gozer = new Gozer({host: 'google.com'});
  });

  describe('the homepage', function() {
    beforeEach(function() {
      page = gozer.visit('/');
    });

    it('uses the arial font', function() {
      var fontPromise = page.getStyle('body', 'font-family');

      return expect(fontPromise).to.eventually.have.string('arial');
    });
  });
});

For more examples, check out gozer's own tests.

Installation and Setup

Gozer is meant to be used as a node module, so it's as simple as

npm install gozer

Current Tags

  • 0.1.2                                ...           latest (6 years ago)

9 Versions

  • 0.1.2                                ...           6 years ago
  • 0.1.1                                ...           6 years ago
  • 0.1.0                                ...           6 years ago
  • 0.0.6                                ...           6 years ago
  • 0.0.5                                ...           6 years ago
  • 0.0.4                                ...           6 years ago
  • 0.0.3                                ...           6 years ago
  • 0.0.2                                ...           6 years ago
  • 0.0.1                                ...           6 years ago
Maintainers (2)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (3)
Dev Dependencies (5)
Dependents (1)

Copyright 2014 - 2017 © taobao.org |