A: 

I can't imagine there's a way to test how something "looks" other than looking at it. I might be completely wrong there. Is it that tedious to view your pages in a browser?

The main reason programmers write tests is because there are many levels of "unknowns" or dynamic pages or dynamic results, so mind-numbingly changing data for each possibility can be quite tedious.

Your case seems to just involve aesthetics and how something looks.

However, you can use something like JSUnit for javascript testing.

Jack Marchetti
I appreciate CSS is the "style" of a page, but I was trying to convey that some of the stylesheet defines function.My main concern is not that something might not look right, but that it might not work correctly, hence looking for automatic testing for peace of mind if nothing else.
John Catterfeld
Right but like what functionality is your CSS doing? CSS just defines the way something is layed out or how it looks correct?
Jack Marchetti
A: 

This seems like more work than just taking a look at the page. Setting up these test cases (that might be different for every situation) would take more time than simply looking at the page, clicking a link that opens a modal dialog, and seeing if it is indeed appearing above the content. I don't really see any advantages to this at all.

The only "testing" that you can really accomplish is through validation.

dmackerman
+1  A: 

w3 validation and Adobe Browser Labs are the best solution I can provide to this problem. Back when I was doing UI layout and design (read=cutup monkey) those were my two best friends.

There's really no way to automate testing how something looks. So, you're back to either visually inspecting everything yourself or crowdsourcing (or insourcing) a tester to do the same thing for you. It ain't fun, but it keeps us Front-end guys in business.

The good news is, many browsers share rendering engines. So, if you test correctly on Chrome, you can bet you're going to be fine in Safari. Check in Firefox and IE and you've got 90% of your problems solved. Then, determine how picky you (or your boss) wants to be and test accordingly.

lodge387
Thanks for your answers. I've got all the manual cross-browser testing accounted for, but was hoping (read=clutching at straws?) that I could automate some of it.
John Catterfeld
+2  A: 

Have a look into Selenium - it's a browser-based automated testing tool. I think it's what you're looking for.

It works with all browsers (it has an IDE in Firefox for creating your test scripts, but the scripts themselves can be run in any browser)

It allows you to test the contents of the DOM, etc against the expected output at any point during the script.

Spudley
Selenium is a pretty niffy tool. There's a learning curve, but it's not too steep.
Jack Marchetti