Skip to content

Commit

Permalink
first experiments with selenium for DOM value testing
Browse files Browse the repository at this point in the history
  • Loading branch information
garethr committed Nov 22, 2008
1 parent b8dc740 commit 602b052
Show file tree
Hide file tree
Showing 4 changed files with 1,914 additions and 8 deletions.
24 changes: 16 additions & 8 deletions README
Expand Up @@ -2,9 +2,11 @@ CSS is hard to test automatically. Their appear to be two potential approaches
which might have merit in solving this problem and and this sample code
represents one of them.

The basic idea resolves around programatic comparison of images, some based on
screen shots and others generated dynamically from URLs. The capability to
analyse only a segment of a page has also been included.
test_image.py

The basic idea here resolves around programatic comparison of images, some
based on screen shots and others generated dynamically from URLs. The
capability to analyse only a segment of a page has also been included.

The overhead introduced by the need to take screenshots of a site makes this
technique more useful for spotting regression issues in a live site than for
Expand All @@ -15,10 +17,16 @@ As this is currently a proof of concept in that it only supports testing in
webkit, and even then only on OS X. Support for other browsers relies on
other screen grab tools being integrated into the code.

The sample code is written in Python but other implementations would be
straightforward. All of the actual work is done via other commands; namely
webkit2png by Paul Hammond and the Imagemagik suite of tools.

This is not intended as a tool to check whether a finished website looks
identical to a set of photoshop images. It's intended to spot changes in
unexpected areas of a sites layout or design.
unexpected areas of a sites layout or design.

test_dom.py

Here we plan on using Selenium to extract rendered DOM values like text-size
from a given web page and compare them against expected values. This could be useful both for regression testing and for assertion based test driven
development.

The sample code is written in Python but other implementations would be
straightforward. Much of the actual work is done via other commands; namely
webkit2png by Paul Hammond and the Imagemagik suite of tools.
Empty file added ext/__init__.py
Empty file.

4 comments on commit 602b052

@bradwright
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be bad to fork your code just to correct spelling? ;)

@NeilCrosby
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds reasonable to me :)

@SimonS
Copy link
Contributor

@SimonS SimonS commented on 602b052 Dec 1, 2008

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did exactly that, you can correct it directly in GitHub

@garethr
Copy link
Owner Author

@garethr garethr commented on 602b052 Dec 2, 2008

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I’ve merged Simon’s changes into my branch.

Please sign in to comment.