项目作者: python-needle

项目描述 :
Automated tests for your CSS.
高级语言: Python
项目地址: git://github.com/python-needle/needle.git
创建时间: 2010-12-30T00:59:36Z
项目社区:https://github.com/python-needle/needle

开源协议:Other

下载


Needle

Build Status

Needle is a tool for testing visuals with Selenium
and nose.

It checks that visuals (CSS/fonts/images/SVG/etc.) render correctly by taking
screenshots of portions of a website and comparing them against known good
screenshots. It also provides tools for testing calculated CSS values and the
position of HTML elements.

Example

This is what a Needle test case looks like:

  1. from needle.cases import NeedleTestCase
  2. class BBCNewsTest(NeedleTestCase):
  3. def test_masthead(self):
  4. self.driver.get('http://www.bbc.co.uk/news/')
  5. self.assertScreenshot('#blq-mast', 'bbc-masthead')

This example checks for regressions in the appearance of the BBC’s masthead.

Documentation

Full documentation available on Read the Docs.

If you’d like to build the documentation yourself, first install sphinx:

  1. pip install sphinx

Then run:

  1. cd docs
  2. make html

The documentation will then be available browsable from
docs/_build/index.html.

Running Needle’s test suite

First install tox (usually via pip install tox). Then:

  1. $ tox