needle

Automated tests for your CSS.

Github stars Tracking Chart

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:

from needle.cases import NeedleTestCase

class BBCNewsTest(NeedleTestCase):
    def test_masthead(self):
        self.driver.get('http://www.bbc.co.uk/news/')
        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:

pip install sphinx

Then run:

cd docs
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:

$ tox

Main metrics

Overview
Name With Ownerpython-needle/needle
Primary LanguagePython
Program languagePython (Language Count: 1)
Platform
License:Other
所有者活动
Created At2010-12-30 00:59:36
Pushed At2022-11-05 17:23:40
Last Commit At2017-04-23 22:55:57
Release Count6
Last Release Name0.5.0 (Posted on )
First Release Name0.0.1 (Posted on )
用户参与
Stargazers Count592
Watchers Count22
Fork Count48
Commits Count159
Has Issues Enabled
Issues Count38
Issue Open Count15
Pull Requests Count28
Pull Requests Open Count5
Pull Requests Close Count21
项目设置
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private